[PPL-devel] [Yap-users] [Fwd: Re: Maximum number of foreign predicates?]

Enea Zaffanella zaffanella at cs.unipr.it
Tue Sep 30 02:04:40 CEST 2008


Vitor Santos Costa wrote:
> Hi Enea
> 
> 
>>> I just tried the patch on Yap-5.1.3
>>> (on a x86_64 machine, also using --enable-dynamic-loading),
>>> but it seems not working.
>>> I keep obtaining the same error message:
>>>
>>> /bin/sh ../../../libtool --mode=execute \
>>>               -dlopen ../../../src/libppl.la \
>>>               -dlopen ../../../Watchdog/src/libpwl.la \
>>>               -dlopen ppl_yap.la \
>>>               yap -l
>>> /home/zaffanella/cvs-stuff/ppl/interfaces/Prolog/YAP/yap_pl_check.pl \
>>>                       <script_pchk >obtained_pchk
>>> % Restoring file /usr/local//lib/Yap/startup
>>> YAP version Yap-5.1.3
>>> %
>>> %
>>> % YAP OOOPS: tried to access illegal address 0x20!!!!.
> 
> This is definitely a NULL pointer. I was sure I had checked all memory
> allocations :(. Is it possible to construct me a file that just loads
> the C functions? Otherwise, just tell me the steps to build ppl
> (again).
> 
> Thanks!
> 
> Vitor

I wasn't able to reproduce the problem in a smaller environment ...

To reproduce the problem, you should get the CVS head version of the PPL 
(see the web site) and do the following (for simplicity, I assume you 
build the PPL in the source tree):

# autoreconf
# ./configure --disable-optimization --enable-interfaces=yap_prolog 
--enable-instantiations=all
# make
# cd interfaces/Prolog; make check

[NOTE: the two makes will take a _long_ time (more than 30 minutes on my 
machine ... which is not a slow one ... beside other things, they will 
generate something like 8242 predicate stubs]

I have also tried running the offending command through gdb:

# cd interfaces/Prolog/YAP
#  ../../../libtool --mode=execute -dlopen ../../../src/libppl.la 
-dlopen ppl_yap.la gdb yap
GNU gdb Fedora (6.8-21.fc9)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu"...
(no debugging symbols found)
(gdb) set args -l yap_pl_check.pl
(gdb) run
Starting program: /usr/local/bin/yap -l yap_pl_check.pl
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
% Restoring file /usr/local//lib/Yap/startup
YAP version Yap-5.1.3

Program received signal SIGSEGV, Segmentation fault.
0x00000000006b5523 in Yap_InitCPred () from /usr/local//lib/libYap.so
Missing separate debuginfos, use: debuginfo-install gcc.x86_64 
glibc.x86_64 gmp.x86_64 ncurses.x86_64 readline.x86_64
(gdb) bt
#0  0x00000000006b5523 in Yap_InitCPred () from /usr/local//lib/libYap.so
#1  0x00007f6ac85b7d30 in init () at ppl_yap.cc:9186
#2  0x00000000006f6a59 in p_load_foreign () from /usr/local//lib/libYap.so
#3  0x00000000006242da in Yap_absmi () from /usr/local//lib/libYap.so
#4  0x000000000067f1dd in exec_absmi () from /usr/local//lib/libYap.so
#5  0x0000000000681b0c in do_goal () from /usr/local//lib/libYap.so
#6  0x00000000006f82d6 in YAP_RunGoalOnce () from /usr/local//lib/libYap.so
#7  0x0000000000401b55 in main ()
(gdb) f 1
#1  0x00007f6ac85b7d30 in init () at ppl_yap.cc:9186
9186	YAP_USER_C_PREDICATE(ppl_Uint16_Box_contains_integer_point, 1);
Current language:  auto; currently c++
(gdb) quit

The segmentation fault is obtained when trying to init the C predicate 
ppl_Uint16_Box_contains_integer_point/1, which is 840th in the list of 
more than 8000 that should be initialized.

Hoping this helps ...

Cheers,
Enea Zaffanella.



More information about the PPL-devel mailing list