|Problems? Is your data what you think it is?|
Re: Segmentation fault in DBI + XML::LibXMLby furagu (Initiate)
|on Feb 05, 2012 at 17:39 UTC||Need Help??|
Finally I got the solution.
Following advice from mje I ran the script in debugger and got this trace:
Seems like the problem is related to a thread support (this is also stated in the article posted by perl514).
Postgresql-client library has a thread safety turned on by default, so it took me some time to get it built without thread safety support, and that worked.
I don't think this is a really good solution though because thread safety can be usefull, and the best way would be to fix the libxml. But my scripts do not use threads, so I'm safe :)
Here are some short instructions how to rebuild postgresql-client without thread safety for those who's having the same problem.
First, configure postgresql-client port to get config.log file created:cd /usr/ports/databases/postgresql84-client/; make configure
Second, extract configure options set by ports system:cd work/postgresql-8.4.10/; grep ./configure config.log
There'll be something like this:./configure --with-libraries=/usr/local/lib --with-includes=/usr/local/include --enable-thread-safety --with-openssl --with-libxml --enable-integer-datetimes --enable-nls --without-gssapi --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/ --build=amd64-portbld-freebsd8.2
Remove '--enable-thread-safety' from configure command line and run it in the current dir.
After the library is configured, build and reinstall it the usual way:cd ../../; make FORCE_PKG_REGISTER=1 reinstall clean
That's all, now the postgresql-client has no thread safety.
Thanks to perl514, mje and Anonymous Monk for suggestions!