Project

Profile

Help

SaxonC 11.2 crashes when trying to create XdmValue with sequence of XdmArrays from Python

Added by Martin Honnen almost 3 years ago

The code

from saxonc import *

with PySaxonProcessor(license=False) as proc:
    print("Test SaxonC on Python")
    print(proc.version)
    
    xdm_value = PyXdmValue()
    for i in range(1, 6):
        xdm_value.add_xdm_item(proc.make_array([proc.make_integer_value(n) for n in range(1, i)]))

    print(isinstance(xdm_value, PyXdmValue))
    
    print(xdm_value)
    
    for item in xdm_value:
        print(isinstance(item, PyXdmItem))
        print(isinstance(item, PyXdmArray))
        print(item)

crashes with

Test SaxonC on Python
SaxonC-HE 11.2 from Saxonica
Error found when converting array of XdmValue to XdmArray
JET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at 0x00007ffcc0fe553a
Please, contact the vendor of the application.
Crash dump will be written to "C:\SomePath\arrays-and-maps\jet_dump_3060.dmp"
Extra information about error is saved in the "jet_err_3060.txt" file.

The error file starts with

JET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at 0x00007ffcc0fe553a
Please, contact the vendor of the application.
Crash dump will be written to "C:\SomePath\arrays-and-maps\jet_dump_3060.dmp"

Exception 0xC0000005 (EXCEPTION_ACCESS_VIOLATION) at 0x00007ffcc0fe553a (C:\Program Files\Saxonica\SaxonC HE 11.2\Saxon.C.API\python-saxon\saxonc.cp39-win_amd64.pyd+0x4553a)
Failed to read memory at 0x0000000000000006

Version Information:

  Java version: 1.8.0_181
  Excelsior JET 15.30 Enterprise edition
  JET Profile: OpenJDK version: 1.8.0_181; JET update level: 6; CPU architecture: amd64
  Runtime: Server
  CPU features: cmov mmx sse sse2 sse3 ssse3 sse4.1 sse4.2 avx avx2 fma f16c lzcnt popcnt bmi1 bmi2 adx cx8 cx16 movbe avx-512f
  Application was deployed

Options and system properties:

  -Djet.jit.disable.resolution=
  -Djet.gc.heaplimit=0
  -Djet.stack.trace=

Entry point type: Invocation API

Command line: "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\python.exe" .\createSequenceOfArraysTest1.py

OS:

Windows 10 build 19044

JET-compiled Components:

C:\Program Files\Saxonica\SaxonC HE 11.2\libsaxonhec.dll dll, version info: jet-1530-mp1 (ent, en)

Replies (5)

Please register to reply

RE: SaxonC 11.2 crashes when trying to create XdmValue with sequence of XdmArrays from Python - Added by O'Neil Delpratt almost 3 years ago

The error message Error found when converting array of XdmValue to XdmArray gives a clue as to where the failure happens. The program crashes in the @:makeArray@ method of the @SaxonProcessor@ C++ class.

This is bug.

Possible causes:

  1. The array length or underlying array is NULL when passed to the C++ method @makeArray()@.
  2. PyXdmItem object are garbaged collected by Python before they are used by the C++ code.
  3. Corruption of the memory between the C++ and Python code-base.

RE: SaxonC 11.2 crashes when trying to create XdmValue with sequence of XdmArrays from Python - Added by O'Neil Delpratt almost 3 years ago

I have applied a patch for this issue, but I am wondering if this is the correct arrays created?

[1]
[1,2]
[1,2,3]
[1,2,3,4]

RE: SaxonC 11.2 crashes when trying to create XdmValue with sequence of XdmArrays from Python - Added by O'Neil Delpratt almost 3 years ago

I have applied another patch to this bug issue and now we have the correct number of XdmArrays created:

[]
[1]
[1,2]
[1,2,3]
[1,2,3,4]

Notice we have the empty array

    (1-5/5)

    Please register to reply