if PL_exception(swipl_qid):
import ctypes as ct
bttext = PL_backtrace_string(20, 0) # Tried 0, 1, 2, 3 --
if bttext is not None:
print(f"{msg}\n{ct.cast(bttext, ct.c_char_p).value.decode('utf8')}")
PL_free(bttext)
This is a bug with swi-prolog.
The intellij environment fatally interferes with the prolog input prompt causing a segfault.
Choose "Emulate terminal" in the run configuration to avoid it.
Assert
and querying:
I was hoping to be able to see a backtrace. However, I just see:
(the exception message confirms it failed at 'test_backtrace2(X) :- missing(X)...')
Here's what I did to get that:
and in QueryWrapper:
Any idea how to receive the full backtrace?