Closed
Bug 473282
Opened 16 years ago
Closed 16 years ago
TM: Crash [@ JS_CallTracer]
Categories
(Core :: JavaScript Engine, defect, P1)
Core
JavaScript Engine
Tracking
()
VERIFIED
FIXED
mozilla1.9.1b3
People
(Reporter: gkw, Assigned: brendan)
References
Details
(4 keywords, Whiteboard: [sg:investigate] fixed-in-tracemonkey)
Crash Data
Attachments
(3 files, 1 obsolete file)
this.watch("b", "".substring);
try {
(new Function("this.__defineGetter__(\"a\", gc).__defineGetter__(\" \", function(){})"))();
}
catch(runError){};
for each (b in [this, null, null])({});
a;
crashes (TM-only) opt js shell at JS_CallTracer at null and asserts debug js at Assertion failure: thing, at ../jsgc.cpp:2619
Security-sensitive because this involves gc.
Flags: blocking1.9.1?
Updated•16 years ago
|
Assignee: general → jwalden+bmo
Status: NEW → ASSIGNED
![]() |
Reporter | |
Comment 1•16 years ago
|
||
this.watch("b", "".substring);
try { (new Function("this.__defineGetter__(\"a\", gc)"))(); }
catch(runError){};
for each (b in [this, null, null])({});
a;
Slightly-further reduced testcase, the second defineGetter apparently wasn't needed.
Comment 2•16 years ago
|
||
Even more minimally:
this.watch("b", "".substring);
__defineGetter__("a", gc);
for each (b in [this, null, null]);
a
![]() |
Reporter | |
Comment 3•16 years ago
|
||
Adding [sg:investigate] pending [sg:critical?], thanks Jesse for suggesting this.
Whiteboard: [sg:investigate]
Updated•16 years ago
|
Flags: blocking1.9.1? → blocking1.9.1+
Priority: -- → P1
Comment 4•16 years ago
|
||
I last worked on debugging this several days to a week ago; there seems to have been a mismatch between what was in the slot for the |b| variable and the type assigned to it -- for whatever reason the value in the slot was (jsval(0)), i.e. JSVAL_NULL, but the type assigned to it was JSVAL_STRING. It looks like we're not bailing correctly when setting a property that has a watchpoint, but as I'd been debugging in the trace-execution part of this and not the recording part of this, I don't quite know where the problem is yet.
Comment 5•16 years ago
|
||
I took a guess at the smattering of checks I needed to add beyond the obvious one; let me know if I have too many or perhaps need more.
As for security severity, not clear to me -- we'll copy over a value of possibly any type if we have a watchpoint like this, but I don't know how you could use a value of a different type this way to get started on any exploits. Someone else with more experience in how we do our guarding could say more about this, I'm sure.
Attachment #358319 -
Flags: review?(gal)
Updated•16 years ago
|
OS: Mac OS X → All
Hardware: x86 → All
Comment 6•16 years ago
|
||
Comment on attachment 358319 [details] [diff] [review]
Don't trace through watches
What happens when we add a watchpoint after code was compiled? Does updating the getter/setter change the shape and we trip that guard?
Assignee | ||
Comment 7•16 years ago
|
||
The bug was in the patch for bug 465443 -- my fault for not catching it on review. TraceRecorder::test_property_cache should not duplicate (mostly, with an added js_watch_set check) the code in TraceRecorder::test_property_cache_direct_slot to work around the bug over in js_FillPropertyCache.
Sanity check:
$ grep JOF_INCDEC js{interp,tracer}.cpp | grep JOF_FOR
jsinterp.cpp: if (!(cs->format & (JOF_SET | JOF_INCDEC | JOF_FOR)) &&
jstracer.cpp: uint32 setflags = (js_CodeSpec[*cx->fp->regs->pc].format & (JOF_SET | JOF_INCDEC | JOF_FOR));
jstracer.cpp: uint32 setflags = (js_CodeSpec[*cx->fp->regs->pc].format & (JOF_SET | JOF_INCDEC | JOF_FOR));
jstracer.cpp: uint32 setflags = (cs.format & (JOF_SET | JOF_INCDEC | JOF_FOR));
/be
Assignee: jwalden+bmo → brendan
Attachment #358319 -
Attachment is obsolete: true
Attachment #358337 -
Flags: review?(jwalden+bmo)
Attachment #358319 -
Flags: review?(gal)
Assignee | ||
Updated•16 years ago
|
Target Milestone: --- → mozilla1.9.1b3
Assignee | ||
Comment 8•16 years ago
|
||
The test in bug 465443 comment 0 passes with the patch.
/be
Assignee: brendan → jwalden+bmo
Target Milestone: mozilla1.9.1b3 → ---
Assignee | ||
Comment 9•16 years ago
|
||
Waldo, hope you don't mind if I steal.
/be
Assignee: jwalden+bmo → brendan
Target Milestone: --- → mozilla1.9.1b3
Updated•16 years ago
|
Attachment #358337 -
Flags: review?(jwalden+bmo) → review+
Comment 10•16 years ago
|
||
Comment on attachment 358337 [details] [diff] [review]
fix
Looks good to me; no worries about stealing, you know this much better than I do at this point. :-)
I don't know how much C++isms we're going to tolerate in the long term, but I think it could be worth adding some inline non-virtual methods to JSCodeSpec to centralize these bit-checking definitions. Separate bug, of course, if this sounds like a good idea.
Assignee | ||
Comment 11•16 years ago
|
||
Fixed in tm:
http://hg.mozilla.org/tracemonkey/rev/45bb6c3a3be1
A cleanup bug on JSCodeSpec is overdue but I'm gonna forget to file it in a minute, and no time before then to do the deed (freeze coming up fast!). Little help?
/be
Whiteboard: [sg:investigate] → [sg:investigate] fixed-in-tracemonkey
Comment 12•16 years ago
|
||
Comment 13•16 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Updated•16 years ago
|
Whiteboard: [sg:investigate] fixed-in-tracemonkey → [sg:investigate] fixed-in-tracemonkey, [needs 191 landing]
Comment 14•16 years ago
|
||
Keywords: fixed1.9.1
Whiteboard: [sg:investigate] fixed-in-tracemonkey, [needs 191 landing] → [sg:investigate] fixed-in-tracemonkey
Comment 15•16 years ago
|
||
Updated•16 years ago
|
Flags: in-testsuite+
Flags: in-litmus-
Comment 16•16 years ago
|
||
v 1.9.1, 1.9.2
Status: RESOLVED → VERIFIED
Keywords: fixed1.9.1 → verified1.9.1
Updated•15 years ago
|
Group: core-security
Flags: wanted1.9.0.x-
Comment 17•15 years ago
|
||
test checked into 1.9.0, 1.9.1, 1.9.2, tracemonkey. 1.9.3 will get picked up in the next merge.
Updated•14 years ago
|
Crash Signature: [@ JS_CallTracer]
You need to log in
before you can comment on or make changes to this bug.
Description
•