Project

Profile

Help

Bug #3866

closed

Failures running GitHub JSON test suite

Added by Michael Kay almost 6 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
JSON
Sprint/Milestone:
-
Start date:
2018-08-01
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.8, trunk
Fix Committed on Branch:
9.8, trunk
Fixed in Maintenance Release:
Platforms:

Description

I have incorporated the JSON tests found at http://github.com/nst/JSONTestSuite into the QT3 test suite, and a few of the tests are failing. I'll use this issue tracker as an "umbrella" entry to report progress on fixing these problems.

Actions #1

Updated by Michael Kay almost 6 years ago

Test n_string_single_doublequote crashes with java.lang.StringIndexOutOfBoundsException: String index out of range: 1

The test contains a single-character string, a double quote character.

Solution: in JSONParser.readToken, case '"', test the value of "position" at the start of the loop instead of the end.

Actions #2

Updated by Michael Kay almost 6 years ago

Test n_structure_100000_opening_arrays crashes with a StackOverflowError because arrays are too deeply nested. A JSON parser is allowed to impose limits, but we should try to fail cleanly.

Solution: wrap recursive calls of parseConstruct() in a try/catch that catches StackOverflowError, and produce a "too deeply nested" diagnostic.

Actions #3

Updated by Michael Kay almost 6 years ago

Test -t:n_string_escaped_emoji crashes with "string index out of range". This test contains a backslash followed by a non-BMP character.

The crash actually occurs while reporting the syntax error. "Unknown escape sequence \X" where X is the high surrogate part of the non-BMP character.

The standard error listener tries to avoid putting non-Latin characters in error messages and is attempting to expand the character. It detects the presence of a non-BMP character and attempts to convert the string to a GeneralUnicodeString; this calls StringValue.expand() which trusts the supplied string to be well-formed and crashes because it contains an unpaired surrogate.

Decided to fix this at the point we generate the error message (in JsonParser and JsonReceiver)

Actions #4

Updated by Michael Kay almost 6 years ago

  • Status changed from New to Resolved
  • Fix Committed on Branch 9.8, trunk added
Actions #5

Updated by O'Neil Delpratt over 5 years ago

  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 9.9.0.1 added

Bug fix applied in the Saxon 9.9.0.1 major release.

Leave open until fix applied in the next Saxon 9.8 maintenance release.

Actions #6

Updated by O'Neil Delpratt over 5 years ago

  • Status changed from Resolved to Closed
  • Fixed in Maintenance Release 9.8.0.15 added

Bug fix applied in the Saxon 9.8.0.15 maintenance release.

Actions #7

Updated by Anonymous over 1 year ago

(Spam deleted)

Please register to edit this issue

Also available in: Atom PDF