Project

Profile

Help

Need advice on how to use SaxonC 11.1 Python API in web application

Added by Martin Honnen over 2 years ago

I started writing some more code using the Python API of SaxonC 11.1 HE and while command line programs run fine, any attempts to use similar code in a simple web application results in an error like "JET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at 0x0000000000a6730e" after the very first request.

I can't say I have lots of experience writing web applications in Python, so I might be doing something wrong but I would appreciate any advice on how/where to create/store the PySaxonProcessor object or how to organize the code to avoid the error.

A simple Python code is

"""
This script runs the application using a development server.
It contains the definition of routes and views for the application.
"""

from flask import Flask, request
app = Flask(__name__)

from saxonc import *

proc = PySaxonProcessor(license = False)

# Make the WSGI interface available at the top level so wfastcgi can get it.
wsgi_app = app.wsgi_app


@app.route('/')
def hello():
    """Renders a sample page."""
    return "Hello World!"

@app.route('/xquery', methods=['POST'])
def xquery():
    request_data = request.get_json()
    result = evaluate_xquery(proc, request_data)

    return result


def evaluate_xquery(proc, request_data):

    xquery_processor = proc.new_xquery_processor()
    
    if 'inputType' in request_data:
        if request_data['inputType'] == 'xml':
            input_node = proc.parse_xml(xml_text = request_data['inputData'])
            xquery_processor.set_context(xdm_item = input_node)
        elif request_data['inputType'] == 'json':
            xquery_processor1 = proc.new_xquery_processor()
            xquery_processor1.set_parameter('json-text', proc.make_string_value(request_data['inputData']))               
            input_json = xquery_processor1.run_query_to_value(query_text = 'declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization"; declare option output:method "adaptive"; declare variable $json-text as xs:string external; parse-json($json-text)')
            xquery_processor.set_context(xdm_item = input_json.head)
    result = xquery_processor.run_query_to_string(query_text = request_data['inputCode'])
    
    return result

if __name__ == '__main__':
    import os
    HOST = os.environ.get('SERVER_HOST', 'localhost')
    try:
        PORT = int(os.environ.get('SERVER_PORT', '5555'))
    except ValueError:
        PORT = 5555
    app.run(HOST, PORT)

The app starts fine and I can do a single request fine (at least as far as running the client code using JavaScript is concerned that does a fetch and receives a result:

fetch('/xquery', { method: 'POST', headers : { 'Content-Type' : 'application/json'} , body : JSON.stringify({inputCode : '?*', 'inputData' : '[1,2,3]', 'inputType' : 'json' }) }).then(response => response.text()).then(text => console.log(text))

gives <?xml version="1.0" encoding="UTF-8"?>1 2 3 but without any further requests the Python command console already shows

127.0.0.1 - - [11/Feb/2022 10:09:02] "←[37mPOST /xquery HTTP/1.1←[0m" 200 -

JET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at 0x0000000000a6730e
Please, contact the vendor of the application.
Crash dump will be written to "C:\Users\marti\source\repos\SaxonCPythonAPI\SaxonCPythonAPI\jet_dump_27600.dmp"
Extra information about error is saved in the "jet_err_27600.txt" file.

ao the server handled the /xquery request fine but then the JET runtime gives an error.

That text files starts as shown below, so it seems a memory access violation:

JET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at 0x0000000000a6730e
Please, contact the vendor of the application.
Crash dump will be written to "C:\Users\marti\source\repos\SaxonCPythonAPI\SaxonCPythonAPI\jet_dump_27600.dmp"

Exception 0xC0000005 (EXCEPTION_ACCESS_VIOLATION) at 0x0000000000a6730e (C:\Program Files\Saxonica\SaxonCHE11.1\libsaxonhec.dll+0x66730e)
Failed to read memory at 0x0000009c0d9f0000

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" "c:\program files\microsoft visual studio\2022\community\common7\ide\extensions\microsoft\python\core\debugpy" --connect 127.0.0.1:51423 --configure-subProcess False --configure-qt none --adapter-access-token 7eb4ea4aa456cafc14ab9e4d8167ff046cd2b609e8cd08916977861600df5764 C:\Users\marti\source\repos\SaxonCPythonAPI\SaxonCPythonAPI\app.py

OS:

Windows 10 build 19044

JET-compiled Components:

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

Replies (35)

Please register to reply

RE: Need advice on how to use SaxonC 11.1 Python API in web application - Added by O'Neil Delpratt over 2 years ago

I have limited experience with Flask. But I will investigate this further and report back. First step is the setup of the server with SaxonC installed

RE: Need advice on how to use SaxonC 11.1 Python API in web application - Added by O'Neil Delpratt over 2 years ago

The following bug issue might be helpful to find the cause of your crash: https://saxonica.plan.io/issues/4942

RE: Need advice on how to use SaxonC 11.1 Python API in web application - Added by O'Neil Delpratt over 2 years ago

I have managed to setup the Flask server and run the hello-world example with the hello() function, but failing to run the request with \xquery perhaps I have not correctly installed SaxonC.

RE: Need advice on how to use SaxonC 11.1 Python API in web application - Added by Martin Honnen over 2 years ago

Which client do you use for your requests? JavaScript? CURL? Did you make a POST HTTP request for /xquery? How does it fail?

RE: Need advice on how to use SaxonC 11.1 Python API in web application - Added by O'Neil Delpratt over 2 years ago

I just ran the /xquery in the browser. I missed that it is a POST request.

RE: Need advice on how to use SaxonC 11.1 Python API in web application - Added by O'Neil Delpratt over 2 years ago

I would like to use CURL, but not sure how to go about it

RE: Need advice on how to use SaxonC 11.1 Python API in web application - Added by Martin Honnen over 2 years ago

curl -d '{"inputCode":"?*", "inputData":"[1,2,3]", "inputType":"json"}' -H "Content-Type: application/json" -X POST http://localhost/xquery

Untested.

RE: Need advice on how to use SaxonC 11.1 Python API in web application - Added by O'Neil Delpratt over 2 years ago

I tried the following command which seems to have given me some response from the server:

curl --request POST \
  --url http://192.168.0.69:5000/xquery \
  --header 'Content-Type: application/xml' \
  --data "inputType=xml&inputData='<b/>'"

Response from the server:

url: (52) Empty reply from server

On the server I am getting the following crash:

"POST /xquery HTTP/1.1" 500 -
Error: failed to allocate an object - please check if an exception was thrown

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

Aborted (core dumped)

Not the same error. I know I am doing something wrong in my curl command.

RE: Need advice on how to use SaxonC 11.1 Python API in web application - Added by O'Neil Delpratt over 2 years ago

It would help if I ad seen your earlier message. i.e.:

curl -d '{"inputCode":"?*", "inputData":"[1,2,3]", "inputType":"json"}' -H "Content-Type: application/json" -X POST http://localhost/xquery

On the server this gives the error message:

.../saxonc_example.py", line 42, in evaluate_xquery
    xquery_processor.set_context(xdm_item = input_json.head)
AttributeError: 'NoneType' object has no attribute 'head'

RE: Need advice on how to use SaxonC 11.1 Python API in web application - Added by O'Neil Delpratt over 2 years ago

I did not notice the following error message:

Error: failed to allocate an object - please check if an exception was thrown

This means the SaxonProcessor or the xquery processor has got into an unclean state. It looks like an exception was thrown. Investigating this further.

RE: Need advice on how to use SaxonC 11.1 Python API in web application - Added by O'Neil Delpratt over 2 years ago

The error above is probably due to configuration issue with SaxonC in Flask. How do I set the environment variable SAXONC_HOME for Flask?

RE: Need advice on how to use SaxonC 11.1 Python API in web application - Added by Martin Honnen over 2 years ago

Then I would think using your shell for e.g. export SAXONC_HOME=/usr/lib before you do flask run should take care of the environment variable.

RE: Need advice on how to use SaxonC 11.1 Python API in web application - Added by O'Neil Delpratt over 2 years ago

Actually the SAXONC_HOME environment variable seems ok. I have also added the lines to the python script:

app.config['SAXONC_HOME'] =  environ.get('SAXONC_HOME')
app.config['PYTHONPATH'] = environ.get('PYTHONPATH')

It is strange, but maybe something else is going wrong.

RE: Need advice on how to use SaxonC 11.1 Python API in web application - Added by Martin Honnen over 2 years ago

I tried something simpler today, just two different requests to use SaxonC with HTTP GET

@app.route('/saxontest1')
def saxontest1():
    """Renders the Saxon test 1 page."""
    return render_template(
        'saxontest1.html',
        title='Saxon Test 1',
        year=datetime.now().year,

        message=saxon_proc.new_xpath_processor().evaluate_single('"Hello from Saxon: " ||  current-dateTime()')
    )

@app.route('/saxontest2')
def saxontest2():
    """Renders the about page."""
    return render_template(
        'saxontest2.html',
        title='Saxon Test 2',
        year=datetime.now().year,

        message=saxon_proc.new_xquery_processor().run_query_to_string(query_text = '"Hello from Saxon: " ||  current-dateTime()')
    )

I managed to run three successful GET requests e.g.

127.0.0.1 - - [04/Mar/2022 12:23:12] "GET /saxontest2 HTTP/1.1" 200 -
[...]
127.0.0.1 - - [04/Mar/2022 12:23:41] "GET /saxontest1 HTTP/1.1" 200 -
[...]
127.0.0.1 - - [04/Mar/2022 12:23:51] "GET /saxontest2 HTTP/1.1" 200 -

then I got an error JET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at 0x0000000000a6730e which shows as

JET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at 0x0000000000a6730e
Please, contact the vendor of the application.
Crash dump will be written to "C:\Users\marti\source\repos\FlaskSaxonCHE112Test1\FlaskSaxonCHE112Test1\jet_dump_50308.dmp"

Exception 0xC0000005 (EXCEPTION_ACCESS_VIOLATION) at 0x0000000000a6730e (C:\Program Files\Saxonica\SaxonC HE 11.2\libsaxonhec.dll+0x66730e)
Failed to read memory at 0x000000f8a8be0000

So far I am uncertain where/how to store the PySaxonProcessor once in that Flask app, but I am not sure the error is related to that.

RE: Need advice on how to use SaxonC 11.1 Python API in web application - Added by O'Neil Delpratt over 2 years ago

What output to do get when you uncomment DEBUG in the SaxonProcessor.h header file:

#define DEBUG

You would need to rebuild the Python library again with this change.

RE: Need advice on how to use SaxonC 11.1 Python API in web application - Added by Martin Honnen over 2 years ago

Here is a test run with the crash:

SaxonProc constructor(l) called
SaxonProc constructor: jvm exists! jvmCreatedCPP=1
SaxonProc constructor(l) called
[...]
New processor created, Processor: -398771856
DEBUG: SaxonCAPI: param-name: qs, type of Value= java.lang.String
qs
127.0.0.1 - - [04/Mar/2022 13:58:52] "GET /saxontest2 HTTP/1.1" 200 -
[...]
New processor created, Processor: -398771856
Properties size: 1
Parameter size: 0
size:1
xpathString: "Hello from Saxon: " ||  current-dateTime()
applyXPathPrperties: parameters map is empty
127.0.0.1 - - [04/Mar/2022 13:59:00] "GET /saxontest1 HTTP/1.1" 200 -
[...]
New processor created, Processor: -398771856
DEBUG: SaxonCAPI: param-name: qs, type of Value= java.lang.String
qs
127.0.0.1 - - [04/Mar/2022 13:59:18] "GET /saxontest2 HTTP/1.1" 200 -
[...]
New processor created, Processor: -398771856
Properties size: 1
Parameter size: 0
size:1
xpathString: "Hello from Saxon: " ||  current-dateTime()
applyXPathPrperties: parameters map is empty
127.0.0.1 - - [04/Mar/2022 13:59:27] "GET /saxontest1 HTTP/1.1" 200 -

JET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at 0x0000000000a6730e
Please, contact the vendor of the application.
Crash dump will be written to "C:\SomePath\FlaskSaxonCHE112Test1\FlaskSaxonCHE112Test1\jet_dump_78368.dmp"
Extra information about error is saved in the "jet_err_78368.txt" file.
JET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at 0x0000000000a6730e
Please, contact the vendor of the application.
Crash dump will be written to "C:\SomePath\FlaskSaxonCHE112Test1\FlaskSaxonCHE112Test1\jet_dump_78368.dmp"

Exception 0xC0000005 (EXCEPTION_ACCESS_VIOLATION) at 0x0000000000a6730e (C:\Program Files\Saxonica\SaxonC HE 11.2\libsaxonhec.dll+0x66730e)
Failed to read memory at 0x0000008d77ff0000

RE: Need advice on how to use SaxonC 11.1 Python API in web application - Added by O'Neil Delpratt over 2 years ago

Please can you share the render_template function?

RE: Need advice on how to use SaxonC 11.1 Python API in web application - Added by O'Neil Delpratt over 2 years ago

I have tried to create dummy function for render_template but still hitting other problems. Do you have the full example?

For some reason I still think my configuration is not right.

With the following request:

http://192.168.0.69:5000/saxontest2

I am getting the following output on the server (DEBUG enabled):

SaxonProc constructor(l) called
SaxonProc constructor: jvm exists! jvmCreatedCPP=1
SaxonProc constructor(l) called
 * Running on http://192.168.0.69:5000/ (Press CTRL+C to quit)
Error: failed to allocate an object - please check if an exception was thrown

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

Aborted (core dumped)

RE: Need advice on how to use SaxonC 11.1 Python API in web application - Added by Martin Honnen over 2 years ago

Well, that is not my code but part of the Flask software or its template engine Jinja2, I just use from flask import render_template and then call that function.

As far as I understand it, it takes a HTML "template" argument plus parameters you can use in the template to populate output so the original sample is e.g.

@app.route('/about')
def about():
    """Renders the about page."""
    return render_template(
        'about.html',
        title='About',
        year=datetime.now().year,
        message='Your application description page.'
    )

with about.html being e.g.

{% extends "layout.html" %}

{% block content %}

<h2>{{ title }}.</h2>
<h3>{{ message }}</h3>

<p>Use this area to provide additional information.</p>

{% endblock %}

and I used similar templates saxontest1.html

{% extends "layout.html" %}

{% block content %}

<h2>{{ title }}.</h2>
<h3>{{ message }}</h3>

<p>Use this area to provide additional information.</p>

{% endblock %}

The template engine is described in https://realpython.com/primer-on-jinja-templating/.

I will see whether I can write a template less REST web API but GET request example that is easier to share than that current sample.

For the time being I attach a zip with the Python sources, I think, although I am doing it in VS so I hope I have understood the full project structure.

Hmm, I see there is just one file missing up the directory structure in the parent, named runserver.py:

"""
This script runs the FlaskSaxonCHE112Test1 application using a development server.
"""

from os import environ
from FlaskSaxonCHE112Test1 import app

if __name__ == '__main__':
    HOST = environ.get('SERVER_HOST', 'localhost')
    try:
        PORT = int(environ.get('SERVER_PORT', '5555'))
    except ValueError:
        PORT = 5555
    app.run(HOST, PORT)

The virtual Python environment has the requirements.txt list

click==8.0.4
colorama==0.4.4
Flask==2.0.3
itsdangerous==2.1.0
Jinja2==3.0.3
MarkupSafe==2.1.0
pip==22.0.3
setuptools==60.9.3
Werkzeug==2.0.3
views.zip (368 KB) views.zip

RE: Need advice on how to use SaxonC 11.1 Python API in web application - Added by Martin Honnen over 2 years ago

Simplest log I have now is

127.0.0.1 - - [04/Mar/2022 17:15:13] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:15:14] "GET /favicon.ico HTTP/1.1" 404 -
127.0.0.1 - - [04/Mar/2022 17:15:28] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:15:29] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:15:30] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:15:31] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:15:31] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:15:31] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:15:31] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:15:32] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:15:32] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:15:32] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:15:32] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:15:33] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:15:33] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:15:34] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:15:48] "GET /saxontest2 HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:15:55] "GET /saxontest2 HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:15:56] "GET /saxontest2 HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:15:58] "GET /saxontest2 HTTP/1.1" 200 -

JET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at 0x0000000000a6730e
Please, contact the vendor of the application.
Crash dump will be written to "C:\SomePath\FlaskSaxonCHE112Test2\FlaskSaxonCHE112Test2\jet_dump_18076.dmp"
Extra information about error is saved in the "jet_err_18076.txt" file.

That file than has the usual "EXCEPTION_ACCESS_VIOLATION":

JET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at 0x0000000000a6730e
Please, contact the vendor of the application.
Crash dump will be written to "C:\SomePath\FlaskSaxonCHE112Test2\FlaskSaxonCHE112Test2\jet_dump_18076.dmp"

Exception 0xC0000005 (EXCEPTION_ACCESS_VIOLATION) at 0x0000000000a6730e (C:\Program Files\Saxonica\SaxonC HE 11.2\libsaxonhec.dll+0x66730e)
Failed to read memory at 0x00000095c09f0000

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" "c:\program files\microsoft visual studio\2022\community\common7\ide\extensions\microsoft\python\core\debugpy" --connect 127.0.0.1:59529 --configure-subProcess False --configure-qt none --adapter-access-token b69553b6abbe3e9067e3d5b40fb6fc81f04c8b284ab53f7cb8a481c855b1150b C:\SomePath\FlaskSaxonCHE112Test2\FlaskSaxonCHE112Test2\app.py

OS:

Windows 10 build 22000

JET-compiled Components:

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


I attach a zip with the files.

Python requirements.txt has only

Flask~=2.0.3

Will need to edit in the DEBUG flag on this system and recompile/rerun.

RE: Need advice on how to use SaxonC 11.1 Python API in web application - Added by Martin Honnen over 2 years ago

Here is a log with DEBUG enabled:

SaxonProc constructor(l) called
SaxonProc constructor: jvm exists! jvmCreatedCPP=1
SaxonProc constructor(l) called
 * Serving Flask app 'app' (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://localhost:64809/ (Press CTRL+C to quit)
127.0.0.1 - - [04/Mar/2022 17:51:25] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:51:25] "GET /favicon.ico HTTP/1.1" 404 -
127.0.0.1 - - [04/Mar/2022 17:51:32] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:51:34] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:51:36] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:51:37] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:51:38] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:51:39] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:51:39] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:51:40] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:51:40] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:51:41] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:51:41] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:51:41] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:51:42] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [04/Mar/2022 17:51:44] "GET / HTTP/1.1" 200 -
New processor created, Processor: 1452978032
DEBUG: SaxonCAPI: param-name: qs, type of Value= java.lang.String
qs
127.0.0.1 - - [04/Mar/2022 17:52:00] "GET /saxontest2 HTTP/1.1" 200 -
New processor created, Processor: 1452978032
DEBUG: SaxonCAPI: param-name: qs, type of Value= java.lang.String
qs
127.0.0.1 - - [04/Mar/2022 17:52:10] "GET /saxontest2 HTTP/1.1" 200 -
New processor created, Processor: 1452978032
DEBUG: SaxonCAPI: param-name: qs, type of Value= java.lang.String
qs
127.0.0.1 - - [04/Mar/2022 17:52:12] "GET /saxontest2 HTTP/1.1" 200 -
New processor created, Processor: 1452978032
DEBUG: SaxonCAPI: param-name: qs, type of Value= java.lang.String
qs
127.0.0.1 - - [04/Mar/2022 17:52:14] "GET /saxontest2 HTTP/1.1" 200 -

JET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at 0x0000000000a6730e
Please, contact the vendor of the application.
Crash dump will be written to "C:\SomePath\FlaskSaxonCHE112Test2\FlaskSaxonCHE112Test2\jet_dump_35992.dmp"
Extra information about error is saved in the "jet_err_35992.txt" file.

RE: Need advice on how to use SaxonC 11.1 Python API in web application - Added by O'Neil Delpratt over 2 years ago

I have still failed to get my flask server working properly with SaxonC.

It would be good to get it working with gdb.

Is it possible you can get it working with docker?

RE: Need advice on how to use SaxonC 11.1 Python API in web application - Added by Martin Honnen over 2 years ago

I don't really have experience with Docker. I tried to "move" my zip to Linux (run as Window Linux subsystem) and ended up with "Error: failed to allocate an object - please check if an exception was thrown"

JET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at 0x00007efe9e878da1
Please, contact the vendor of the application.
Core dump will be written to "/mnt/wslg/dumps/core.%e"

Signal 11 (SIGSEGV)
siginfo: si_signo 11, si_errno 0, si_code 1, si_addr 0x0000000000000100

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
  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: "python3" "-m" "flask" "run"

I suppose that "Error: failed to allocate an object - please check if an exception was thrown" is the same that prevented you from getting SaxonC to run at all with Flask. I will try to figure what is missing.

(1-25/35)

Please register to reply