XQDB: Assertion `str.size() == length' failed.

Bug #914655 reported by David Graf
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
Fix Released
High
David Graf

Bug Description

I am able to produce an assertion in xqdb on ubuntu 10.04 64bit.

Query:
for $x in (1,2,3)
let $y := $x+1
return $y

Protocol:
./bin/xqdb -f -q debugger.xq
Communication port: 28028
Zorba executable: ./bin/zorba
Zorba arguments: -d -f -q debugger.xq
Zorba XQuery Debugger Server
Copyright 2006-2009 The FLWOR Foundation.
License: Apache License 2.0: <http://www.apache.org/licenses/LICENSE-2.0>

Established connection with XQuery client zorba
(xqdb) break -f debugger.xq -l 2

set breakpoint with id 1 and state enabled
(xqdb) run
<?xml version="1.0" encoding="UTF-8"?>

break in query body at /home/dagraf/zorba/build/debugger.xq:2

2 o| let $y := $x+1
(xqdb) print -c x

Error: Error while evaluating expression.
(xqdb) print -c $x
Segmentation fault
xqdb: /home/dagraf/zorba/sandbox/src/debugger/debugger_clientimpl.cpp:60: virtual void zorba::DebuggerListener::run(): Assertion `str.size() == length' failed.
Aborted

Revision history for this message
Gabriel Petrovay (gabipetrovay) wrote :

The error generated by the command:
print -c x

will cause a second evaluation command to fail whatever that is (even if a correct expression), for example:
print -c $x

Changed in zorba:
importance: Undecided → Medium
importance: Medium → High
status: New → In Progress
milestone: none → 2.2
Changed in zorba:
status: In Progress → Confirmed
Revision history for this message
Gabriel Petrovay (gabipetrovay) wrote :

I have tracked this down to a point where I don't know what to do.

The problem is that the debug iterator calls consumeNext on it's theChildren[1], which is an eval iterator. (debug_iterator_impl.cpp:169). If this eval iterator raises a runtime exception (for example, an invalid expression like the one shown in the comment above) in eval.cpp:198, while calling: state->thePlanWrapper->next(result), the execution jump out of EvalIterator::nextImpl without calling state->thePlanWrapper = NULL; in eval.cpp:203.

Therefore a second call to the same eval iterator will fail in eval.cpp:187 at "=" (something that has to do with an RCObject that calls ~PlanWrapper.

What I don't know is how to simulate
state->thePlanWrapper = NULL;
from a catch outside the caller of the eval iterator's nextImpl

Assigning to Markos.

Changed in zorba:
assignee: Gabriel Petrovay (gabipetrovay) → Markos Zaharioudakis (markos-za)
Changed in zorba:
milestone: 2.2 → 2.5
David Graf (davidagraf)
Changed in zorba:
status: Confirmed → In Progress
assignee: Markos Zaharioudakis (markos-za) → David Graf (davidagraf)
David Graf (davidagraf)
Changed in zorba:
status: In Progress → 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

Remote bug watches

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