Object form of JsonML causes crash

Bug #998757 reported by William Candillon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
Fix Released
Undecided
Paul J. Lucas

Bug Description

The following query:

import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";

let $opt := <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"><json-format value="JsonML-array"/></options>
let $json := '{"name": "msg", "args": ["<div><span>@wcandillon:</span> parse</div>"]}'
return
  json:parse($json, $opt)

Returns:
<?xml version="1.0" encoding="UTF-8"?>
Zorba Internal Fatal Error in /Users/wcandillon/tmp/zorba/src/store/naive/node_items.cpp:2908:
"!ns.empty() || prefix.empty()": condition failed: prefix = <div><span>@wcandillon ns =
Abort trap: 6

Example:
http://www.zorba-xquery.com/html/demo#qCL4/2QZzsmiSyPv6SjmdZH025s=

Related branches

Changed in zorba:
milestone: none → 2.5
assignee: nobody → Paul J. Lucas (paul-lucas)
summary: - JSON Module crash
+ Object form of JsonML causes crash
Changed in zorba:
status: New → In Progress
Revision history for this message
Paul J. Lucas (paul-lucas) wrote :

FYI: Your JsonML is illegal. Zorba supports only the array form of JsonML. There's still a bug in that I didn't detect this, but that's easy to fix. The correct result should be an error.

Revision history for this message
William Candillon (wcandillon) wrote : Re: [Bug 998757] Re: Object form of JsonML causes crash

Indeed, I discovered it after filing the bug entry.

On Sun, May 13, 2012 at 5:40 PM, Paul J. Lucas
<email address hidden> wrote:
> FYI: Your JsonML is illegal. Zorba supports only the array form of
> JsonML. There's still a bug in that I didn't detect this, but that's
> easy to fix. The correct result should be an error.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/998757
>
> Title:
>  Object form of JsonML causes crash
>
> Status in Zorba - The XQuery Processor:
>  In Progress
>
> Bug description:
>  The following query:
>
>  import module namespace json = "http://www.zorba-
>  xquery.com/modules/converters/json";
>
>  let $opt := <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"><json-format value="JsonML-array"/></options>
>  let $json := '{"name": "msg", "args": ["<div><span>@wcandillon:</span> parse</div>"]}'
>  return
>    json:parse($json, $opt)
>
>  Returns:
>  <?xml version="1.0" encoding="UTF-8"?>
>  Zorba Internal Fatal Error in /Users/wcandillon/tmp/zorba/src/store/naive/node_items.cpp:2908:
>  "!ns.empty() || prefix.empty()": condition failed: prefix = <div><span>@wcandillon ns =
>  Abort trap: 6
>
>  Example:
>  http://www.zorba-xquery.com/html/demo#qCL4/2QZzsmiSyPv6SjmdZH025s=
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/zorba/+bug/998757/+subscriptions

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.