Hi Tom,

Thanks for posting the patch.

Tom Bagby wrote:
I just sent this with an attachment, which I've now removed because I think the 
list doesn't like me doing that:

Actually, this seg fault occurs during normal running, not just when Ruby is 
exiting.  We had a ton of crashing due to this.  The order in which things are 
marked has nothing to do with the order in which things are freed, do enough 
work with different documents over many requests and we always eventually hit a 
segfault.  I added some ref counting and we've been running for a while now 
with zero segfaults.  I made a patch of what I did, the downside of which is 
that I disabled all the xpointer stuff which we don't use and I didn't have 
time/was unmotivated to fix.  If you don't use xpointer this patch should solve 
your problems:

http://www.acidlunchbox.com/bagby/ref_count.diff

A quick review - that looks about right to me. Although why did you remove the setting of the @doc and @context and then put back the mark functions. Seems to me either way works fine - or am I missing something?

As for the ref counting solution - I always leaned towards having doc and xpath objects have pointers to each other because I didn't think ref counting would work. However, I can't remember why I thought that off the top of my head and the logic looks ok to me.

Anyway, I'd be happy to apply the patch but I'd like to get the mark functions straight first and of course the XPointer stuff.

Charlie

--
Charlie Savage
http://cfis.savagexi.com

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel

Reply via email to