我正在用 guile 开发一个应用程序,但我遇到了一些奇怪的错误。我怀疑这些错误是由 guile 或它使用的某些库中的未初始化变量引起的。guile 版本 2.0 和 2.2 都会出现此问题。
当我使用 valgrind 运行 guile 时,出现以下错误(以及其他错误):
==9945== Conditional jump or move depends on uninitialised value(s)
==9945== at 0x4D5005B: GC_push_all_eager (mark.c:1583)
==9945== by 0x4D514C4: GC_push_current_stack (mark_rts.c:695)
==9945== by 0x4D4B254: GC_with_callee_saves_pushed (mach_dep.c:322)
==9945== by 0x4D51535: GC_push_regs_and_stack (mark_rts.c:772)
==9945== by 0x4D5163E: GC_push_roots (mark_rts.c:845)
==9945== by 0x4D4D8F5: GC_mark_some (mark.c:351)
==9945== by 0x4D42CBA: GC_stopped_mark (alloc.c:702)
==9945== by 0x4D4283C: GC_try_to_collect_inner (alloc.c:488)
==9945== by 0x4D527B1: GC_init (misc.c:1292)
==9945== by 0x48BBC22: ??? (in /usr/lib/x86_64-linux-gnu/libguile-2.2.so.1.3.1)
==9945== by 0x48C46EE: ??? (in /usr/lib/x86_64-linux-gnu/libguile-2.2.so.1.3.1)
==9945== by 0x491826D: ??? (in /usr/lib/x86_64-linux-gnu/libguile-2.2.so.1.3.1)
==9945== Uninitialised value was created by a stack allocation
==9945== at 0x4D4B182: GC_with_callee_saves_pushed (mach_dep.c:227)
==9945==
==9945== Conditional jump or move depends on uninitialised value(s)
==9945== at 0x4D50063: GC_push_all_eager (mark.c:1583)
==9945== by 0x4D514C4: GC_push_current_stack (mark_rts.c:695)
==9945== by 0x4D4B254: GC_with_callee_saves_pushed (mach_dep.c:322)
==9945== by 0x4D51535: GC_push_regs_and_stack (mark_rts.c:772)
==9945== by 0x4D5163E: GC_push_roots (mark_rts.c:845)
==9945== by 0x4D4D8F5: GC_mark_some (mark.c:351)
==9945== by 0x4D42CBA: GC_stopped_mark (alloc.c:702)
==9945== by 0x4D4283C: GC_try_to_collect_inner (alloc.c:488)
==9945== by 0x4D527B1: GC_init (misc.c:1292)
==9945== by 0x48BBC22: ??? (in /usr/lib/x86_64-linux-gnu/libguile-2.2.so.1.3.1)
==9945== by 0x48C46EE: ??? (in /usr/lib/x86_64-linux-gnu/libguile-2.2.so.1.3.1)
==9945== by 0x491826D: ??? (in /usr/lib/x86_64-linux-gnu/libguile-2.2.so.1.3.1)
==9945== Uninitialised value was created by a stack allocation
==9945== at 0x4D4B182: GC_with_callee_saves_pushed (mach_dep.c:227)
==9945==
我在函数 GC_with_callee_saves_pushed 中找不到任何未初始化的值。我试图将 GC_with_callee_saves_pushed 中的上下文变量 memset 为 0,但它没有帮助。跟踪中 GC_with_callee_saved_pushed 的第二个参数来自 alloc.c 的第 702 行中对 GC_approx_sp 的函数调用。
GC_with_callee_saves_pushed 中编译的条件分支是“#if defined(UNIX_LIKE)...”之后的分支。"#if defined(HAVE_BUILTIN_UNWIND_INIT)" 的 else 分支未编译。
这个错误是否与 此类似
你有什么想法如何推进这件事吗?