|
From: | Daniel Diaz |
Subject: | Re: Interfacing with libexpat |
Date: | Fri, 18 Nov 2011 11:18:25 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 |
Hi Thierry I could reproduce the bug (under x86_64/ubuntu with libexpat 2.0.1-7ubuntu3). It seems this lib clobbers registers r12 and r13 which are normally callee-saved registers (and used by gprolog). As you noticed it is possible to recompile libexpat without optimizations options (-O instead of -O2 or try with clang or llvm-gcc). Another workaround consists in compiling gprolog without registers. Configure gprolog with ./configure --disable-regs. This could be OK from version 1.4.1 (soon released). Daniel Le 26/10/2011 23:38, Thierry Martinez a écrit : Hi, Writing a foreign language interface for libexpat, I noticed that calls to Prolog from parser callbacks segfault on GNU/Linux (with GNU Prolog 1.4.0 and 1.3.1) but succeed on Mac OS X. A short example is available at http://contraintes.inria.fr/~tmartine/tmp/expat_error.tar.gz "make" builds an executable expat_error which prints "here" once then segfaults on GNU/Linux and which prints "here" twice (which is correct) then terminates correctly on Mac OS X. The first "here" is a witness for calls to Prolog outside parser callbacks. The second "here" should be printed by the callback. Thanks, -- Ce message a été vérifié par MailScanner pour des virus ou des polluriels et rien de suspect n'a été trouvé. |
[Prev in Thread] | Current Thread | [Next in Thread] |