Comment 2 for bug 1099648

Revision history for this message
Chris Hillery (ceejatec) wrote :

I've spent quite some time looking into this. I've narrowed down the problem but cannot come up with a solution.

First off: this query works perfectly if you run it in the debugger. So, that certainly makes it extra aggravating. It also says something about the kind of error it might be. However, when you run the query outside of the debugger, it still runs valgrind clean (even though it raises the parsing error), so it's not some kind of subtle memory smash. I have, I believe, seen the query run successfully outside of the debugger when it ran immediately after a Zorba build, so it's possible this is actually some kind of race condition (although how that's possible I have no idea).

The problem has something to do with our interaction with libxml2. What happens is that xmlPushInput() (called by FragmentXmlLoader::loadXml()) ends up calling back to the SAX error handler (FastXmlLoader::error()) with the message "internal error". I've spent quite a while trying to figure out why without success. Unfortunately, compiling my own version libxml2 to try to debug this also made the query succeed.

I've also spent quite a while trying to figure out if calling xmlPushInput() is the right thing to do. I can't find any libxml2 examples which support using that function in this way. At this point, though, I'm out of time to spend on this...