Description
Hard to give a MWE, but a binary compiled by PackageCompiler.jl
in Julia 1.9.4 seems to hang forever whenever the abort
function is triggered in Windows. The issue is raised here because, according to the following two example outputs, it seems more likely to be a bug in Julia itself instead of PackageCompiler
:
Cannot protect page @0000000000000000 of size 1048576 to 0x4 (err 0x1e7)
[12024] signal (22): SIGABRT
in expression starting at none:1
crt_sig_handler at C:/workdir/src\signals-win.c:95
raise at C:\Windows\System32\msvcrt.dll (unknown line)
abort at C:\Windows\System32\msvcrt.dll (unknown line)
protect_page at C:/workdir/src\cgmemmgr.cpp:78 [inlined]
get_wr_ptr at C:/workdir/src\cgmemmgr.cpp:613 [inlined]
alloc at C:/workdir/src\cgmemmgr.cpp:589 [inlined]
allocateCodeSection at C:/workdir/src\cgmemmgr.cpp:870
Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: UNKNOWN at 0x7ff963673b19 --
[20632] signal (22): SIGABRT
in expression starting at none:1
crt_sig_handler at C:/workdir/src\signals-win.c:95
raise at C:\Windows\System32\msvcrt.dll (unknown line)
abort at C:\Windows\System32\msvcrt.dll (unknown line)
realloc_s at C:/workdir/src/support\dtypes.h:359 [inlined]
realloc_s at C:/workdir/src/support\dtypes.h:351 [inlined]
gc_mark_stack_resize at C:/workdir/src\gc.c:1934
gc_mark_stack_push at C:/workdir/src\gc.c:1953 [inlined]
gc_mark_loop at C:/workdir/src\gc.c:2821
_jl_gc_collect at C:/workdir/src\gc.c:3407
ijl_gc_collect at C:/workdir/src\gc.c:3713
maybe_collect at C:/workdir/src\gc.c:1083 [inlined]
jl_gc_pool_alloc_inner at C:/workdir/src\gc.c:1450 [inlined]
jl_gc_pool_alloc_noinline at C:/workdir/src\gc.c:1511 [inlined]
jl_gc_alloc_ at C:/workdir/src\julia_internal.h:460 [inlined]
jl_gc_alloc at C:/workdir/src\gc.c:3760
_new_array_ at C:/workdir/src\array.c:134
_new_array at C:/workdir/src\array.c:198 [inlined]
ijl_alloc_array_1d at C:/workdir/src\array.c:436
Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: UNKNOWN at 0x7ff963673b19 --
Then the process hangs forever.
I've checked the 1.9.4 tag of Julia, It seems the crt_sig_handler
in signals-win.c
is triggered:
Lines 88 to 99 in 8e5136f
Then, in
jl_critical_error
, it runsLines 437 to 481 in 8e5136f
It is then a little bit unclear, but I suppose the following traces to be printed by
jl_print_bt_entry_codeloc
instead of rec_backtrace_ctx
.It is unclear to me why the output of
jl_gc_debug_print_status
is not present. It seems that something like "Allocations: xxx (Pool: xxx; Big: xxx); GC: xxx" should be print, but it is not.
Anyway, then there comes the last output, which is identical in the two cases:
Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: UNKNOWN at 0x7ff963673b19 --
This should be related to the jl_exception_handler
in signals-win.c
. First of all, this function is registered as the unhandled exception filter in jl_install_default_signal_handlers
, and since it's to be used for unhandled exceptions, I don't quite understand why it is called here. Anyway, the code is like the following:
Lines 284 to 338 in 8e5136f
The content of " at 0x%Ix -- " is printed, and I suppose that
jl_critical_error
is not called, since it should output "in expression starting at" when called, which is absent in the output. Then the problem may be related to jl_print_native_codeloc
? The function is like the following:Lines 630 to 651 in 8e5136f
Will the
free
be the problem? But it is only stated that heap routines should not be called in signal-handler routines in the doc, which should be unrelated to this issue?