[libxml-devel] [ libxml-Bugs-8337 ] Opening many files causes segfault on fbsd-amd64
Charlie Savage
cfis at savagexi.com
Thu Jul 10 03:13:18 EDT 2008
Hi Masashi,
>> require 'xml/libxml'
>>
>> (1..10000).each{|time|
>> XML::Document.file('test.xml')
>> p time if time % 100 == 0
>> }
>
> It won't segfault anymore, but now I get the following error:
>
> Too many open filesI/O warning : failed to load external entity "test.xml"
> libxml-test.rb:7:in `file': test.xml (IOError)
> from libxml-test.rb:7
> from libxml-test.rb:6:in `each'
> from libxml-test.rb:6
>
> However, the error disappears if "GC.start" is inserted just above
> XML::Document.file(...).
Right. This is another Ruby GC issue. If you don't call GC.start, then
all the documents that you have created remain open. I assume this
causes the OS to eventually run out of file handles, thus resulting in
the error (which is being raised by libxml not Ruby).
By calling GC.start, the documents are freed and the file handles are
released.
So I don't see this as a bug in the libxml bindings.
Charlie
-------------- 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/20080710/813552d5/attachment.bin>
More information about the libxml-devel
mailing list