Closed
Bug 902909
Opened 11 years ago
Closed 11 years ago
Running ASM.js app crashes Firefox
Categories
(Core :: Storage: IndexedDB, defect)
Tracking
()
VERIFIED
FIXED
mozilla28
People
(Reporter: sys.sgx, Assigned: khuey)
References
(Blocks 1 open bug)
Details
(Keywords: crash)
Attachments
(4 files, 2 obsolete files)
(deleted),
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
janv
:
review+
|
Details | Diff | Splinter Review |
(deleted),
image/png
|
Details | |
(deleted),
image/png
|
Details |
User Agent: Mozilla/5.0 (Windows NT 6.0; rv:26.0) Gecko/20100101 Firefox/26.0 (Beta/Release)
Build ID: 20130808030205
Steps to reproduce:
1. Browse to http://www.unrealengine.com/html5/ with version 26a1 trunk build.
2. Wait for resources to load.
3. Check the console (image)
4. When download of data is complete, the browser crashes and has to restart.
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Comment 2•11 years ago
|
||
What do you see in about:crashes for that crash?
Comment 4•11 years ago
|
||
Looks like an out of memory. How much memory is free before the load of the new website? Can use about:memory at that time to get more detail.
I think that's the case too. The new page loads with about 1.5GB of free RAM.
There are two things that should happen:
1. the asm.js code gets loaded through chunks of data in some way.
2. FF realizes the malloc limits and keeps the browser running.
Point number 2 is more important.
Comment 6•11 years ago
|
||
1 is being constantly worked on. Did you try in latest nightly?
2 is hard to do in general, but will improve hugely with e10s which hopefully will happen later this year.
Yes, I'm using the newest version of trunk builds.
Nice to see about the e10s project.
We could also suggest other people to try it on their machines and collect feedback in a structured way. This will measure the overall progress.
Comment 9•11 years ago
|
||
This particular crash has:
"OOM Allocation Size": 154556280
So we tried to allocate a 150MB buffer or so... The problem there is fragmentation: we had 800MB free virtual memory at the time, and nearly a gig of physical memory.
The failing allocation is in AddHelper::DoDatabaseWork in the IDBObjectStore. I suspect it's this:
nsAutoArrayPtr<char> compressed(new char[compressedLength]);
This should presumably be using fallible malloc, since compressedLength is, I suspect, under the control of the website. I'm a little surprised that new[] is using the infallible allocator. :(
ccing some folks who might know about this code.
Flags: needinfo?(khuey)
Flags: needinfo?(jonas)
Flags: needinfo?(bent.mozilla)
Updated•11 years ago
|
Component: JavaScript Engine → DOM: IndexedDB
Comment 10•11 years ago
|
||
Crash due to huge infallible allocation from indexeddb code.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee | ||
Comment 11•11 years ago
|
||
Clearly we should make the allocation fallible, but that's not going to make this app any more functional. Note that we're OOMing attempting to allocate a buffer to hold the compressed data. Snappy appears to expose an in-place compression function. Perhaps we should use that.
Flags: needinfo?(khuey)
Comment 12•11 years ago
|
||
Oh, I'm not worried about the app working. I just don't think it should crash the browser. ;)
Keywords: crash
Summary: Running ASM.js app crushes Firefox → Running ASM.js app crashes Firefox
Reporter | ||
Comment 13•11 years ago
|
||
Boris, if you're on vacation then who's doing the replying? have you setup an autobot? :)) (ehm...)
That's right, a case like this should not crash the browser. If e10s makes it run on a thread then this will probably be fixed, main thread will always be running, but either way there should be a way to monitor this.
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → khuey
Agreed that new[] being infallible is surprising... This should probably be audited.
Flags: needinfo?(bent.mozilla)
Assignee | ||
Comment 15•11 years ago
|
||
Untested, but it should get the job done.
Attachment #788393 -
Flags: review?(jonas)
Attachment #788393 -
Flags: review?(jonas) → review+
Allocate hard or go home!
Flags: needinfo?(jonas)
Assignee | ||
Comment 17•11 years ago
|
||
Attachment #787504 -
Attachment is obsolete: true
Attachment #788393 -
Attachment is obsolete: true
Attachment #788964 -
Flags: review+
Assignee | ||
Updated•11 years ago
|
Flags: in-testsuite-
Keywords: checkin-needed
Comment 18•11 years ago
|
||
Keywords: checkin-needed
Comment 19•11 years ago
|
||
Backed out for OSX (at least) bustage.
https://hg.mozilla.org/integration/mozilla-inbound/rev/4b342c65499e
https://tbpl.mozilla.org/php/getParsedLog.php?id=26441584&tree=Mozilla-Inbound
Comment 20•11 years ago
|
||
(In reply to Ryan VanderMeulen [:RyanVM UTC-4] from comment #19)
> Backed out for OSX (at least) bustage.
And every other platform...
Assignee | ||
Comment 21•11 years ago
|
||
So the problem here is that fallible_t is not defined, because mozalloc.h (and hence fallible.h) are not getting included here.
How does this code end up using infallible allocators if we're not including the right headers?
Flags: needinfo?(mh+mozilla)
Comment 22•11 years ago
|
||
Are you sure it's not simply a namespace issue? dom/indexedDB/IDBObjectStore.cpp doesn't do "using namespace mozilla", so fallible_t alone is unknown. Try mozilla::fallible_t.
Flags: needinfo?(mh+mozilla)
Assignee | ||
Comment 23•11 years ago
|
||
Sure but that doesn't apply to OpenDatabaseHelper.cpp.
Comment 24•11 years ago
|
||
IDBObjectStore.cpp is where the build error happened, in the log.
Assignee | ||
Comment 25•11 years ago
|
||
Comment 26•11 years ago
|
||
So in the end this is both a namespace issue and an API misuse. new (fallible_t()) doesn't work, while new(fallible_t_instance) does. It is however weird that we don't have a global, shared, such instance. Apparently, all places using fallible allocations define their own static const fallible_t fallible = fallible_t(); (which, btw, is already too much, static const fallible_t fallible; should work equally well)
Comment 27•11 years ago
|
||
The clang error is due to http://llvm.org/bugs/show_bug.cgi?id=10428
Assignee | ||
Comment 28•11 years ago
|
||
Comment 29•11 years ago
|
||
Reporter | ||
Comment 30•11 years ago
|
||
Do we have any updates?
Thanks
Assignee | ||
Comment 32•11 years ago
|
||
Jan can you run with this ... I don't want to fiddle with try to get it to compile on gdb/clang.
Flags: needinfo?(Jan.Varga)
So who is driving this now?
Comment 35•11 years ago
|
||
Comment on attachment 832190 [details] [diff] [review]
changes required for building on mac
khuey says r+
I'll land the patches today
Attachment #832190 -
Flags: review+
Comment 36•11 years ago
|
||
Comment 37•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Reporter | ||
Comment 38•11 years ago
|
||
Do we know from which version will this patch take effect?
I just run the app on FF 27 and it produces the same thing.
Status: RESOLVED → REOPENED
Flags: needinfo?(khuey)
Resolution: FIXED → ---
Reporter | ||
Comment 39•11 years ago
|
||
Adding some more info:
The console displays an "error" or compiling the app code (?), then the browser restarts. We should indicate with warning messages about the IndexedDB workings.
Comment 40•11 years ago
|
||
(In reply to sys.sgx from comment #38)
> Do we know from which version will this patch take effect?
Yes we know.
The "Target Milestone" field here is set to "mozilla28", so this was included for Firefox 28 first, and there are no status-* flags set under "tracking flags", so it has not been ported to any older versions than that - judging from all that, this is not fixed in 27 but is fixed in 28.
You can check by trying current beta, which already is 28 - and we'd encourage you to do so and report back if that works, as it would be helpful to know if the fix works.
Flags: needinfo?(khuey)
Assignee | ||
Updated•11 years ago
|
Status: REOPENED → RESOLVED
Closed: 11 years ago → 11 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 41•11 years ago
|
||
OK. I've checked the page with FF 30a1, which I guess incorporates the mentioned patch.
The browser no longer crashes, but the app still does not run as expected.
See the new attached file for the console messages.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Reporter | ||
Comment 42•11 years ago
|
||
Flags: needinfo?(khuey)
Reporter | ||
Comment 43•11 years ago
|
||
UPDATE: the same thing happens when the data are loaded from cache. See attachment 2 [details] [diff] [review] image.
Reporter | ||
Comment 44•11 years ago
|
||
Assignee | ||
Comment 45•11 years ago
|
||
It's not expected to work ... you're still out of memory. This bug is just about the crash. Please file a new bug.
Status: REOPENED → RESOLVED
Closed: 11 years ago → 11 years ago
Flags: needinfo?(khuey)
Resolution: --- → FIXED
Reporter | ||
Comment 46•11 years ago
|
||
Will do, thanks for the work here. :)
Comment 47•11 years ago
|
||
Actually, there's already a bug filed, bug 933398.
Comment 48•11 years ago
|
||
Couldn't reproduce the crash on two Vista x86 machines, only "out of memory" error is presented.
Keeping the verifyme keyword so that it could be verified later on this cycle using crashstats.
Comment 49•11 years ago
|
||
No crashes present in Socorro for [ @mozalloc_abort(char const* const) | mozalloc_handle_oom(unsigned int) | moz_xmalloc | `anonymous namespace''::AddHelper::DoDatabaseWork(mozIStorageConnection*)] signature in the last month: http://goo.gl/WPUxA3 for Firefox 28 builds. Marking as verified based on this result.
Status: RESOLVED → VERIFIED
Keywords: verifyme
You need to log in
before you can comment on or make changes to this bug.
Description
•