This is a cryptographically signed message in MIME format.

--------------ms060309020604050007020702
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi everyone,

I've been updating the libxml-ruby bindings and have run into a problem 
that causes a segmentation fault at exit.  The problem is that mark 
functions do not appear to be called when a Ruby process exits (at least 
not on 1.8.4).

This is the Ruby test code I'm using, where the Ruby objects all wrap 
underlying C structures:

   document = XML::Document.new('1.0')
   document .root = XML::Node.new("header")

   4000.times do
     document .root << XML::Node.new("footer")
   end

   nodes = document .find('/header/footer')


document.find returns a list of nodes that are owned by the document.

When the process terminates, Ruby sometimes frees the document object 
before the nodes object, thereby causing a segmentation fault.

Before anyone asks, the nodes class has a mark function that tells Ruby 
that it is dependent on the document.  The mark function works fine, and 
if the following two lines of code are added to the end of the test code 
all is well:

   nodes = nil
   GC.start

So - is my observation correct that mark functions are not run at exit? 
  If it is true, then isn't that a big problem since there is no way to 
avoid situation like the one described above?  If it is not correct, 
then is there some trick to get the mark functions to run at exit 
outside of a manual GC.start call?

Thanks,

Charlie






--------------ms060309020604050007020702
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIJAzCC
AtwwggJFoAMCAQICEApLTm3bM9PFZxFEfV6XkZAwDQYJKoZIhvcNAQEFBQAwYjELMAkGA1UE
BhMCWkExJTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMT
I1RoYXd0ZSBQZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDTA4MDUxNDIyMDQwM1oX
DTA5MDUxNDIyMDQwM1owQzEfMB0GA1UEAxMWVGhhd3RlIEZyZWVtYWlsIE1lbWJlcjEgMB4G
CSqGSIb3DQEJARYRY2Zpc0BzYXZh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