I recall having had this problem at one point, but can’t find the note to myself on how I fixed it (I seem to recall retracting a PCE-reated predicate). I can reproduce a problem with WSL under Microsoft Windows, but can’t reproduce it under Linux. Have you tried unset DISPLAY
or swipl --no-pce
?
Here’s what I see with WSL (Ubuntu 18.0.4 Linux 4.4.0-18362-Microsoft #476-Microsoft Fri Nov 01 16:53:00 PST 2019 x86_64 x86_64 x86_64 GNU/Linux
):
$ (unset DISPLAY; swipl)
Welcome to SWI-Prolog (threaded, 64 bits, version 8.1.22)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.
For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).
?- profile(append([a,b,c], [x], Z)).
ERROR: error in system call (Invalid argument)
ERROR: In:
ERROR: [14] '$profile'(user:append(...,...,...),cputime)
ERROR: [13] setup_call_catcher_cleanup(system:true,prolog_statistics:'$profile'(...,cputime),_4360,prolog_statistics:show_profile([])) at /usr/lib/swi-prolog/boot/init.pl:564
ERROR: [11] prolog_statistics:profile(user:append(...,...,...),[]) at /usr/lib/swi-prolog/library/statistics.pl:370
ERROR: [9] <user>
ERROR:
ERROR: Note: some frames are missing due to last-call optimization.
ERROR: Re-run your program in debug mode (:- debug.) to get more detail.
Call: (15) prolog_statistics:show_profile([]) ? abort
% Execution Aborted
$ (unset DISPLAY; swipl)
Welcome to SWI-Prolog (threaded, 64 bits, version 8.1.22)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.
For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).
?- debug.
true.
[debug] ?- profile(append([a,b,c], [x], Z)).
ERROR: error in system call (Invalid argument)
ERROR: In:
ERROR: [14] '$profile'(user:append(...,...,...),cputime)
ERROR: [13] setup_call_catcher_cleanup(system:true,prolog_statistics:'$profile'(...,cputime),_4494,prolog_statistics:show_profile([])) at /usr/lib/swi-prolog/boot/init.pl:564
ERROR: [12] call_cleanup(prolog_statistics:'$profile'(...,cputime),prolog_statistics:show_profile([])) at /usr/lib/swi-prolog/boot/init.pl:572
ERROR: [11] prolog_statistics:profile(user:append(...,...,...),[]) at /usr/lib/swi-prolog/library/statistics.pl:370
ERROR: [10] prolog_statistics:profile(user:append(...,...,...)) at /usr/lib/swi-prolog/library/statistics.pl:364
ERROR: [9] <user>
Call: (15) prolog_statistics:show_profile([]) ? abort
% Execution Aborted