HexHive / retrowrite

RetroWrite -- Retrofitting compiler passes through binary rewriting
Other
655 stars 78 forks source link

[BUG] Segmentation fault in reassembled SPEC2006 binaries with asan tool #49

Open mahwisharif opened 10 months ago

mahwisharif commented 10 months ago

Describe the bug When SPEC2006 benchmarks are rewritten using Retrowrite ASAN tool, and recompiled and run, I am getting "Segmentation Fault(core dumped)" .

Describe how to reproduce the bug Step 1) for compiling PIE to be used as input to retrowrite ASAN tool platform: x86-64 compiler: gcc 5.5 compiler flags: -O2 -PIE benchmarks: SPEC2006 benchmarks: gcc, bzip2, ....

Step 2) platform: x86-64

        python3 -m rwtools.asan.asantool ./bzip2_base.gcc ./bzip2_base.gcc-asan
        sed -i 's/asan_init_v4/asan_init/g' bzip2_base.gcc-asan.s

Step 3) For compiling -asan.s file generated by retrowrite platform: x86-64 compiler: gcc 5.5 compiler flags: -O2 benchmarks: SPEC2006 benchmarks: gcc, bzip2, .... Compile SPEC : gcc -g -o bzip2_base.gcc-asan -O2 bzip2_base.gcc-asan.s -pie -lasan -lm