logo       

Re: Not sure what's going on here...: msg#01618

Subject: Re: Not sure what's going on here...
On Wednesday 28 December 2005 02:24, Simon Beaumont wrote:
> 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.

It would help to see the source of one of these predicates.  A common
mistake though is that in the CUT case, the Prolog argument terms are
bogus.  Only the context argument carries valid information.

        --- Jan




<Prev in Thread] Current Thread [Next in Thread>