intel / intel/hyperscan

Make a public function to verify sanity of the database

Open
#389 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
5.5k
Forks
816
Avg merge
4d 21h
Merged PRs (30d)
2

Description

We have found an issue when `mmap`-ing Hyperscan databases when a library version is changed. The full issue is here: https://github.com/rspamd/rspamd/issues/4409

The problem is that `hs_allocate_scratch` is an expensive call that should not be used to test database. And if it fails, it is hard to rewind the process of database compilation instead of loading a cached version.

Scratch allocation function uses [dbValid](https://github.com/intel/hyperscan/blob/v5.4.1/src/scratch.c#L254) to ensure that database is consistent. However, this function is not public. It would be super useful to have such a function in the public API to avoid migration issues when dealing with the mmap'ed databases.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.