intel / hyperscan

High-performance regular expression matching library
https://www.hyperscan.io
Other
4.84k stars 722 forks source link

Should it work under Memory Sanitizer and Undefined Behavior Sanitizer? #250

Open alexey-milovidov opened 4 years ago

alexey-milovidov commented 4 years ago

It fails in our builds: https://github.com/ClickHouse/ClickHouse/pull/11718

MSan fails in roseRunProgram: https://clickhouse-test-reports.s3.yandex.net/11718/abb59a262134987adf07b99d714efa51dcea170b/functional_stateful_tests_(memory)/stderr.log

UBSan fails in ../contrib/hyperscan/src/nfa/mcclellan.c:1136:33: runtime error: applying zero offset to null pointer: https://clickhouse-test-reports.s3.yandex.net/11718/e85227ce2e6df40b33d11b15b37775411bcad1f2/functional_stateful_tests_(ubsan)/stderr.log

Another question: why do you have -fno-strict-aliasing and -O2 instead of -O3?

xiangwang1 commented 4 years ago

Thanks for the questions.

-fno-strict-aliasing and -O2 is only for compile time code which involves complex analysis and database generation that may not strictly comply with the aliasing rule. This option was written many years ago by our former engineer. It works good in our internal large scale nightly testing with both realistic and synthetic patterns and input traffic.

alexey-milovidov commented 4 years ago

Thank you!