Hello everyone.
I’m on the latest development version of SWI-Prolog on multiple platforms (Windows 11, WSL running Ubuntu 22.04 and on Fedora 38).
SWI-Prolog crashes on all three platforms when I reload a file with make/0, after I’ve uncommented some code lines in it, but only after I first make a query.
On Linux I get the following output:
[debug] ?- make.
Loading experiment file module data(poker_examples/palindrome_weak_setting.pl) from palindrome.
ERROR: Received fatal signal 11 (segv)
Time: Wed Feb 19 22:53:54 2025
Inferences: 10521727
Thread: 1 (main)
C-stack trace labeled "crash":
[0] save_backtrace() at /home/mememe/swipl-devel/src/os/pl-cstack.c:337 [0x7f233f3bc818]
[1] sigCrashHandler() at /home/mememe/swipl-devel/src/os/pl-cstack.c:937 [0x7f233f35a1c4]
[2] __restore_rt() at ??:? [0x7f233f0fbbb0]
[3] _ZN8tcmalloc11ThreadCache21ReleaseToCentralCacheEPNS0_8FreeListEji() at ??:? [0x7f233f44f280]
[4] _ZN8tcmalloc11ThreadCache8ScavengeEv() at ??:? [0x7f233f45059f]
[5] freeHeap() at /home/mememe/swipl-devel/src/pl-alloc.c:215 [0x7f233f3b1db4]
[6] cleanDefinition() at /home/mememe/swipl-devel/src/pl-proc.c:1882 [0x7f233f3a3554]
[7] endReconsult___LD() at /home/mememe/swipl-devel/src/pl-srcfile.c:1637 [0x7f233f31a194]
[8] pl_fixup_reconsult1_va() at /home/mememe/swipl-devel/src/pl-srcfile.c:1779 [0x7f233f3a96a4]
[9] PL_next_solution___LD() at /home/mememe/swipl-devel/src/pl-vmi.c:4344 [0x7f233f3650af]
[10] callProlog() at /home/mememe/swipl-devel/src/pl-pro.c:530 [0x7f233f37bf6d]
[11] pl_sig_atomic1_va() at /home/mememe/swipl-devel/src/pl-pro.c:422 [0x7f233f37c005]
[12] PL_next_solution___LD() at /home/mememe/swipl-devel/src/pl-vmi.c:4344 [0x7f233f3650af]
[13] query_loop() at /home/mememe/swipl-devel/src/pl-pro.c:171 [0x7f233f3a1493]
[14] prologToplevel() at /home/mememe/swipl-devel/src/pl-pro.c:656 [0x7f233f3a132d]
[15] PL_toplevel() at /home/mememe/swipl-devel/src/pl-fli.c:4999 [0x7f233f3b55aa]
[16] swipl(+0x10b0) [0x4010b0]
[17] __libc_start_call_main() at ??:? [0x7f233f0e5b8a]
[18] __libc_start_main_alias_2() at :? [0x7f233f0e5c4b]
[19] swipl(+0x10e5) [0x4010e5]
PROLOG STACK (without arguments):
[38] system:$fixup_reconsult/1 <foreign>
[37] system:$load_file/4 [PC=92 in clause 1]
[36] setup_call_cleanup/3 [PC=5 in clause 1]
[34] system:$consult_file/5 [PC=22 in clause 2]
[33] system:$do_load_file_2/5 [PC=221 in clause 1]
[30] system:$qdo_load_file/4 [PC=10 in clause 1]
[28] setup_call_cleanup/3 [PC=5 in clause 1]
[27] system:$c_call_prolog/0 [PC=0 in top query clause]
[26] system:sig_atomic/1 <foreign>
[23] system:$load_file/3 [PC=12 in clause 1]
PROLOG STACK (with arguments; may crash if data is corrupted):
Segmentation fault (core dumped)
Note that this happens with other files, not just the one listed above at the start, right after make
is called.
I made a new branch on my repo with everything setup so as to reproduce the error with minimal fuss. I also opened an issue with instructions to help reproduce it. See here for the issue:
This is a link to the project:
https://github.com/stassa/vanilla/
The branch for the reproduction is poker_segv
.