Project

Profile

Help

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

Added by Raik Müller about 4 years ago

Use Case:

looping an evaluation method of xPaths over several XML Files.

I tried first to "release" the object after each evaluation and changed than to impl. "release()" after the evaluation --> same problems

proc = saxonc.PySaxonProcessor(license=True)
xp = proc.new_xpath_processor()


def evaluate_cda_file(self, xPath, cda_file_path):
        cda_file_path = str(cda_file_path)
        results = None
        try:

            self.xp.declare_namespace("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance")
            self.xp.declare_namespace("", "urn:hl7-org:v3")
            self.xp.set_context(file_name=cda_file_path)
            results = self.xp.evaluate(xPath)
         
            self.xp.clear_parameters()
            self.xp.clear_properties()

        except:
            print("ERROR")

        if results is None:
            return False
        return True

def clean_up(self):
        self.proc.release()

Error:

*JET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at 0x0000000101a1bf56 Please, contact the vendor of the application. Core dump will be written to "/cores/core.2821" (max size 4294967295 kB). To ensure a full core dump, try "ulimit -c unlimited" Extra information about error is saved in the "jet_err_2821.txt" file.

Fatal Error: another attempt of termination from the same thread. *

Similar errors happen in the same usecase (see attachment):

system exception at 0x000000010b2ce870 system exception at 0x000000010b2b08 system exception at 0x0000000000000000

My UnitTests work fine a several time but randomly after a couple of times I get the error. When I use the evaluation method in a for loop it crashes immediately.

Thanks in advance


Replies (31)

Please register to reply

RE: JET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at 0x0000000101a1bf56 - Added by O'Neil Delpratt almost 4 years ago

I have updated to python3.7 and the Saxon/C build for python now fails:

Traceback (most recent call last):
  File "saxon-setup.py", line 6, in <module>
    setup(ext_modules=cythonize([Extension("saxonc", ["saxonc.pyx", "../SaxonProcessor.cpp", "../SaxonCGlue.c", "../SaxonCXPath.c", "../XdmValue.cpp", "../XdmItem.cpp", "../XdmNode.cpp", "../XdmAtomicValue.cpp", "../XsltProcessor.cpp","../Xslt30Processor.cpp", "../XQueryProcessor.cpp","../XPathProcessor.cpp","../SchemaValidator.cpp"], language="c++",)]),include_dirs = ['../jni', "../jni/unix"],
  File "/usr/lib/python3/dist-packages/Cython/Build/Dependencies.py", line 749, in cythonize
    ctx = c_options.create_context()
  File "/usr/lib/python3/dist-packages/Cython/Compiler/Main.py", line 577, in create_context
    self.cplus, self.language_level, options=self)
  File "/usr/lib/python3/dist-packages/Cython/Compiler/Main.py", line 75, in __init__
    from . import Builtin, CythonScope
  File "/usr/lib/python3/dist-packages/Cython/Compiler/CythonScope.py", line 5, in <module>
    from .UtilityCode import CythonUtilityCode
  File "/usr/lib/python3/dist-packages/Cython/Compiler/UtilityCode.py", line 3, in <module>
    from .TreeFragment import parse_from_strings, StringParseContext
  File "/usr/lib/python3/dist-packages/Cython/Compiler/TreeFragment.py", line 17, in <module>
    from .Visitor import VisitorTransform
  File "/usr/lib/python3/dist-packages/Cython/Compiler/Visitor.py", line 15, in <module>
    from . import ExprNodes
  File "/usr/lib/python3/dist-packages/Cython/Compiler/ExprNodes.py", line 2713
    await = None
          ^
SyntaxError: invalid syntax

RE: JET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at 0x0000000101a1bf56 - Added by O'Neil Delpratt almost 4 years ago

I have now managed to reproduce the error you reported:

JET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at 0x00007f82380000e8
Please, contact the vendor of the application.
Core dump will be piped to "/usr/share/apport/apport %p %s %c %d %P"
Extra information about error is saved in the "jet_err_21289.txt" file.

Fatal Error: another attempt of termination from the same thread.

Now investigation time.

Thanks for the instructions to setup the django server.

RE: JET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at 0x0000000101a1bf56 - Added by O'Neil Delpratt almost 4 years ago

Hi,

Just to report back that if we avoid calling the release() function in the PySaxonProcessor class then the crash goes away. I also tried the calling the evaluator function from PyXPathProcessor in a for loop, which worked fine.

Here is my Python script:

@csrf_exempt
@api_view(('POST',))
def create_new_criteria(request):
        if request.method == 'POST':
            # run here a method from the examples provided by saxon. 
            # so the error should happen as soon you create in saxon object lik$
            # proc = saxonc.PySaxonProcessor(license=True)
            # I guess you should also use also the xPath object to be sure the $

                proc = PySaxonProcessor(license=True)

                print(proc.version)
                #print(dir(proc))
                xml = "<out><person>text1</person><person>text2</person><person$
                xp = proc.new_xpath_processor()
                node = proc.parse_xml(xml_text=xml)
                print('test 1\n node='+node.string_value)
                xp.set_context(xdm_item=node)
                for x in range(6):
                        item = xp.evaluate_single('//person[1]')
                        if isinstance(item, PyXdmNode):
                                print(item.string_value)

                return Response(status=status.HTTP_400_BAD_REQUEST)

I found it difficult to reconstruct from your snippets of code. If you have a full example that you can send across to me to try I will be happy to run it at my end.

RE: JET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at 0x0000000101a1bf56 - Added by O'Neil Delpratt almost 4 years ago

I am now concluding that the system crashes are happening as a result of the clean_up function in your example code. This function is calling the PySaxonProcessor release() function which cleans up and destroys the JET Java VM to release memory used. In the django environment I recommend not calling this function.

Also I recommend against using the context manager syntax (i.e. with keyword) as it will call the release function in the clean up of resources.

Please let me know how it goes.

RE: JET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at 0x0000000101a1bf56 - Added by Raik Müller almost 4 years ago

Thank you very very much for your effort and analyse° I hope I can try it soon (Today or Monday) to see if it works for me too.

I also don't use the syntax with the "with" keyword but I also think I tested sometimes without my cleanup method (without success). I will let you know after my tests.

Best regards

(26-31/31)

Please register to reply