Locally installed SWISH crashes on this command

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.

Tabling is under heavy development at the moment and I messed up the memory management for the trie data structures in that release. Is already fixed and test cases have been added. Not that this also works on the sandboxed version if you write this as

crash_swish(S) :-
    gather_all(between(1,1500,S), _).