Closed Bug 1699569 Opened 4 years ago Closed 4 years ago

Assertion failure: linebufArg[linebufLengthArg] == '\0', at /builds/worker/checkouts/gecko/js/src/jsapi.cpp:4999

Categories

(Core :: JavaScript Engine, defect, P3)

defect

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: jgilbert, Assigned: mgaudet)

Details

Attachments

(1 file)

Specifically this is an issue for test-linux1804-64/debug-mochitest-browser-chrome-e10s-4
"Linux 18.04 x64 debug" M(bc4)

Tom, Matt, this bug is quite strange and can be split in 3 parts:

  • Would you know what caused the error when replacing the const by a let?
  • How the second patch removed fixed error?
  • What is the stack of the error creation which caused a failure under initBorrowedLineBuf, and how to fix this issue?
Flags: needinfo?(mgaudet)
Flags: needinfo?(evilpies)

The string allocated by https://searchfox.org/mozilla-central/rev/1758450798ae14492ba28b695f48143840ad6c5b/dom/ipc/ClonedErrorHolder.cpp#232 doesn't seem to be null-terminated. Not sure why we assert that though, when we have a length anyway. I am not an expert on the parser however.

Flags: needinfo?(evilpies)

Doing a touch of archeology, and ended up Bug 1212328, which introduced this assert. Bug 1212328 Comment 14 suggests that this has to do with the use of nsDependentString when consumed here.

The function Tom points out has only one caller, so we can easily fix it and rename it to something along the lines of ToJSStringBufferNullTerminated;

Having said all this, the comments in JSErrorReport aren't super clear about expecting a null terminated string, except insofar as the length field ought not include the null terminator.

Notably as well: This code is all uncovered in code-coverage, which is why we've not seen this before.

https://coverage.moz.tools/#revision=latest&path=dom/ipc/ClonedErrorHolder.cpp&view=file&line=305

Flags: needinfo?(mgaudet)

Setting P3, then setting self-ni? to look at fixing this later.

Severity: -- → S3
Flags: needinfo?(mgaudet)
Priority: -- → P3
Assignee: nobody → mgaudet
Status: NEW → ASSIGNED
Flags: needinfo?(mgaudet)
Pushed by mgaudet@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/30f92429e81b Null terminate copied string under error condition r=evilpie,kmag
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: