[libxml-devel] Segfault while validating multiple XML files against the same schema

2008-02-05 Thread Saurabh Nanda
Hi, I'm trying to write a RESTful web service in Rails. Before processing each POST request, I want to validate the XML against an XSD schema. It does not make sense to re-read the schema each time a request is processed. Therefore, I tried loading the schema once in a global variable ($schema) at

[libxml-devel] Guaranteed non-crashing way to load an XML document?

2008-02-05 Thread Saurabh Nanda
I have a long running RESTful web service that needs to read XML documents from HTTP content bodies. I've noticed lots of instances where it has randomly crashed due to an error in libxml. I came across the following post while digging for some clues: http://rubyforge.org/pipermail/libxml-devel/2

Re: [libxml-devel] Guaranteed non-crashing way to load an XML document?

2008-02-05 Thread Saurabh Nanda
> Do you have crashes that can break out of a begin block? What does that > content > look like? I didn't quite understand your question. The code snippet in the original posting is not placed inside a begin-rescue block. The incoming XML can also be an illegal XML (something which doesn't parse)

Re: [libxml-devel] Guaranteed non-crashing way to load an XML document?

2008-02-05 Thread Saurabh Nanda
> Well, we might have different opinions on what libxml should do with bad input > (I agree that segfaulting isn't very nice). That said, I can't imagine parsing > bytes in the wild as "xml" and not doing a lot of error handling. Will putting the code snippet in a begin-rescue block help? I'll do

Re: [libxml-devel] Guaranteed non-crashing way to load an XML document?

2008-02-06 Thread Saurabh Nanda
No inputs from anyone on this? Any help would be appreciated. Saurabh. -- http://nandz.blogspot.com http://foodieforlife.blogspot.com ___ libxml-devel mailing list libxml-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/libxml-devel

[libxml-devel] Code snippet to crash libxml (segfault)

2008-02-06 Thread Saurabh Nanda
Why does the following code always cause a segfault on the last statement, when simply trying to refer to 'doc'? The answer to this could probably give me some pointers to my previous queries. require 'xml/libxml' x=XML::Parser.string("something") doc=x.parse x.parse puts '-- about to print refer

Re: [libxml-devel] Code snippet to crash libxml (segfault)

2008-02-07 Thread Saurabh Nanda
> Are you sure it is the doc reference and not the GC finalizers > running? Put a print statement after it and see what happens. Probably what you're saying is right. I don't fully understand what effect the GC finalizers have, but I've tried the following script (same script without the doc refer

Re: [libxml-devel] Code snippet to crash libxml (segfault)

2008-02-07 Thread Saurabh Nanda
> C sure is lovely, isn't it. I will try to reproduce this. If you would > not mind, please post this as a bug so I can track it at: > > http://rubyforge.org/tracker/?atid=1971&group_id=494&func=browse Done - http://rubyforge.org/tracker/index.php?func=detail&aid=17885&group_id=494&atid=1971 Wer

[libxml-devel] Random crashes

2008-02-29 Thread Saurabh Nanda
Hi, I've posted earlier about such crashes but have not been able to resolve my problem. Using libxml validation is extremely critical for my application. I might have to rewrite my XSDs as RelaxNG schemas and use REXML for validation -- and take the accompanying performance hit. I don't want to d

Re: [libxml-devel] Random crashes

2008-03-05 Thread Saurabh Nanda
Trans, Thanks for replying. Although your answer doesn't help solve my problem with libxml-ruby it does give me a sense that it's going to take long to get this fixed. At least I can start rewriting my schemas in Relax NG now, so that I can meet my application production rollout deadline. Saurab

Re: [libxml-devel] Some changes for consideration

2008-04-06 Thread Saurabh Nanda
> 2) Rename the package from 'libxml-ruby' to 'libxml'. Why would you want to do that? Isn't having the -ruby suffix a good thing? Saurabh. -- http://nandz.blogspot.com http://foodieforlife.blogspot.com ___ libxml-devel mailing list libxml-devel@rubyf

Re: [libxml-devel] Status of libxml?

2008-05-27 Thread Saurabh Nanda
I shifted out of libxml to the (much) slower REXML and an ad-hoc over-the-network Java based XSD validation system. I would love to get libxml-ruby working again. A lot of my projects will depend on it. Dan, how can other people help? Is there someone who can coordinate other people's efforts in t