@@ -82,6 +82,8 @@ _PyJit_RegisterCode(const void *code_addr, size_t code_size,
8282 const char * entry , const char * filename )
8383{
8484 jit_register_perf_code (code_addr , code_size , entry , filename );
85+ // Perf publication has no teardown handle, so it is intentionally
86+ // not counted below.
8587
8688#if !defined(PY_HAVE_JIT_GDB_UNWIND ) \
8789 && !defined(PY_HAVE_JIT_GNU_BACKTRACE_UNWIND )
@@ -93,18 +95,20 @@ _PyJit_RegisterCode(const void *code_addr, size_t code_size,
9395 return NULL ;
9496 }
9597
96- int registered = 0 ;
98+ // Partial failures are non-fatal: the JIT code can still execute, but
99+ // unavailable tooling may not be able to unwind it.
100+ int any_registered = 0 ;
97101# if defined(PY_HAVE_JIT_GDB_UNWIND )
98102 jit_register_gdb_code (
99103 registration , code_addr , code_size , entry , filename );
100- registered |= registration -> gdb_handle != NULL ;
104+ any_registered |= registration -> gdb_handle != NULL ;
101105# endif
102106# if defined(PY_HAVE_JIT_GNU_BACKTRACE_UNWIND )
103107 jit_register_gnu_backtrace_code (
104108 registration , code_addr , code_size );
105- registered |= registration -> gnu_backtrace_handle != NULL ;
109+ any_registered |= registration -> gnu_backtrace_handle != NULL ;
106110# endif
107- if (!registered ) {
111+ if (!any_registered ) {
108112 PyMem_RawFree (registration );
109113 return NULL ;
110114 }
0 commit comments