nus-apr / CrashRepair

Security Vulnerability Repair via Concolic Execution and Code Mutations
17 stars 1 forks source link

Build error for coreutils/gnubug-25023 prior to fuzzing #155

Closed yannicnoller closed 1 year ago

yannicnoller commented 1 year ago
root@c962e06ed6f2:/data/vulnloc/coreutils/gnubug-25023# crashrepair fuzz bug.json
2023-04-13 10:33:49.934 | INFO     | crashrepair.scenario:build:252 - loaded bug scenario: Scenario(subject='coreutils', name='gnubug-25023', directory='/data/vulnloc/coreutils/gnubug-25023', build_directory='/data/vulnloc/coreutils/gnubug-25023/src', source_directory='/data/vulnloc/coreutils/gnubug-25023/src', tag_id='coreutils_gnubug-25023', binary_path='/data/vulnloc/coreutils/gnubug-25023/src/src/pr', clean_command='make clean', prebuild_command='exit 0', build_command='make CFLAGS="-ggdb -fPIC -fPIE ${INJECT_CFLAGS:-}" CXXFLAGS="-ggdb -fPIC -fPIE ${INJECT_CXXFLAGS:-}" LDFLAGS="${INJECT_LDFLAGS:-}" src/pr', crashing_command='"-S$(printf "\t\t\t")" a -m $POC', crashing_input='/CrashRepair/experiments/vulnloc/coreutils/gnubug-25023/tests/1.txt', shell=Shell(cwd='/data/vulnloc/coreutils/gnubug-25023'), crash_test=Test(name='crash', command='/data/vulnloc/coreutils/gnubug-25023/src/src/pr "-S$(printf "\t\t\t")" a -m /CrashRepair/experiments/vulnloc/coreutils/gnubug-25023/tests/1.txt', expected_exit_code=1, bad_output='SUMMARY: AddressSanitizer', asan_options=None, ubsan_options=None), sanitizer_flags='-fsanitize=address', additional_klee_flags='', expected_exit_code_for_crashing_input=0, should_terminate_early=True, fuzzer_tests=[], fuzzer=Fuzzer(config=FuzzerConfig(crash_command_template=['/data/vulnloc/coreutils/gnubug-25023/src/pr', '-S***', 'tmp2', '-m', 'tmp2'], crash_tag='asan;0;src/pr.c:2241', poc_format=['str', 'str', 'str', 'str', 'str', 'str'], poc_values=['\\', 't', '\\', 't', '\\', 't'], trace_command_template=['/data/vulnloc/coreutils/gnubug-25023/src/pr', '-S***', 'tmp2', '-m', 'tmp2'], store_all_inputs=False, max_combinations=1, mutate_range='default;default;default;default;default;default', seed=3, timeout_global=60, timeout_local=60), scenario=...), time_limit_minutes_validation=None, time_limit_seconds_single_test=30, time_limit_minutes_analysis=3600, halt_on_error=True, rebuild_for_validation=False, asan_options=None, ubsan_options=None, use_ghost_functions=False, acceptable_patch_limit=None)
2023-04-13 10:33:49.935 | DEBUG    | crashrepair.scenario:rebuild:356
...
make[2]: Leaving directory '/data/vulnloc/coreutils/gnubug-25023/src/gnulib-tests'
make[1]: Leaving directory '/data/vulnloc/coreutils/gnubug-25023/src/gnulib-tests'
2023-04-13 10:33:51.628 | DEBUG    | crashrepair.shell:__call__:38 - executing: bear make CFLAGS="-ggdb -fPIC -fPIE ${INJECT_CFLAGS:-}" CXXFLAGS="-ggdb -fPIC -fPIE ${INJECT_CXXFLAGS:-}" LDFLAGS="${INJECT_LDFLAGS:-}" src/pr
  CC       src/pr.o
clang-6.0: warning: -lkleeRuntest: 'linker' input unused [-Wunused-command-line-argument]
clang-6.0: warning: -lcrepair_runtime: 'linker' input unused [-Wunused-command-line-argument]
clang-6.0: warning: -lcrepair_proxy: 'linker' input unused [-Wunused-command-line-argument]
clang-6.0: warning: -lcrepair_runtime: 'linker' input unused [-Wunused-command-line-argument]
clang-6.0: warning: -lcrepair_proxy: 'linker' input unused [-Wunused-command-line-argument]
clang-6.0: warning: -lkleeRuntest: 'linker' input unused [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-L/klee/build/lib' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-L/CrashRepair/lib' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-L/CrashRepair/compiler/../lib/' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-L/klee/build/lib/' [-Wunused-command-line-argument]
In file included from src/pr.c:314:
src/system.h:43:10: fatal error: 'configmake.h' file not found
#include "configmake.h"
         ^~~~~~~~~~~~~~
1 error generated.
ERROR:Failed to compile using given arguments: [-g -O0 -include /CrashRepair/compiler/../lib/crepair_runtime.h -I. -I./lib -Ilib -I./lib -Isrc -I./src -ggdb -fPIC -fPIE -g -O0 -Wno-error -L/klee/build/lib -lkleeRuntest -I/CrashRepair/lib -L/CrashRepair/lib -lcrepair_runtime -lcrepair_proxy -fsanitize=address -MT src/pr.o -MD -MP -MF src/.deps/pr.Tpo -c -o src/pr.o src/pr.c -L/CrashRepair/compiler/../lib/ -L/klee/build/lib/ -lcrepair_runtime -lcrepair_proxy -lkleeRuntest]
Makefile:8988: recipe for target 'src/pr.o' failed
make: *** [src/pr.o] Error 1
ERROR: Command 'bear make CFLAGS="-ggdb -fPIC -fPIE ${INJECT_CFLAGS:-}" CXXFLAGS="-ggdb -fPIC -fPIE ${INJECT_CXXFLAGS:-}" LDFLAGS="${INJECT_LDFLAGS:-}" src/pr' returned non-zero exit status 2.
Traceback (most recent call last):
  File "shim.py", line 7, in <module>
  File "crashrepair/cli.py", line 146, in main
  File "crashrepair/cli.py", line 139, in main
  File "crashrepair/cli.py", line 32, in do_fuzz
  File "crashrepair/scenario.py", line 417, in fuzz
  File "crashrepair/fuzzer.py", line 151, in fuzz
  File "crashrepair/scenario.py", line 396, in rebuild
  File "crashrepair/shell.py", line 53, in __call__
  File "subprocess.py", line 460, in check_returncode
subprocess.CalledProcessError: Command 'bear make CFLAGS="-ggdb -fPIC -fPIE ${INJECT_CFLAGS:-}" CXXFLAGS="-ggdb -fPIC -fPIE ${INJECT_CXXFLAGS:-}" LDFLAGS="${INJECT_LDFLAGS:-}" src/pr' returned non-zero exit status 2.
[7619] Failed to execute script 'shim' due to unhandled exception!
root@c962e06ed6f2:/data/vulnloc/coreutils/gnubug-25023#
yannicnoller commented 1 year ago

Ridwan reported the same issue also for gnubug-25003

ChrisTimperley commented 1 year ago

I'm looking into a fix for this now.