hyperscan
hyperscan copied to clipboard
Segmentation fault on Linux
System info
Ubuntu x86_64, clang 6.0, hyperscan (latest master c00683)
Configure
cmake .. -DCMAKE_CXX_FLAGS="-fsanitize=address -g" -DCMAKE_C_FLAGS="-fsanitize=address -g" -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address"
Problem
When I ran executables under bin, all of them crashes with Segmentation fault (core dumped)
GDB Output
(gdb) r
Starting program: /home/seviezhou/hyperscan/build/bin/hscheck
Program received signal SIGSEGV, Segmentation fault.
0x0000000000daaea6 in cpuid (leaf=0, op=<optimized out>, eax=<optimized out>,
ebx=<optimized out>, ecx=<optimized out>, edx=<optimized out>)
at /home/seviezhou/AlphaFuzz/targets/hyperscan/src/util/cpuid_inline.h:50
50 __cpuid_count(op, leaf, *eax, *ebx, *ecx, *edx);
I am not able to reproduce this error under the same configuration. What is your CPU platform and command to run hscheck?
It seems that when I do coverage instrumentations with ASAN like in AFL, it will crash, but when there are no instrumentations or only coverage instrumentations without ASAN, it works well. The way to reproduce it:
setup
git clone https://github.com/intel/hyperscan.git
cd hyperscan
git clone https://github.com/google/AFL
cd AFL
make
cd llvm_mode
make
cd ../../
export AFL_USE_ASAN=1
export HYPERSCAN_PATH=`pwd`
mkdir build && cd build
cmake .. -DCMAKE_C_COMPILER=$HYPERSCAN_PATH/AFL/afl-clang-fast -DCMAKE_CXX_COMPILER=$HYPERSCAN_PATH/AFL/afl-clang-fast++
make -j
run
$ ./bin/hscheck
Segmentation fault (core dumped)