This is SWIPL 5.5.40 compiled with GCC 3.3 on both linux and OSX.
I have a c foreign ND predicate that follows the pattern in the
documentation.
All works fine except when I CUT (rather than backtrack) and return
with PL_succeed from the predicate. After printing the result the
toplevel reports:
Yes
ERROR: '$toplevel'/0: Caught signal 11 (segv)
This turns out to be in the following.
(gdb) where
#0 0x0012d4ac in compile_term_to_heap ()
#1 0x00130f18 in undo_while_saving_term ()
#2 0x000d46a0 in PL_next_solution ()
#3 0x0011b4a0 in prologToplevel ()
#4 0x000e047c in PL_toplevel ()
#5 0x00001d70 in main ()
#6 0x00001808 in _start (argc=0, argv=0x1742f4, envp=0x10) at
/SourceCache/Csu/Csu-47/crt.c:267
#7 0x8fe1a278 in __dyld__dyld_start ()
All other exits from the predicate are fine (backtracking fully or
failing).
All my other ND predicates exhibit this exact behaviour but all of the
deterministic ones are fine.
Sound familiar? What I am I missing here?
Simon Beaumont
|