segfault in parse-xml:parse()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zorba |
Fix Released
|
Critical
|
Nicolae Brinza |
Bug Description
parse-xml:parse() results in a segfault when called with:
<opt:options>
<opt:
</opt:options>
or with
<opt:options>
<opt:
</opt:options>
for that matter.
With only <opt:options /> it works.
Reproduce:
echo "<page />" > acc.xml
zorba -f -q xmlparse.xq
This was tested with the zorba build from revision 10923.
$ gdb --args zorba -f -q xmlparse.xq
[Thread debugging using libthread_db enabled]
<?xml version="1.0" encoding="UTF-8"?>
fetch [0]: xs:string(<page />
)
Program received signal SIGSEGV, Segmentation fault.
0xb54e29de in std::basic_
also:
$ valgrind install_
==21695== Memcheck, a memory error detector
==21695== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==21695== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info
==21695== Command: /home/tillw/
==21695==
<?xml version="1.0" encoding="UTF-8"?>
fetch [0]: xs:string(<page />
)
==21695== Invalid write of size 4
==21695== at 0x6B0AFD3: std::istream:
==21695== by 0x4EA5B70: zorba::
==21695== by 0x4EAAAC1: zorba::
==21695== by 0x4EAB3E2: zorba::
std::char_
char>, std::allocator<
==21695== by 0x4ECD245: zorba::
ar_traits<char>, std::allocator<
std::allocator<
==21695== by 0x4A96C87: zorba::
ate&) const (parse_
==21695== by 0x489381C: zorba::
em>&, zorba::PlanState&) const (plan_iterator.
==21695== by 0x4B3D7BA: zorba::
orba::PlanState&) (plan_iterator.
==21695== by 0x49FA142: zorba::
s_and_diagnosti
==21695== by 0x4969368: zorba::
tate&) const (plan_iterator.
==21695== by 0x4B3D7BA: zorba::
orba::PlanState&) (plan_iterator.
==21695== by 0x4B823DA: zorba::
(flwor_
==21695== Address 0x7406f1c is 4 bytes inside a block of size 280 free'd
==21695== at 0x4025907: operator delete(void*) (vg_replace_
==21695== by 0x6B0215F: std::basic_
o.6.0.14)
==21695== by 0x4778C2C: zorba::
==21695== by 0x4E697E6: zorba::
==21695== by 0x4E69866: zorba::
==21695== by 0x4C775ED: zorba::
==21695== by 0x4E0AE39: zorba::
==21695== by 0x445768B: zorba::
re::Item>
==21695== by 0x4456971: zorba::
(item_handle.h:143)
==21695== by 0x4A96C9C: zorba::
ate&) const (parse_
==21695== by 0x489381C: zorba::
em>&, zorba::PlanState&) const (plan_iterator.
==21695== by 0x4B3D7BA: zorba::
orba::PlanState&) (plan_iterator.
==21695==
Related branches
- Chris Hillery: Approve
- Nicolae Brinza: Approve
-
Diff: 459 lines (+362/-6)6 files modifiedChangeLog (+8/-0)
src/store/naive/loader.h (+2/-1)
src/store/naive/loader_dtd.cpp (+22/-5)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-57.xml.res (+159/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/bad.xml (+158/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-57.xq (+13/-0)
description: | updated |
Changed in zorba: | |
status: | Confirmed → Fix Committed |
Changed in zorba: | |
status: | Fix Committed → Fix Released |
I'll take a look.