hyperscan icon indicating copy to clipboard operation
hyperscan copied to clipboard

Segmentation fault on Linux

Open seviezhou opened this issue 5 years ago • 2 comments

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);

seviezhou avatar Aug 15 '20 02:08 seviezhou

I am not able to reproduce this error under the same configuration. What is your CPU platform and command to run hscheck?

xiangwang1 avatar Aug 17 '20 01:08 xiangwang1

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)

seviezhou avatar Aug 17 '20 03:08 seviezhou