Bug #4352
closedJET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at 0x0000000000428b82
100%
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.
Updated by O'Neil Delpratt about 5 years ago
- Status changed from New to In Progress
Updated by O'Neil Delpratt about 5 years 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:
Updated by O'Neil Delpratt about 5 years ago
- Status changed from Resolved to In Progress
Reopening this bug issue, because under XPath still getting the error.
Updated by O'Neil Delpratt about 5 years 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.
Updated by O'Neil Delpratt about 5 years ago
Files changed: saxonc.pyx, XdmValue.h and xdmValue.cpp
Updated by O'Neil Delpratt about 5 years 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