[redland] Segfault w/ example.pl using repat parser
Dave Beckett
dave.beckett at bristol.ac.uk
Thu Nov 8 12:32:27 GMT 2001
>>>Chad House said:
> I get segfaults when attempting to run the example.pl test file
> included with redland 0.9.10. "make build-perl" works, and "make
> test-perl" passes all tests, however.
>
> Also, if I change the parser (example.pl line 49) from 'repat' to
> 'raptor', then example.pl runs fine.
<snip/>
>
> 'rpm -qf /usr/lib/libxmlparse.so.0' tells me the library belongs to the
> w3c-libwww package. I had version 5.2.8 installed (stock Red Hat 7.1),
> but upgrading to 5.3.2 fixed the problem.
This seems to be caused by there being two different versions of
expat available. The libwww one - /usr/lib/libxmlparse.so and
and a newer one /usr/lib/libexpat.*
The latter is suitable for use with Redland (or raptor actually),
since it has the XML_ParserCreateNS that libxmlparse lacks. However,
since Redland links with the libwww if it finds it, there are thus
two versions of the same library linked.
It seems, that in this case, -lexpat is linked after the libwww
libraries and hence the programs link with both libraries, getting
a mixture of functions from the libwww and XML_ParserCreateNS from
libexpat. Hence crashing. I'll try to arrange the link ordering to
add -lexpat first in future.
Your upgrade fixed it since w3c-libwww 5.3.2 probably has a newer
version of the expat lib included.
A solution may be to try:
make clean
rm -f config.cache
./configure --with-libwww=no
make check
cd perl
make test-perl
perl -Iblib/arch -Iblib/lib example.pl
I'm running RH7.2 and have 5.2.8-10 installed; above sequence works
for me with the released version of redland 0.9.10
Using expat as a shared library has been a nightmare that has hit
both the Perl and Apache developers since it is/was in both, with
different versions so when for example apache mod_perl uses both, you
get mysterious crashes like the above.
Cheers
Dave
More information about the redland-dev
mailing list