Internal Fatal Error with validate-in-place

Bug #854723 reported by Federico Cavalieri on 2011-09-20
258
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
High
Markos Zaharioudakis

Bug Description

This bug is due to the same incorrect assumption reported in bug 854688.
Invoking schema:validate-in-place creates several UpdSetElementType operations. Their apply method expects that if a node has a typedvalue it also contains a single node with text type. This is not true in the following example, which raises:

Zorba Internal Fatal Error in /zorba/trunksrc/src/store/naive/pul_primitives.cpp:488:
"target->numChildren() == 1": condition failed
Aborted

Federico Cavalieri (fcavalieri) wrote :

import schema namespace s = "http://www.xqdoc.org/1.0";
import module namespace schema = "http://www.zorba-xquery.com/modules/schema";

variable $hostInfo :=<xqdoc xmlns="http://www.xqdoc.org/1.0">
    <control>
        <date>TS4J5UJ<?processinginstruction aaa?></date>
        <version>N/A</version>
    </control>
    <module type="library">
        <uri>DGQEb8Q</uri>
    </module>
</xqdoc>;

schema:validate-in-place($hostInfo);
$hostInfo

Federico Cavalieri (fcavalieri) wrote :

The following expression raises a similar error, due to the same assumption:

import schema namespace s = "http://www.xqdoc.org/1.0";
import module namespace schema = "http://www.zorba-xquery.com/modules/schema";

variable $hostInfo :=<xqdoc xmlns="http://www.xqdoc.org/1.0">
    <control>
        <date>TS4J5UJ</date>
        <version>N/A</version>
    </control>
    <module type="library">
        <uri>DGQEb8Q</uri>
    </module>
</xqdoc>;

schema:validate-in-place($hostInfo);
replace node $hostInfo//*:date/node()[1] with <?processinginstruction aaa?>;
$hostInfo

Raises:
Zorba Internal Fatal Error in /zorba/trunksrc/src/store/naive/pul_primitives.cpp:489:
"target->getChild(0)->getNodeKind() == store::StoreConsts::textNode": condition failed
Aborted

description: updated
Changed in zorba:
importance: Undecided → High
visibility: private → public
Changed in zorba:
assignee: nobody → Markos Zaharioudakis (markos-za)
status: New → Fix Released
To post a comment you must log in.
This report contains Public Security information  Edit
Everyone can see this security related information.

Other bug subscribers