Running with gcc 11.1, pgo Intel I7, I get the following:
/tmp/swipl-devel/build.release/src/swipl "-f" "none" "--no-packs" "--on-error=status" "/tmp/swipl-devel/src/test.pl" "--no-core" "thread"
% SWI-Prolog test suite.
% To run all tests run ?- test.
%
Running scripts from thread (agc2.pl)[0.005sec].(agc3.pl)[0.006sec].(agc.pl)[0.071sec].(pooltest.pl)[0.002sec].(qpattern.pl)[0.003sec].(queue_create.pl)[0.062sec].(queue_gc.pl)........[0.011sec].(queue_max_size.pl)[0.023sec].(queue_race.pl)[0.101sec].(queue_resource.pl)[0.002sec].(queue_select.pl).[0.001sec].(queue_send.pl)[0.011sec].(queue_timeout.pl)....[0.124sec].(test_agc_callback.pl)[1.103sec].(test_agc_deadlock.pl)^C
so it looks like it’s hanging on test_agc_deadlock.pl
digging deeper:
$ src/swipl ../src/Tests/thread/test_agc_deadlock.pl
1 ?- test_agc_deadlock.
^CAction (h for help) ? C-stack trace labeled "INT":
[0] save_backtrace() at :? [0x7f8df5deb924]
[1] PL_interrupt() at ??:? [0x7f8df5d97952]
[2] dispatch_signal() at :? [0x7f8df5e36423]
[3] handleSignals___LD() at :? [0x7f8df5e12a69]
[4] pl_thread_join2_va() at pl-thread.c:? [0x7f8df5da8d74]
[5] PL_next_solution___LD() at :? [0x7f8df5df4efe]
[6] query_loop() at :? [0x7f8df5e309b8]
[7] prologToplevel() at :? [0x7f8df5e3084b]
[8] PL_toplevel() at ??:? [0x7f8df5e455eb]
[9] src/swipl(+0x10b1) [0x558a089340b1]
[10] __libc_start_main() at ??:? [0x7f8df5b8ab25]
[11] src/swipl(+0x10ee) [0x558a089340ee]
Action (h for help) ? goals
[14] thread_join(<thread>(5,0x558a0b1fd4a0), _61092)
[12] test_agc_deadlock:'__aux_maplist/2_join+0'([<thread>(5,0x558a0b1fd4a0), <thread>(6,0x558a0b292aa0), <thread>(7,0x558a0b292a50), <thread>(8,0x558a0b292960)])
Action (h for help) ?
I installed gcc10, and tried it:
1 ?- test_agc_deadlock.
^CAction (h for help) ? C-stack trace labeled "INT":
[0] save_backtrace() at :? [0x7effc674e2c9]
[1] PL_interrupt() at ??:? [0x7effc66f9cab]
[2] dispatch_signal() at :? [0x7effc679b2fb]
[3] handleSignals___LD() at :? [0x7effc6776b59]
[4] pl_thread_join2_va() at pl-thread.c:? [0x7effc670b161]
[5] PL_next_solution___LD() at :? [0x7effc6758682]
[6] query_loop() at :? [0x7effc67958ca]
[7] prologToplevel() at :? [0x7effc679575b]
[8] PL_toplevel() at ??:? [0x7effc67aa3db]
[9] src/swipl(+0x10b1) [0x55a701c770b1]
[10] __libc_start_main() at ??:? [0x7effc64ecb25]
[11] src/swipl(+0x10ee) [0x55a701c770ee]
Action (h for help) ? goals
[12] thread_join(receiver)
[11] test_agc_deadlock:test_agc_deadlock(4)
Action (h for help) ? goals
[12] thread_join(receiver)
[11] test_agc_deadlock:test_agc_deadlock(4)
Action (h for help) ? abort
% Execution Aborted
2 ?- current_prolog_flag(c_cc,V).
V = '/usr/sbin/gcc-10'.
Still hangs with gcc10, but backtrace is a little different.
Tried it again with gcc 11.1 (to see if I get the same backtrace):
1 ?- current_prolog_flag(c_cc,V).
V = '/usr/sbin/cc'. % this is gcc 11.1
2 ?- test_agc_deadlock.
^CAction (h for help) ? C-stack trace labeled "INT":
[0] save_backtrace() at :? [0x7f4fe0a2ea14]
[1] PL_interrupt() at ??:? [0x7f4fe09da952]
[2] dispatch_signal() at :? [0x7f4fe0a794b3]
[3] handleSignals___LD() at :? [0x7f4fe0a55b59]
[4] pl_thread_join2_va() at pl-thread.c:? [0x7f4fe09ebd77]
[5] PL_next_solution___LD() at :? [0x7f4fe0a37fee]
[6] query_loop() at :? [0x7f4fe0a73a48]
[7] prologToplevel() at :? [0x7f4fe0a738db]
[8] PL_toplevel() at ??:? [0x7f4fe0a8869b]
[9] src/swipl(+0x10b1) [0x55de9ce620b1]
[10] __libc_start_main() at ??:? [0x7f4fe07cdb25]
[11] src/swipl(+0x10ee) [0x55de9ce620ee]
Action (h for help) ? goals
[12] thread_join(receiver)
[11] test_agc_deadlock:test_agc_deadlock(4)
gcc11.1 backtrace now matches gcc10 backtrace (perhaps because I interrupted too early the first time). Still hangs.
Hope this helps a little.