Project

Profile

Help

Bug #5456

closed

testValidator.exe core dumps on Windows in testValidator5

Added by Martin Honnen over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Category:
Samples
Start date:
2022-04-15
Due date:
% Done:

100%

Estimated time:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Found in version:
11.3
Fixed in version:
11.4
SaxonC Languages:
SaxonC Platforms:
SaxonC Architecture:

Description

Testing the suggested fix of https://saxonica.plan.io/issues/5455 I compiled and run testValidator.cpp of the SaxonC EE 11.3 release and found that running it gives an error

JET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at 0x00007ff6e3f62cd1
Please, contact the vendor of the application.

Exception 0xC0000005 (EXCEPTION_ACCESS_VIOLATION) at 0x00007ff6e3f62cd1 (C:\Program Files\Saxonica\SaxonC EE 11.3\samples\cppTests\testValidator.exe+0x42cd1)
Failed to read memory at 0x0000000000000000

Based on the output before the core dump the error occurs in testValidator5 when trying to execute cout<<endl<<node->size()<<"Validation Report"<<node->getStringValue()<<endl; on the call to node->getStringValue().

There doesn't seem to be any other use of val->getValidationReport() (which creates that node with XdmNode * node = val->getValidationReport()) so I suspect this method needs to be looked at.


Files

testValidator.cpp (9 KB) testValidator.cpp O'Neil Delpratt, 2022-05-18 09:22

Related issues

Related to SaxonC - Bug #5551: C++ Schema tests need restructuringClosedO'Neil Delpratt2022-05-30

Actions
Actions #1

Updated by Martin Honnen over 2 years ago

I have now tried testValidator on Linux with SaxonC EE 11.3 but it runs through that test and the only following it without any problems, reporting 1Validation ReportCannot validate <Q{.../family}request>: no element declaration available where the Windows version instead crashes after outputting 1Validation Report.

Actions #2

Updated by O'Neil Delpratt over 2 years ago

Thanks for reporting this issue. The failure is due to references to 11.1 in the SaxonCGlue.c for windows.

On line 31 change the following:

"C:\\Program Files\\Saxonica\\SaxonEEC11.1";

To the following:

"C:\\Program Files\\Saxonica\\SaxonEEC11.3";
Actions #3

Updated by O'Neil Delpratt over 2 years ago

  • Status changed from New to In Progress
Actions #4

Updated by O'Neil Delpratt over 2 years ago

  • Assignee changed from O'Neil Delpratt to Norm Tovey-Walsh
Actions #6

Updated by O'Neil Delpratt over 2 years ago

Only in the windows platform do we hard code the version number in the install path. We will provide a better solution to this so this does not happen again.

Actions #10

Updated by Martin Honnen over 2 years ago

I fixed the line in SaxonCGlue.c to reference "C:\\Program Files\\Saxonica\\SaxonEEC11.3";. Strangely, however, even recompiling and rerunning everything doesn't seem to avoid the error I got earlier. Perhaps I am not up to dealing with C/C++ today. Did you successfully run the testValidator.exe on Windows after the fix?

Actions #11

Updated by O'Neil Delpratt over 2 years ago

That is strange because it ran ok on my windows machine.

Actions #12

Updated by Martin Honnen over 2 years ago

Thanks for letting me know, I will try later or tomorrow on a different machine.

Actions #13

Updated by O'Neil Delpratt over 2 years ago

Yesterday I spent some time separating the code cout<<endl<<node->size()<<"Validation Report"<<node->getStringValue()<<endl; and checking for nullptr with node->getStringValue(), but given that I cannot reproduce the error makes it difficult to track

Actions #14

Updated by Martin Honnen over 2 years ago

I have now tried the fix to SaxonCGlue.c on a different system but somehow I continue to get an error in that test case:

C:\Program Files\Saxonica\SaxonC EE 11.3\samples\cppTests>testValidator.exe
Test: SchemaValidator with Saxon version=SaxonC-EE 11.3 from Saxonica


Test Validate Schema from string

Test 2: Validate Schema from string

Test 3: Validate Schema from string

Error: Doc reported as invalid!

Test 4: Validate source file with schema file. i.e. family.xml and family.xsd

Error: Doc reported as valid!

Test 4: Validate source file with schema file. i.e. family.xml and family.xsd to XdmNode

Error: node is NULL

Test 5: Validate Schema from string

1Validation Report
JET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at 0x00007ff637be2cf1
Please, contact the vendor of the application.
Crash dump will be written to "C:\Program Files\Saxonica\SaxonC EE 11.3\samples\cppTests\jet_dump_13504.dmp"
Extra information about error is saved in the "jet_err_13504.txt" file.


JET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at 0x00007ff637be2cf1
Please, contact the vendor of the application.
Crash dump will be written to "C:\Program Files\Saxonica\SaxonC EE 11.3\samples\cppTests\jet_dump_13504.dmp"

Exception 0xC0000005 (EXCEPTION_ACCESS_VIOLATION) at 0x00007ff637be2cf1 (C:\Program Files\Saxonica\SaxonC EE 11.3\samples\cppTests\testValidator.exe+0x42cf1)
Failed to read memory at 0x0000000000000000

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: testValidator.exe

OS:

Windows 10 build 9200

JET-compiled Components:

C:\Program Files\Saxonica\SaxonC EE 11.3\libsaxoneec.dll dll, version info: jet-1530-mp1 (ent, en)

Actions #15

Updated by Norm Tovey-Walsh over 2 years ago

Hi Martin. O'Neil is away on vacation. If this is urgent, please let me know and I'll see what I can do, otherwise, I'm sure O'Neil will reply when he returns. Apologies for the inconvenience.

Actions #16

Updated by Norm Tovey-Walsh over 2 years ago

  • Assignee changed from Norm Tovey-Walsh to O'Neil Delpratt
Actions #18

Updated by Martin Honnen over 2 years ago

This can wait until O'Neil returns from his vacation, at least from my point of view. I don't know whether you want to release 11.4 during his vacation, would be nice in that case to have the issue resolved before that maintenance release.

Actions #21

Updated by Martin Honnen over 2 years ago

What is the status on this? I never managed to run the testValidator.exe without the system exception in testValidator5 on Windows, even after the fix to refer to the right directory C:\\Program Files\\Saxonica\\SaxonEEC11.3 for 11.3.

Actions #22

Updated by O'Neil Delpratt over 2 years ago

For some reason the last time I was unable to reproduce it, but I will look at this issue again today.

Actions #24

Updated by O'Neil Delpratt over 2 years ago

  • Found in version set to 11.3

I have finally managed to get a core dump after Test 5, which is the same as reported. Investigating it further now.

Actions #25

Updated by O'Neil Delpratt over 2 years ago

Update:

I am noticing intermitted failure with test 5. Yes, the crash is happening with getStringValue() but that is because we are not checking for the nullptr in the test case. This suggests memory corruption with one of the earlier tests. I am still tracking it down.

Actions #26

Updated by O'Neil Delpratt over 2 years ago

I have improved the testValidator.cpp with better error handling and replaced the use of getStringValue() with toString() so that we get the serialized XML string. However, testValidator5 still does not run in isolation therefore I think the problem could be with registerSchemaFromString. I will create another bug issue for this.

Actions #28

Updated by Martin Honnen over 2 years ago

O'Neil Delpratt wrote in #note-26:

However, testValidator5 still does not run in isolation therefore I think the problem could be with registerSchemaFromString. I will create another bug issue for this.

Is there a separate issue for the registerSchemaFromString problem?

Actions #29

Updated by O'Neil Delpratt over 2 years ago

Martin Honnen wrote in #note-28:

O'Neil Delpratt wrote in #note-26:

However, testValidator5 still does not run in isolation therefore I think the problem could be with registerSchemaFromString. I will create another bug issue for this.

Is there a separate issue for the registerSchemaFromString problem?

Sorry, no I did not create the bug issue. I will create it now

Actions #30

Updated by O'Neil Delpratt over 2 years ago

  • Related to Bug #5551: C++ Schema tests need restructuring added
Actions #31

Updated by O'Neil Delpratt over 2 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

I have reviewed the testValidator.cpp and the problem is in the tests. We are registering the same schema between the test cases. I have created a new bug issue for this #5551.

We have fixed this bug issue according to comment 3 and 26.

Actions #32

Updated by O'Neil Delpratt over 2 years ago

  • Status changed from Resolved to Closed
  • Fixed in version set to 11.4

Bug fix applied in the SaxonC 11.4 maintenance release.

Please register to edit this issue

Also available in: Atom PDF