Project

Profile

Help

Bug #4885

closed

Exception 0xC0000005 (EXCEPTION_ACCESS_VIOLATION) Failed to read memory at 0x0000000000000000

Added by Brian Higashide about 3 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
High
Category:
Python
Start date:
2021-01-28
Due date:
% Done:

100%

Estimated time:
Found in version:
1.2.1
Fixed in version:
11.1
Platforms:

Description

Qhen attempting schematron validation I am getting an Error JET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at ...

please find code and .dmp file attached.


Files

test.py (1.65 KB) test.py Brian Higashide, 2021-01-28 17:18
jet_err_1000.txt (46.6 KB) jet_err_1000.txt Brian Higashide, 2021-01-28 17:18
saxonc.pyx (146 KB) saxonc.pyx O'Neil Delpratt, 2021-02-15 14:06
Actions #1

Updated by O'Neil Delpratt about 3 years ago

  • Category set to Python
  • Assignee set to O'Neil Delpratt
  • Found in version set to 1.2.1

Hi,

Please can you send me privately your XSLT file so that I can try and reproduce the error.

Actions #2

Updated by O'Neil Delpratt about 3 years ago

  • Status changed from New to In Progress

Hi Brian,

I have managed to reproduce the issue you reported. I see the following printout then it hangs and then crashes:

Test Saxon/C on Python
Saxon/C 1.2.1 running with Saxon-HE 9.9.1.5C from Saxonica
AccountTransfer-runtime-compiled.xsl
	nc:Date is required in ns2:StartDate.

I am not seeing the problem on Java, so it is specific to Saxon/C. I am still investigating.

Actions #3

Updated by O'Neil Delpratt about 3 years ago

Update:

On Saxon/C the stylesheet with the given source documents works fine using the command Transfom.c and within the C++ API. Therefore the bug is specific to the python API.

Actions #4

Updated by O'Neil Delpratt about 3 years ago

  • Status changed from In Progress to Rejected

Hi Brian,

Having looked back at the python code. These are the problems I found:

  1. The program runs out of memory due to the while loop going into infinite loop. The i variable needs incrementing.
  2. PySaxonProcessor objects is created within for loop, which is not advised as it should in most cases created once.
Actions #5

Updated by O'Neil Delpratt about 3 years ago

  • Status changed from Rejected to In Progress

I am reopening this bug issue because after fixing up the python code with the suggestions in comment #4 the user is now getting a segmentation error.

This looks like a bug. The problem is if there are no XSL messages the variable msg in the code msg=xslt30_processor.get_xsl_messages() should be None, but it is in a unclean state.

Actions #6

Updated by O'Neil Delpratt about 3 years ago

This is indeed a bug. In the saxonc.pyx file the following patch should be applied to the get_xsl_messages method which appears in the classes PyXsltProcessor and PyXslt30Processor:

     def get_xsl_messages(self):
        """
        Get the messages written using the <code>xsl:message</code> instruction
        get_xsl_message(self)
        
        Returns:
            PyXdmValue: Messages returned as an XdmValue. 

        """
        cdef saxoncClasses.XdmValue * xdmValue = NULL
        cdef PyXdmValue val = None
        
        xdmValue = self.thisxptr.getXslMessages()
        if xdmValue is NULL:
            return None        
        else:
            val = PyXdmValue()
            val.thisvptr = xdmValue
            return val

Also at the end of the users python script the proc.release() method is required.

Alternatively, if the PySaxonProcessor is used as a context then itself calls the release method:

with saxonc.PySaxonProcessor(license=False) as proc:
    ......
Actions #7

Updated by O'Neil Delpratt about 3 years ago

I am closing this bug as the fix was described in comment #6. Also added the patched file to this bug issue.

The mechanism for Saxon/C 1.3 has changed. We will be delivering the xsl:messages to return them in a filename given by the user.

Actions #8

Updated by O'Neil Delpratt about 2 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in version set to 11.1

Bug fix patched in SaxonC 11.1 release

Please register to edit this issue

Also available in: Atom PDF