bazelbuild / rules_fuzzing

Bazel Starlark extensions for defining fuzz tests in Bazel projects
Apache License 2.0
82 stars 19 forks source link

Clusterfuzz Jazzer builds fail in v0.3.0 #193

Closed stefanbucur closed 2 years ago

stefanbucur commented 2 years ago

Error log:

libc++abi: terminating with uncaught exception of type std::runtime_error: JNI_CreateJavaVM returned code -1
AddressSanitizer:DEADLYSIGNAL
=================================================================
==263==ERROR: AddressSanitizer: ABRT on unknown address 0x000000000107 (pc 0x7fdccbf0218b bp 0x7ffc3acdb3f0 sp 0x7ffc3acdaac0 T0)
SCARINESS: 10 (signal)
==263==WARNING: invalid path to external symbolizer!
==263==WARNING: Failed to use and restart external symbolizer!
    #0 0x7fdccbf0218b  (/lib/x86_64-linux-gnu/libc.so.6+0x4618b)
    #1 0x7fdccbee1858  (/lib/x86_64-linux-gnu/libc.so.6+0x25858)
    #2 0x484695  (/tmp/not-out/tmpzrlj_s8f/NativeUbsanFuncPtrFuzzTest.runfiles/rules_fuzzing_oss_fuzz/jazzer_driver_with_sanitizer+0x484695)
    #3 0x46e31e  (/tmp/not-out/tmpzrlj_s8f/NativeUbsanFuncPtrFuzzTest.runfiles/rules_fuzzing_oss_fuzz/jazzer_driver_with_sanitizer+0x46e31e)
    #4 0x46e1e2  (/tmp/not-out/tmpzrlj_s8f/NativeUbsanFuncPtrFuzzTest.runfiles/rules_fuzzing_oss_fuzz/jazzer_driver_with_sanitizer+0x46e1e2)
    #5 0x486455  (/tmp/not-out/tmpzrlj_s8f/NativeUbsanFuncPtrFuzzTest.runfiles/rules_fuzzing_oss_fuzz/jazzer_driver_with_sanitizer+0x486455)
    #6 0x4863ef  (/tmp/not-out/tmpzrlj_s8f/NativeUbsanFuncPtrFuzzTest.runfiles/rules_fuzzing_oss_fuzz/jazzer_driver_with_sanitizer+0x4863ef)
    #7 0x39b715  (/tmp/not-out/tmpzrlj_s8f/NativeUbsanFuncPtrFuzzTest.runfiles/rules_fuzzing_oss_fuzz/jazzer_driver_with_sanitizer+0x39b715)
    #8 0x390dfe  (/tmp/not-out/tmpzrlj_s8f/NativeUbsanFuncPtrFuzzTest.runfiles/rules_fuzzing_oss_fuzz/jazzer_driver_with_sanitizer+0x390dfe)
    #9 0x39148e  (/tmp/not-out/tmpzrlj_s8f/NativeUbsanFuncPtrFuzzTest.runfiles/rules_fuzzing_oss_fuzz/jazzer_driver_with_sanitizer+0x39148e)
    #10 0x38fed0  (/tmp/not-out/tmpzrlj_s8f/NativeUbsanFuncPtrFuzzTest.runfiles/rules_fuzzing_oss_fuzz/jazzer_driver_with_sanitizer+0x38fed0)
    #11 0x3e73e6  (/tmp/not-out/tmpzrlj_s8f/NativeUbsanFuncPtrFuzzTest.runfiles/rules_fuzzing_oss_fuzz/jazzer_driver_with_sanitizer+0x3e73e6)
    #12 0x3fe7c0  (/tmp/not-out/tmpzrlj_s8f/NativeUbsanFuncPtrFuzzTest.runfiles/rules_fuzzing_oss_fuzz/jazzer_driver_with_sanitizer+0x3fe7c0)
    #13 0x7fdccbee30b2  (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
    #14 0x2e294d  (/tmp/not-out/tmpzrlj_s8f/NativeUbsanFuncPtrFuzzTest.runfiles/rules_fuzzing_oss_fuzz/jazzer_driver_with_sanitizer+0x2e294d)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: ABRT (/lib/x86_64-linux-gnu/libc.so.6+0x4618b) 
==263==ABORTING

@fmeum can you look into it? I can release a v0.3.1 with the fix.

stefanbucur commented 2 years ago

Also see for example: https://github.com/bazelbuild/rules_fuzzing/runs/4870312891?check_suite_focus=true

fmeum commented 2 years ago

On it, see also https://github.com/bazelbuild/rules_fuzzing/pull/192#issuecomment-1016633152.

fmeum commented 2 years ago

The build broke because Bazel 5.0.0 got released a few hours ago and we neither pin a Bazel version in rules_fuzzing nor run CI checks against something like last_green.

My guess is that https://github.com/bazelbuild/bazel/commit/20061f8fb7ed95924c6cdbaaaf3d06a64edf974e is causing issues with the native library needed as runfiles. I will see whether I can fix the logic.