Project

Profile

Help

Bug #4779

closed

Bad command line parameters cause internal error and stack trace

Added by Michael Kay about 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
2020-10-04
Due date:
% Done:

100%

Estimated time:
Applies to JS Branch:
2
Fix Committed on JS Branch:
2
Fixed in JS Release:
SEF Generated with:
Platforms:
Company:
-
Contact person:
-
Additional contact persons:
-

Description

Incorrect parameter syntax on the xslt3 command line can trigger an internal error and a stack trace,

Example: a call with

xslt3 -xsl:xx.xsl.sef -s:samples.xml -o:out.xml -t  shigher-order-functions

Generates

Missing '=' in parameter 'shigher-order-functions'
Internal error: bad input to string constructor #undefined
Error
    at Object.$internalError$$ [as internalError] (/Users/mike/GitHub/saxon-js-enterprise/build/temp/js/build/SaxonJS2N.debug.js:886:56)
    at new $XdmString$$module$temp$js$source$src$XdmAtomic$ (/Users/mike/GitHub/saxon-js-enterprise/build/temp/js/build/SaxonJS2N.debug.js:1346:72)
    at Object.fromString (/Users/mike/GitHub/saxon-js-enterprise/build/temp/js/build/SaxonJS2N.debug.js:2043:12)
    at /Users/mike/GitHub/saxon-js-enterprise/build/temp/js/build/xslt3ee.js:46:228
    at Array.forEach (<anonymous>)
....etc


Actions #1

Updated by Michael Kay about 4 years ago

The problem is that the method quit() in command.js doesn't do what it says; I think it once did, but this was changed when we made everything asynchronous.

Actions #2

Updated by Debbie Lockett almost 4 years ago

  • Applies to JS Branch 2 added
Actions #3

Updated by Norm Tovey-Walsh almost 4 years ago

  • Status changed from New to Resolved

Without trying to hard to unwind the parallelism, there were two easy fixes:

  1. Throw an XError instead of an Error for a bad command line option. That makes command.js print only the message, not the stack trace.
  2. After checking the command line arguments in main; if something's gone wrong, return without trying to do any further processing.
Actions #4

Updated by Debbie Lockett over 3 years ago

  • Fix Committed on JS Branch 2 added
Actions #5

Updated by Debbie Lockett over 3 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in JS Release set to Saxon-JS 2.1

Bug fix applied in the Saxon-JS 2.1 maintenance release.

Please register to edit this issue

Also available in: Atom PDF Tracking page