Project

Profile

Help

Bug #4352

JET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at 0x0000000000428b82

Added by O'Neil Delpratt 11 months ago. Updated 11 months ago.

Status:
Closed
Priority:
Normal
Category:
C++ API
Start date:
2019-10-21
Due date:
% Done:

100%

Estimated time:
Found in version:
1.2.0
Fixed in version:
1.2.1

Description

The following sample code crashes out:

with saxonc.PySaxonProcessor(license=False) as proc:
    print(proc.version)

    xquery_processor = proc.new_xquery_processor()

    result = xquery_processor.run_query_to_value(query_text = 'declare variable $n external := 10; (1 to $n)!(. * .)')

    print(result.size)

    for i in range(result.size):
        print(result.item_at(i))

See error below:

Saxon/C 1.2.0 running with Saxon-HE 9.9.1.5J from Saxonica
10
1

JET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at 0x0000000000428b82

The issue is we are not handling properly the case where the `XdmValue is a sequence.

In the C++ code we are checking if the XdmValue is an instance of XdmNode or XdmtomicValue. But if it is neither of these types we just wrap the Java XdmValue object in the wrapper class in C++. This is no good in the case where the XdmValue contains a sequence value like a SequenceExtent object. In the Xslt30Processor object we handle this case by building sequence of items on the C++ side, but this code we are just not using in the XQueryProcessor.

I have made the fix in the C++ code and the sample above works now.

Testing for other places in the code which needs this fix.

History

#1 Updated by O'Neil Delpratt 11 months ago

  • Status changed from New to In Progress

#2 Updated by O'Neil Delpratt 11 months ago

  • Description updated (diff)

#3 Updated by O'Neil Delpratt 11 months ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

Bug fixed and committed to subversion.

Patch available in the next maintenance release.

But for those who would be happy to apply the fix immediately you can download and replace the following files:

XPathProcessor.cpp XQueryProcessor.cpp

#4 Updated by O'Neil Delpratt 11 months ago

  • Status changed from Resolved to In Progress

Reopening this bug issue, because under XPath still getting the error.

#5 Updated by O'Neil Delpratt 11 months ago

  • Status changed from In Progress to Resolved

Bug fixed. The toString method in the C++ XdmValue returns a C char array pointer, which is held internally. The python API seems to be deleting the char pointer array. I have changed how the string is maintained internally. The char array pointer must now be managed by the calling program.

#6 Updated by O'Neil Delpratt 11 months ago

Files changed: saxonc.pyx, XdmValue.h and xdmValue.cpp

#7 Updated by O'Neil Delpratt 11 months ago

  • Status changed from Resolved to Closed
  • Fixed in version set to 1.2.1

Bug fix applied in the Saxon/C maintenance release 1.2.1

Please register to edit this issue

Also available in: Atom PDF