Closed Bug 969309 Opened 10 years ago Closed 9 years ago

Assertion failure: masm.currentOffset() - lastOsiPointOffset_ >= Assembler::patchWrite_NearCallSize(), at jit/shared/CodeGenerator-shared.cpp:423

Categories

(Core :: JavaScript Engine, defect)

ARM
Linux
defect
Not set
major

Tracking

()

RESOLVED FIXED
mozilla42
Tracking Status
firefox30 --- wontfix
firefox42 --- fixed
b2g-master --- fixed

People

(Reporter: decoder, Assigned: sstangl)

References

Details

(4 keywords, Whiteboard: [jsbugmon:][post-critsmash-triage][adv-main42+])

Attachments

(2 files)

Attached file Testcase for shell
The attached testcase asserts on mozilla-central revision f550b112a19b (x86 ARM simulator build, run with --fuzzing-safe --ion-eager).
Douglas or Marty, can one of you take this?
Flags: needinfo?(mrosenberg)
fwiw this does not reproduce on my local development build which has some pending fixes.

This assertion is not compiled when the assembler buffer patch, bug 760642, is applied so might be addressed there.  I am look over this code so will keep it in mind.
This assertion is here to prevent random code execution to prevent patching the call instructions with the invalidation code.

patchWrite_NearCallSize() returns the size needed for making 2 consecutive calls in the generated code, such as the backward patching on a call does not affect the previous instruction execution, and leave enough space for the OSR jump.

If this assert raised, this means that the previous instruction is closer than expected. (less than 4 bytes on ARM).
right.  "less than 4 bytes", that is basically impossible.  Also the fact that this only reproduces a handful of times in 100 runs (I have yet to actually reproduce it) makes me believe that the assertion is just indicating that something else has gone wrong.
Flags: needinfo?(mrosenberg)
This seems pretty bogus.  When we run out of memory, we stop adding instructions to the assembly buffer.  So, when people query the assembly buffer for how much stuff is in it, it keeps giving the same answer, which then makes this check a bit sad.  For the most part we're doing the right thing with this OOM, but the post-oom world isn't as sane as assertions want it to be.  I can paper over this by just not asserting if the buffer believes it has run out of memory, or I can try something else.  We can probably also safely ignore this.
Flags: needinfo?(jdemooij)
> We can probably also safely ignore this.

You're saying this is not a security bug and we should WONTFIX it?
Blocks: 959597
No longer blocks: IonFuzz
Assignee: general → nobody
ni Marty for comment 6.
Flags: needinfo?(mrosenberg)
Yeah, that is my opinion.  If someone thinks this warrants papering over, I can do that, but it looks incredibly tame and unlucky.
Flags: needinfo?(mrosenberg)
(In reply to Marty Rosenberg [:mjrosenb] from comment #8)
> Yeah, that is my opinion.  If someone thinks this warrants papering over, I
> can do that, but it looks incredibly tame and unlucky.

I think it'd be good to do that (only assert if non-OOM), to make it easier for the fuzzers to find real, non-OOM problems.
Flags: needinfo?(jdemooij) → needinfo?(mrosenberg)
Whiteboard: [jsbugmon:update,bisect]
Whiteboard: [jsbugmon:update,bisect] → [jsbugmon:bisect]
JSBugMon: Cannot process bug: Error: Failed to compile specified revision f550b112a19b (maybe try another?)
Whiteboard: [jsbugmon:bisect] → [jsbugmon:]
JSBugMon: Bisection requested, failed due to error: Error: Failed to compile specified revision f550b112a19b (maybe try another?)
Testcase hasn't reproduced for a year, but might as well, since the error still theoretically exists.
Flags: needinfo?(marty.rosenberg)
Attachment #8627917 - Flags: review?(hv1989)
Assignee: nobody → sstangl
Comment on attachment 8627917 [details] [diff] [review]
0001-Bug-969309-Avoid-write-patch-check-on-OOM.-r.patch

Review of attachment 8627917 [details] [diff] [review]:
-----------------------------------------------------------------

Indeed good to not assert for known invalid state!
Attachment #8627917 - Flags: review?(hv1989) → review+
Apparently I landed this last week, but the auto-comment bot doesn't function on s-s bugs.

https://hg.mozilla.org/mozilla-central/rev/63e4d75cc007
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
Group: core-security → core-security-release
Whiteboard: [jsbugmon:] → [jsbugmon:][post-critsmash-triage]
Whiteboard: [jsbugmon:][post-critsmash-triage] → [jsbugmon:][post-critsmash-triage][adv-main42+]
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: