[PPL-devel] Throwing Prolog exceptions from C code

Roberto Bagnara bagnara at cs.unipr.it
Fri Jun 14 23:46:35 CEST 2002


Hi there,

I don't know if I am doing something stupid but,
in order to throw a Prolog exception with term t
from C code, I create the Term `throw(t)' and then
I pass it to YapCallProlog().
Everything fails horribly and I have no idea why.
I append a stack trace hoping it may be enlightening
for someone.
All the best

      Roberto

-- 
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara at cs.unipr.it


Program received signal SIGSEGV, Segmentation fault.
do_goal (CodeAdr=0x81a5ac0 "", arity=1869768820, pt=0x81afe44, args_to_save=0,
     top=0) at C/exec.c:908
908 
       XREGS[i+1] = *pt++;
(gdb) info stack
#0  do_goal (CodeAdr=0x81a5ac0 "", arity=1869768820, pt=0x81afe44,
     args_to_save=0, top=0) at C/exec.c:908
#1  0x0806ce69 in execute_goal (t=135986753, nargs=0, mod=1) at C/exec.c:996
#2  0x0805025b in YapCallProlog (t=135986753) at C/c_interface.c:587
#3  0x400b631e in Prolog_raise_exception(unsigned long) (t=135986733)
     at /home/roberto/ppl/ppl/interfaces/Prolog/YAP/ppl_yap.cc:188
#4  0x400a6b0c in handle_exception(not_a_polyhedron_kind const&) (
     e=@0x100e6b40)
     at /home/roberto/ppl/ppl/interfaces/Prolog/ppl_prolog.icc:139
#5  0x400a9303 in ppl_new_Polyhedron_from_dimension (t_tp=1686330, t_nd=54,
     t_ph=135986672)
     at /home/roberto/ppl/ppl/interfaces/Prolog/ppl_prolog.icc:681




More information about the PPL-devel mailing list