[PPL-devel] First part of the problem: GMP

Roberto Bagnara bagnara at cs.unipr.it
Tue Jun 18 18:38:11 CEST 2002


Hi there,

since we have decided that PPL 0.4 must be shipped with a reasonably
complete YAP interface, we have investigated a bit more the problems
we are experiencing.  These can be split in two: the first one has to
do with the fact that PPL uses GMP and YAP also uses, by default, GMP.
That results in a segmentation fault at the very first memory allocation
of a GMP object that the PPL performs.  But let us proceed with order.
The machines we use are Athlon machines running RedHat GNU/Linux 7.2
and 7.3 with all the updates applied.  We use GCC 3.0.4.

$ uname -a
Linux xyzzy 2.4.18 #2 Thu Feb 28 07:12:54 CET 2002 i686 unknown
$ gcc -v
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.4/specs
Configured with: ../gcc-3.0.4/configure --prefix=/usr/local
Thread model: single
gcc version 3.0.4
$

We use a CVS version of yap that is up-to-date at the time of writing.
This has been configured with

    --enable-debug-yap --prefix=/usr/local

With this configuration we cannot even load the PPL-YAP interface
due to a segmentation fault in AllocBigNumSpace (size=4) at C/bignum.c:96.
The complete log of a gdb session is below the signature (I am sure
Vitor will immediately see where the problem is).

To expose the other problems we have (I will do that in a following
message) we must therefore add --disable-gmp to the configuration
options of YAP.
Will be back later

       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

$ gdb yap
GNU gdb Red Hat Linux (5.1-1)
Copyright 2001 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"...
(gdb) r
Starting program: /usr/local/bin/yap
[ Restoring file startup ]
[ YAP version Yap-4.3.23 ]
    ?- load_foreign_files(['ppl_yap'],[],init).

Program received signal SIGSEGV, Segmentation fault.
AllocBigNumSpace (size=4) at C/bignum.c:96
96 
   alloc_ptr[0] = size;
(gdb) info stack
#0  AllocBigNumSpace (size=4) at C/bignum.c:96
#1  0x400272a4 in __gmpz_init (x=0x80e1198) at ../../gmp-4.0.1/mpz/init.c:29
#2  0x4020b7cb in Parma_Polyhedra_Library::Init::Init() (this=0x4000cba0)
     at ../../../../ppl/ppl/src/Init.inlines.hh:36
#3  0x40203f11 in __static_initialization_and_destruction_0(int, int) (
     __initialize_p=1, __priority=65535)
     at ../../../../ppl/ppl/src/initializer.hh:29
#4  0x40204845 in _GLOBAL__I__Z23Prolog_atom_from_stringPKc ()
     at /usr/local/include/g++-v3/bits/locale_facets.h:97
#5  0x402048e7 in __do_global_ctors_aux ()
     at /usr/local/include/g++-v3/bits/locale_facets.h:97
#6  0x401f05c6 in _init ()
    from /home/roberto/dtppl/interfaces/Prolog/YAP/.libs/ppl_yap.so
#7  0x4000d111 in _dl_init (main_map=0x80e1198, argc=1, argv=0xbffff904,
     env=0xbffff90c) at dl-init.c:70
#8  0x401ad3e1 in dl_open_worker (a=0xbffff4f0) at dl-open.c:361
#9  0x4000ce55 in _dl_catch_error (objname=0xbffff4e8, errstring=0xbffff4ec,
     operate=0x401ad14c <dl_open_worker>, args=0xbffff4f0) at dl-error.c:152
#10 0x401ad756 in _dl_open (
     file=0x80dd7e0 "/home/roberto/dtppl/interfaces/Prolog/YAP/.libs/ppl_yap.so", mode=-2147483391, caller=0x809f01a) at dl-open.c:407
#11 0x40080363 in dlopen_doit (a=0xbffff650) at dlopen.c:39
#12 0x4000ce55 in _dl_catch_error (objname=0x400820e4, errstring=0x400820e8,
---Type <return> to continue, or q <return> to quit---
     operate=0x40080338 <dlopen_doit>, args=0xbffff650) at dl-error.c:152
#13 0x400806b6 in _dlerror_run (operate=0x40080338 <dlopen_doit>,
     args=0xbffff650) at dlerror.c:130
#14 0x40080323 in __dlopen_check (
     file=0x80dd7e0 "/home/roberto/dtppl/interfaces/Prolog/YAP/.libs/ppl_yap.so", mode=257) at dlopen.c:53
#15 0x0809f01a in LoadForeign (ofiles=0x90cbba8, libs=0x0,
     proc_name=0x90cba3c "init", init_proc=0xbffff6b8) at C/load_dl.c:60
#16 0x0809edff in p_load_foreign () at C/load_foreign.c:86
#17 0x080a932a in absmi (inp=0) at C/absmi.c:5659
#18 0x0806d988 in exec_absmi (top=1) at C/exec.c:881
#19 0x0806db82 in do_goal (CodeAdr=0x901a460 "ðV\n\bôÿÿÿØ£\001\t", arity=0,
     pt=0x0, args_to_save=0, top=1) at C/exec.c:934
#20 0x0806e1b4 in RunTopGoal (t=214482) at C/exec.c:1118
#21 0x08050f07 in YapRunGoal (t=214482) at C/c_interface.c:698
#22 0x0804f581 in do_top_goal (Goal=214482) at console/yap.c:122
#23 0x0804fd21 in exec_top_level (BootMode=1, filename=0x0)
     at console/yap.c:460
#24 0x0804fd9f in main (argc=1, argv=0xbffff904) at console/yap.c:486
#25 0x400b6316 in __libc_start_main (main=0x804fd50 <main>, argc=1,
     ubp_av=0xbffff904, init=0x804e974 <_init>, fini=0x80c8690 <_fini>,
     rtld_fini=0x4000d2fc <_dl_fini>, stack_end=0xbffff8fc)
     at ../sysdeps/generic/libc-start.c:129
(gdb) frame 0
#0  AllocBigNumSpace (size=4) at C/bignum.c:96
96 
   alloc_ptr[0] = size;
(gdb) print alloc_ptr
$1 = (CELL *) 0x0
(gdb)

The following output may also be of interest:

$ ldd /usr/local/bin/yap
	libgmp.so.3 => /usr/local/lib/libgmp.so.3 (0x40017000)
	libm.so.6 => /lib/libm.so.6 (0x4005d000)
	libdl.so.2 => /lib/libdl.so.2 (0x4007f000)
	libnsl.so.1 => /lib/libnsl.so.1 (0x40083000)
	libc.so.6 => /lib/libc.so.6 (0x4009a000)
	libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1 (0x401d1000)
	/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
$ ldd ppl_yap.so
	libppl.so.0 => /home/roberto/dtppl/src/.libs/libppl.so.0 (0x4004f000)
	libgmp.so.3 => /usr/local/lib/libgmp.so.3 (0x400ed000)
	libgmpxx.so.3 => /usr/local/lib/libgmpxx.so.3 (0x40126000)
	libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1 (0x40132000)
	libc.so.6 => /lib/libc.so.6 (0x40148000)
	libstdc++.so.3 => /usr/local/lib/libstdc++.so.3 (0x4027e000)
	libm.so.6 => /lib/libm.so.6 (0x40315000)
	/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)





More information about the PPL-devel mailing list