Closed Bug 1234806 Opened 8 years ago Closed 8 years ago

GenerateSeed fails when /dev/urandom reads are failing.

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1233302
Tracking Status
firefox46 --- affected

People

(Reporter: nbp, Assigned: nbp)

Details

Attachments

(1 file)

Starting & closing a debug build of Firefox every minute can exhaust /dev/urandom and cause the following assertion to be raised.

I suggest we remove this assertion and use the fallback path which is using PRMJ_Now as a weaker source of random.


Program received signal SIGSEGV, Segmentation fault.
0x00007ff5579c90ad in GenerateSeed (seedBuffer=0x7fffe1f41e80, length=2) at /home/nicolas/mozilla/short-dev/js/src/jsmath.cpp:805
805             MOZ_ASSERT(nread == size, "Can't read /dev/urandom?!");
(gdb) bt
#0  0x00007ff5579c90ad in GenerateSeed (seedBuffer=0x7fffe1f41e80, length=2) at /home/nicolas/mozilla/short-dev/js/src/jsmath.cpp:805
#1  0x00007ff5579c9142 in js::GenerateXorShift128PlusSeed (seed=...) at /home/nicolas/mozilla/short-dev/js/src/jsmath.cpp:823
#2  0x00007ff557768ded in js::SavedStacks::init (this=0x220b4b0) at /home/nicolas/mozilla/short-dev/js/src/vm/SavedStacks.cpp:993
#3  0x00007ff5574f16a8 in JSCompartment::init (this=0x220b3e0, maybecx=0x127cb50) at /home/nicolas/mozilla/short-dev/js/src/jscompartment.cpp:142
#4  0x00007ff557551089 in js::NewCompartment (cx=0x127cb50, zone=0x1292290, principals=0x127caf8, options=...) at /home/nicolas/mozilla/short-dev/js/src/jsgc.cpp:6728
#5  0x00007ff5576a646f in js::GlobalObject::new_ (cx=0x127cb50, clasp=0x14fccf8, principals=0x127caf8, hookOption=JS::DontFireOnNewGlobalHook, options=...) at /home/nicolas/mozilla/short-dev/js/src/vm/GlobalObject.cpp:291
#6  0x00007ff5574de1b6 in JS_NewGlobalObject (cx=0x127cb50, clasp=0x14fccf8, principals=0x127caf8, hookOption=JS::DontFireOnNewGlobalHook, options=...) at /home/nicolas/mozilla/short-dev/js/src/jsapi.cpp:1837
#7  0x00007ff55325c2a3 in xpc::CreateGlobalObject (cx=0x127cb50, clasp=0x14fccf8, principal=0x127caf0, aOptions=...) at /home/nicolas/mozilla/short-dev/js/xpconnect/src/nsXPConnect.cpp:359
Comment on attachment 8701433 [details] [diff] [review]
GenerateSeed should not assert before falling back on PRMJ_Now.

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

jimb landed a similar patch in bug 1233302 :)
Attachment #8701433 - Flags: review?(jdemooij)
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: