[libxml-devel] Test Errors and Seg fault (08-07-19)
Charlie Savage
cfis at savagexi.com
Sat Jul 19 14:55:55 EDT 2008
> 1) Failure:
> test_parse_error(TestParserContext) [./test/tc_parser_context.rb:111]:
> <true> expected but was
> <false>.
>
> 157 tests, 740 assertions, 1 failures, 0 errors
> /usr/lib/ruby/1.8/test/unit.rb:278: [BUG] Segmentation fault
> ruby 1.8.6 (2007-09-24) [x86_64-linux]
It looks like the segmentation fault is happening at the program's end.
Which leads me to suspects it the XPathObject pointer (Xpath object
are returned from Document#find and Node#find). That the one where a
document is freed before any XpathObjects are freed.
The simple solution is:
nodes = document.find('/foo')
nodes = nil
GC.start
Which is documented under Document#find.
A "real" solution would involve XPath objects registering themselves
with documents, and documents checking them when freed. The reason is
that Ruby calls free functions in random order. See discussion here:
http://blade.nagaokaut.ac.jp/cgi-bin/vframe.rb/ruby/ruby-core/17725?17500-17840+split-mode-vertical
Anyway, would be worth updating the xpath test to conform to the code
style above and see if those really are the issues.
The other thing to do, is create a debug build, enable crash dump files,
and when the seg fault happens send in the stack trace. That would
verify my theory or not.
Charlie
> _______________________________________________
> libxml-devel mailing list
> libxml-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/libxml-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://rubyforge.org/pipermail/libxml-devel/attachments/20080719/6f89e4a3/attachment-0001.bin>
More information about the libxml-devel
mailing list