Skip to content

Commit 1f2bdf9

Browse files
authored
driver: Fix startup crash when fuzzing native libraries (#883)
driver: Fix startup crashes when fuzzing native libraries Fixes a JVM crash with the following frame while fuzzing native libraries: ``` [libstdc++.so.6+0x13bf8a] std::ostream::sentry::sentry(std::ostream&)+0x1a ```
1 parent 7b17073 commit 1f2bdf9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/native/com/code_intelligence/jazzer/driver/libfuzzer_callbacks.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ extern "C" [[maybe_unused]] bool __sanitizer_weak_is_relevant_pc(
119119
Java_com_code_1intelligence_jazzer_runtime_TraceDataFlowNativeCallbacks_handleLibraryLoad(
120120
JNIEnv *, jclass) {
121121
std::call_once(ignore_list_flag, [] {
122+
// Force std::cout to be fully initialized.
123+
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26123
124+
static std::ios_base::Init initIostreams;
122125
std::cout << "INFO: detected a native library load, enabling interception "
123126
"for libc functions"
124127
<< std::endl;

0 commit comments

Comments
 (0)