PyPy2.7 crashes on jit (SEGV)
Our app uses PyPy2.7, it crashes routinely.
The system we are using is
Debian 3.16.43, and we've tried upgrade
7.1.0, and recently
7.3.3, the problem remains.
This is the ASan report, which is basically the same with the stack in core dump file.
================================================================= ==9403==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7fd930bf3c47 bp 0x7fd9341a6480 sp 0x7fff73dab160 T0) ==9403==The signal is caused by a READ memory access. ==9403==Hint: address points to the zero page. #0 0x7fd930bf3c46 in pypy_g_jitframe_trace___trace_drag_out /tmp/usession-release-pypy2.7-v7.3.3rc2-8/testing_1/rpython_jit_backend_llsupport.c:1882 #1 0x7fd93232e6ad in pypy_g_trace___trace_drag_out /tmp/usession-release-pypy2.7-v7.3.3rc2-8/testing_1/rpython_memory_gc.c:10008 #2 0x7fd93232fbcb in pypy_g_IncrementalMiniMarkGC_collect_oldrefs_to_nursery /tmp/usession-release-pypy2.7-v7.3.3rc2-8/testing_1/rpython_memory_gc.c:4290 #3 0x7fd93233b487 in pypy_g_IncrementalMiniMarkGC__minor_collection /tmp/usession-release-pypy2.7-v7.3.3rc2-8/testing_1/rpython_memory_gc.c:2276 #4 0x7fd932349994 in pypy_g_IncrementalMiniMarkGC_minor_collection_with_majo /tmp/usession-release-pypy2.7-v7.3.3rc2-8/testing_1/rpython_memory_gc.c:11531 #5 0x7fd932349994 in pypy_g_IncrementalMiniMarkGC_collect_and_reserve /tmp/usession-release-pypy2.7-v7.3.3rc2-8/testing_1/rpython_memory_gc.c:7098 #6 0x7fd9316991a2 in pypy_g_PropagateExceptionDescr_handle_fail /tmp/usession-release-pypy2.7-v7.3.3rc2-8/testing_1/rpython_jit_metainterp_5.c:645 #7 0x7fd931426ed3 in pypy_g_assembler_call_helper_92 /tmp/usession-release-pypy2.7-v7.3.3rc2-8/testing_1/rpython_jit_metainterp_2.c:31387 #8 0x7fd88ce84701 (<unknown module>) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV /tmp/usession-release-pypy2.7-v7.3.3rc2-8/testing_1/rpython_jit_backend_llsupport.c:1882 in pypy_g_jitframe_trace___trace_drag_out ==9403==ABORTING
I looked up the rpython source code, my intuition tells me is the
cast_instance_to_gcref(memory_error) cause the crash, which seems have something to do with JIT, since it matches the calling stack appears in ASan report, but I have no idea what does this line of code mean.
class PropagateExceptionDescr(AbstractFailDescr): def handle_fail(self, deadframe, metainterp_sd, jitdriver_sd): cpu = metainterp_sd.cpu exception = cpu.grab_exc_value(deadframe) if not exception: exception = cast_instance_to_gcref(memory_error) assert exception, "PropagateExceptionDescr: no exception??" raise jitexc.ExitFrameWithExceptionRef(exception)
Since our codebase is way too huge and complex, we have yet to identify which part of code causes the crash.
I know it's difficult for you guys to do anything without reproducing, any hints of what may cause the problem would be helpful. Thanks.