ppl/sicstus/segmentation violation

ppl_delete_Polyhedron/1 cause "segmentation violation" when using ppl_sicstus. For example, the following query results in segmentation violation:
?- ppl_initialize, A='$VAR'(0), B='$VAR'(1),ppl_new_NNC_Polyhedron_from_constraints([A>B,B>=A],X),ppl_delete_Polyhedron(X).
I am running SICStus "3.10.0 (x86-Linux-glibc2.2)" with ppl-0.8. Note that it works fine in other Prolog, e.g., Ciao. any idea what could be the problem ?
Thanks.

Samir Genaim wrote:
ppl_delete_Polyhedron/1 cause "segmentation violation" when using ppl_sicstus. For example, the following query results in segmentation violation:
?- ppl_initialize, A='$VAR'(0), B='$VAR'(1),ppl_new_NNC_Polyhedron_from_constraints([A>B,B>=A],X),ppl_delete_Polyhedron(X).
I am running SICStus "3.10.0 (x86-Linux-glibc2.2)" with ppl-0.8. Note that it works fine in other Prolog, e.g., Ciao. any idea what could be the problem ?
Dear Samir,
I cannot reproduce your problem here:
$ ppl_sicstus SICStus 3.12.3 (x86-linux-glibc2.3): Thu Oct 27 17:45:37 CEST 2005 Licensed to math.unipr.it | ?- load_foreign_resource(ppl_sicstus). % loading foreign resource /home/roberto/ppl_sicstus.so in module user yes | ?- ppl_initialize, A='$VAR'(0),B='$VAR'(1),ppl_new_NNC_Polyhedron_from_constraints([A>B,B>=A],X),ppl_delete_Polyhedron(X). A = A, B = B, X = 302544120 ? yes | ?- $
Pat, can you reproduce it?
Samir, can you give us more context? On which platform is this happening? Which version of GCC was used to compile the PPL? (You can use the command `ppl-config -E' to answer this question.) What happens if you run ppl_sicstus from withing gdb? You can do something like:
$ gdb /usr/local/bin/ppl_sicstus GNU gdb Red Hat Linux (6.3.0.0-1.84rh) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run Starting program: /usr/local/bin/ppl_sicstus Reading symbols from shared object read from target memory...done. Loaded system supplied DSO at 0x497000 [Thread debugging using libthread_db enabled] [New Thread -1209006400 (LWP 29360)] SICStus 3.12.3 (x86-linux-glibc2.3): Thu Oct 27 17:45:37 CEST 2005 Licensed to math.unipr.it | ?-
Then do things as usual. When the program dies with a segmentaion fault, issue the `info stack' command to gdb and mail the result to this list. Cheers,
Roberto

Samir Genaim wrote:
$ ppl_sicstus
I was running sicstus and not ppl_sicstus, now it works, Thanks !.
Dear Samir,
the problem is that it is supposed to work also with sicstus. The difference is that dynamic loading will be used:
$ sicstus SICStus 3.12.3 (x86-linux-glibc2.3): Thu Oct 27 17:45:37 CEST 2005 Licensed to math.unipr.it | ?- load_foreign_resource('/usr/local/lib/ppl/ppl_sicstus'). % loading foreign resource /usr/local/lib/ppl/ppl_sicstus.so in module user yes | ?- ppl_initialize, A='$VAR'(0),B='$VAR'(1),ppl_new_NNC_Polyhedron_from_constraints([A>B,B>=A],X),ppl_delete_Polyhedron(X).
A = A, B = B, X = 271413168 ? yes | ?- $
If you confirm that dynamic loading is not working for you, then take into account that we are willing to investigate the problem: it may actually be a bug in the PPL! On the other hand, if you prefer not to spend time on ascertaining what is happening, we will understand. All the best,
Roberto

If you confirm that dynamic loading is not working for you, then take into account that we are willing to investigate the problem:
Dynamic loading is not working for me. The output of 'ppl-config -E' and 'gdb' are enclosed below, please let me know if you need any further debugging information.
participants (2)
-
Roberto Bagnara
-
Samir Genaim