It looks as if there's an access violation in Hyperscan. Can you help find
& fix it?
I made simple updates to the Hyperscan library to build a DLL for Windows.
When I compile the DLL using Release mode, it shows access violations in
FDR_EXEC_TEDDY when attempting a simple match.
To reproduce (replace BOOST_ROOT with your BOOST_ROOT):
git clone git@github.com:wurp/hyperscan.git
mkdir access-violation
cd access-violation
cmake -G "Visual Studio 15 2017 Win64" -DBUILD_SHARED_LIBS=ON
-DBOOST_ROOT:PATH=c:\CxCache\boost.1.67.0.0\lib\native\include ..
cmake --build . --config Release
bin\hscheck.exe
I put the code that evokes the AV in tools/hscheck/main.cpp. The crux of it
is this:
hs_database_t* pRegexDatabase = nullptr;
hs_compile_error_t *compile_err = nullptr;
hs_error_t hsError = hs_compile(
"Sample?Value",
0,
HS_MODE_BLOCK,
nullptr,
&pRegexDatabase,
&compile_err);
if (hsError != HS_SUCCESS)
{
printf("Dead 1\n");
exit(-2);
}
hs_scratch_t* pScratch = nullptr;
hsError = hs_alloc_scratch(pRegexDatabase, &pScratch);
if (hsError != HS_SUCCESS)
{
printf("Dead 2\n");
exit(-2);
}
bool matched = false;
printf("Scan 1\n");
hsError = hs_scan(
pRegexDatabase,
"Sample\?Value",
12,
0,
pScratch,
blowupEventHandler,
&matched);
if (hsError != HS_SUCCESS)
{
printf("Dead 3\n");
exit(-2);
}
printf("Scan 2\n");
hsError = hs_scan(
pRegexDatabase,
"SampleeValue",
12,
0,
pScratch,
blowupEventHandler,
&matched);
if (hsError != HS_SUCCESS)
{
printf("Dead 4\n");
exit(-2);
}
printf("good exit");
The output shows "Scan 1", but never shows "Scan 2" or any
"Dead"/"good"
message.
Note that I see no AV when building with /MT (non-DLL runtime) nor when
compiling with /MDd (DLL runtime with debug info).
Thanks!
Bobby
Show replies by date