Assertion failure: !mArena || arena == mArena, at memory/build/mozjemalloc.cpp:3960
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr60 | --- | unaffected |
firefox66 | --- | unaffected |
firefox67 | --- | unaffected |
firefox68 | + | fixed |
People
(Reporter: gkw, Assigned: cmartin)
References
(Regression)
Details
(5 keywords, Whiteboard: [jsbugmon:][post-critsmash-triage])
Attachments
(1 file)
The following testcase crashes on mozilla-central revision c7a9affeb604 (build with PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig 'CC="clang -m32 -msse2 -mfpmath=sse"' AR=ar 'CXX="clang++ -m32 -msse2 -mfpmath=sse"' sh ./configure --target=i686-pc-linux --enable-debug --enable-more-deterministic --with-ccache --enable-gczeal --enable-debug-symbols --disable-tests --disable-cranelift, run with --fuzzing-safe --no-threads --no-baseline --no-ion):
try {
s0 = 'x';
for (let i = 0; i < 35; i++)
s0 += s0;
} catch (e) {}
(
function()
{
mathy4 = (
function(y)
{
Math.fround
x
mathy2
(
(
Math.max
)
)
| 0
===
y
>>> 0
(
2
** 53
)
x | 0
;
}
)
mathy4, []
}
)
()
uneval(this);
No backtrace is available.
Setting s-s as a start as this seems to be involving the memory allocator.
![]() |
Reporter | |
Comment 1•6 years ago
|
||
autobisectjs shows this is probably related to the following changeset:
The first bad revision is:
changeset: https://hg.mozilla.org/mozilla-central/rev/e51a022e039f
user: Chris Martin
date: Wed Apr 24 13:57:07 2019 +0000
summary: Bug 1052579 - Change all found JSString allocation sites to new arena r=sfink
Chris, is bug 1052579 a likely regressor?
![]() |
Reporter | |
Comment 2•6 years ago
|
||
This testcase is slightly intermittent and seems to be even more intermittent as one further reduces it.
Assignee | ||
Comment 3•6 years ago
|
||
Hi Gary,
Yes, that commit is almost-certainly the cause of the regression. I relied on testing to try to find all the code spots that needed to be changed, and it looks like there must've been some codepaths that were not hit by my testing.
I will investigate this immediately.
Assignee | ||
Updated•6 years ago
|
Comment 4•6 years ago
|
||
Comment 5•6 years ago
•
|
||
Assignee | ||
Comment 6•6 years ago
|
||
Thanks! I think I can understand the issue well-enough just from that stack trace. Looks like the OOM handler is re-allocating memory without considering the arena of the memory it's reallocing, and so mozjemalloc is throwing an assertion.
I should be able to patch this up fairly quickly.
Assignee | ||
Comment 7•6 years ago
|
||
Bug 1052579 introduced a new mozjemalloc arena for JSString char buffers.
Unfortunately, my testing missed the case where JSStringBuilder causes an OOM
condition, causing the OOM handler to realloc to the default arena, regardless
of what arena is actually indicated by the AllocPolicy for the char vector.
The realloc now passes the arena from the AllocPolicy to mozjemalloc.
![]() |
Reporter | |
Comment 8•6 years ago
|
||
Comment 10•6 years ago
|
||
https://hg.mozilla.org/integration/autoland/rev/b08155896113
Can we land an automated test for this?
![]() |
||
Comment 11•6 years ago
|
||
Comment 13•6 years ago
|
||
(In reply to Ryan VanderMeulen [:RyanVM] from comment #10)
Can we land an automated test for this?
Updated•6 years ago
|
Comment 14•6 years ago
|
||
Guess not.
Description
•