[SERVER-30876] Javascript line numbers inaccurate on windows if file uses multi-line template literal Created: 29/Aug/17  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: JavaScript, Shell
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Charlie Swanson Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Query Execution
Operating System: ALL
Participants:
Linked BF Score: 0

 Description   

See this stack trace generated in a test failure:

doassert@src/mongo/shell/assert.js:18:14
assert.lt@src/mongo/shell/assert.js:444:5
assertEventWakesCursor@jstests\aggregation\sources\changeStream\only_wake_getmore_for_relevant_changes.js:109:9
@jstests\aggregation\sources\changeStream\only_wake_getmore_for_relevant_changes.js:130:29
@jstests\aggregation\sources\changeStream\only_wake_getmore_for_relevant_changes.js:3:2

Here's only_wake_getmore_for_relevant_changes.js at the git version of this failure - you can see that line 109 is not within the function assertEventWakesCursor, nor is there a call to assert.lt on line 109. However, if you subtract 11 lines, which is the length of the template string literal starting on line 29, that leads you to line 98 - an assert.lt within the assertEventWakesCursor helper.

The stack traces have correct line numbers locally on linux and mac, and the only other test I could find with a multi-line template literal was ssl_with_system_ca.js, which doesn't seem to have ever failed on windows.


Generated at Thu Feb 08 04:25:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.