Segfault in xml:parse

Bug #1023170 reported by mb21
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
Fix Released
High
Chris Hillery

Bug Description

We compiled the zorba from source, revision 10923 and we still get a segfault when running xml:parse on something we got from either http:get or fetch:content. Maybe reopen bug #867154 or bug #1020953

Replacing the "let http:get()" with "variable http:get();" fixes it.

$ zorba -f -q variable-zorba.xq
[Thread debugging using libthread_db enabled]
<?xml version="1.0" encoding="UTF-8"?>

Program received signal SIGSEGV, Segmentation fault.
0xb54e29de in std::basic_istream<char, std::char_traits<char> >::sentry::sentry(std::basic_istream<char, std::char_traits<char> >&, bool) () from /usr/lib/i386-linux-gnu/libstdc++.so.6
(gdb) bt
#0 0xb54e29de in std::basic_istream<char, std::char_traits<char> >::sentry::sentry(std::basic_istream<char, std::char_traits<char> >&, bool) () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#1 0xb54e2fee in std::basic_istream<char, std::char_traits<char> >::read(char*, int) () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#2 0xb7a0eb71 in zorba::simplestore::FastXmlLoader::readPacket (this=0x8134260, stream=..., buf=0x81c6c6b "", size=0)
    at /home/tillw/code/zorba/zorba/src/store/naive/loader_fast.cpp:242
#3 0xb7a13ac2 in zorba::simplestore::FragmentXmlLoader::fillBuffer (this=0x8134260, theFragmentStream=0x814687c)
    at /home/tillw/code/zorba/zorba/src/store/naive/loader_dtd.cpp:161
#4 0xb7a143e3 in zorba::simplestore::FragmentXmlLoader::loadXml (this=0x8134260, baseUri=..., docUri=..., stream=...)
    at /home/tillw/code/zorba/zorba/src/store/naive/loader_dtd.cpp:260
#5 0xb7a36246 in zorba::simplestore::Store::loadDocument (this=0xb7fde600, baseUri=..., docUri=..., stream=..., loadProperties=...)
    at /home/tillw/code/zorba/zorba/src/store/naive/store.cpp:1030
#6 0xb75ffc88 in zorba::FnZorbaParseXmlFragmentIterator::nextImpl (this=0x81640e0, result=..., planState=...)
    at /home/tillw/code/zorba/zorba/src/runtime/parsing_and_serializing/parse_fragment_impl.cpp:230
#7 0xb73fc81d in zorba::Batcher<zorba::FnZorbaParseXmlFragmentIterator>::produceNext (this=0x81640e0, result=..., planState=...)
    at /home/tillw/code/zorba/zorba/src/runtime/base/plan_iterator.h:535
#8 0xb76a67bb in zorba::PlanIterator::consumeNext (result=..., iter=0x81640e0, planState=...)
    at /home/tillw/code/zorba/zorba/src/runtime/base/plan_iterator.cpp:109
#9 0xb77e7a32 in zorba::SequentialIterator::nextImpl (this=0x8164170, result=..., planState=...)
    at /home/tillw/code/zorba/zorba/src/runtime/scripting/scripting.cpp:96
#10 0xb77f069d in zorba::Batcher<zorba::SequentialIterator>::produceNext (this=0x8164170, result=..., planState=...)
    at /home/tillw/code/zorba/zorba/src/runtime/base/plan_iterator.h:535
#11 0xb76a67bb in zorba::PlanIterator::consumeNext (result=..., iter=0x8164170, planState=...)
    at /home/tillw/code/zorba/zorba/src/runtime/base/plan_iterator.cpp:109
#12 0xb76a6156 in zorba::PlanWrapper::next (this=0x8138d18, result=...)
    at /home/tillw/code/zorba/zorba/src/runtime/api/plan_wrapper.cpp:151
#13 0xb7014061 in zorba::serializer::serialize (this=0xbfffe5b8, aObject=..., aOStream=..., aHandler=0x0)
    at /home/tillw/code/zorba/zorba/src/api/serialization/serializer.cpp:2781
#14 0xb7013da2 in zorba::serializer::serialize (this=0xbfffe5b8, aObject=..., aOStream=...)
    at /home/tillw/code/zorba/zorba/src/api/serialization/serializer.cpp:2733
#15 0xb6fb747e in zorba::XQueryImpl::serialize (this=0x8133258, os=..., aWrapper=..., opt=0xbfffe7f0)
    at /home/tillw/code/zorba/zorba/src/api/xqueryimpl.cpp:1305
#16 0xb6fb6889 in zorba::XQueryImpl::execute (this=0x8133258, os=..., opt=0xbfffe7f0)
    at /home/tillw/code/zorba/zorba/src/api/xqueryimpl.cpp:1131
#17 0x0805a91e in compileAndExecute (zorbaInstance=0xb7fda600, properties=..., staticContext=..., qfilepath=..., qfile=...,
    outputStream=..., timing=...) at /home/tillw/code/zorba/zorba/bin/zorbacmd.cpp:801
#18 0x0805bdee in main (argc=4, argv=0xbffff024) at /home/tillw/code/zorba/zorba/bin/zorbacmd.cpp:1081

Related branches

Revision history for this message
mb21 (mauro-bieg) wrote :
description: updated
Revision history for this message
Chris Hillery (ceejatec) wrote :

I'll take a look, as it is quite possibly to do with streams and URI resolution again. If it ends up being inside the parse code itself I'll re-assign to Nicolae, I believe.

Changed in zorba:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Chris Hillery (ceejatec)
milestone: none → 2.7
Revision history for this message
Chris Hillery (ceejatec) wrote :

Caused by same underlying problem as bug 1024033.

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

I'm removing the "Duplicate" marking for the moment so it still shows up in my list. I will verify when bug 1024033 is fixed.

Revision history for this message
mb21 (mauro-bieg) wrote :

#bug 1024033 is fixed now ;)

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

Seems to be all better.

Changed in zorba:
status: Confirmed → Fix Committed
Changed in zorba:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.