Open
Bug 464350
Opened 16 years ago
Updated 6 months ago
Firefox hangs in json.cpp:write_string when given a moderately-sized sessionstore.js file
Categories
(Firefox :: Session Restore, defect)
Tracking
()
NEW
People
(Reporter: dholbert, Unassigned)
References
Details
(Keywords: hang, perf)
Attachments
(2 files)
While testing crashes from bug 460924, I managed to pretty quickly generate a large-ish "sessionstore.js" file in my profile which basically hangs Firefox at startup.
STEPS TO REPRODUCE:
1. Download attached sessionstore.js file, and put it in a new folder "myProfile" (or, put it in an existing profile)
2. Run "./dist/bin/firefox -profile myProfile -no-remote"
(using a debug build of Firefox)
ACTUAL RESULTS:
Firefox hangs, not showing a window. It spends all of its time in a call to "json.cpp:write_string" with...
buf = the contents of sessionstore.js
len = the number of characters in sessionstore.js (375942 in this case)
( Link to code: http://tinyurl.com/5ks99c )
I'm not sure how long it hangs -- I just gave it 6 minutes, and it still wasn't done loading.
I'm testing using a debug mozilla-central build, updated this morning. (at revision db2dd52d47c1) I have "ac_add_options --with-valgrind" enabled, if that matters.
Reporter | ||
Updated•16 years ago
|
Summary: Firefox hangs in json.cpp:write_string when given a moderately-sized "sessionstore.js" → Firefox hangs in json.cpp:write_string when given a moderately-sized sessionstore.js file
Reporter | ||
Comment 1•16 years ago
|
||
Here's a backtrace during the hang.
The function "write_string", where we spend all our time, is at level 9.
AFAICT, we end up making a call to JS_ConcatStrings > JS_realloc > ... > arena_malloc_large for *each character in the string*. I think that's what ends up taking so much time.
Updated•16 years ago
|
Assignee: nobody → sayrer
Reporter | ||
Comment 2•16 years ago
|
||
(In reply to comment #1)
> AFAICT, we end up making a call to JS_ConcatStrings > JS_realloc > ... >
> arena_malloc_large for *each character in the string*
sayrer corrected me in IRC -- we're doing that work for each *backslash* in the string, not each character. But since this sessionstore.js file is almost entirely backslashes[1], that still leaves us with a lot of work.
[1] probably due to overzealous (and/or recursive) escaping in session store code.
Comment 3•16 years ago
|
||
going to switch to a buffer here instead of JSStrings, should fix the JSON half of this bug.
Updated•16 years ago
|
Blocks: backslashplosion
Comment 4•14 years ago
|
||
Is there a bug filed for the non-JASON half of the issue?
With people getting ever larger sessionstore.js, this would be really nice to have.
Keywords: perf
OS: Linux → All
Updated•5 years ago
|
Assignee: sayrer → nobody
Updated•2 years ago
|
Severity: normal → S3
Updated•6 months ago
|
Component: General → Session Restore
Product: Core → Firefox
You need to log in
before you can comment on or make changes to this bug.
Description
•