I’m using: SWI-Prolog (threaded, 64 bits, version 8.1.2) MacOS with locally installed SWISH.
A minimal example that kills my locally running SWISH and the whole prolog session that called it:
:- table gather_all/2.
gather_all(Goal, ALL) :-
term_variables(Goal, L),
bagof(L, Goal, ALL).
crash_swish(S) :-
Goal = between(1,1500,S),
gather_all(Goal, _).
?- crash_swish(S).
% Works once without a problem, crashes with "Illegal instruction: 4" on a second run
The problem disappears if I don’t table gather_all or if I replace 1500 with a smaller number.
Cannot reproduce on a communal SWISH because of sandbox restrictions.
Thought it may help to make SWISH/SWI-Prolog more resilient and/or improve error messaging.