Closed
Bug 375976
Opened 18 years ago
Closed 18 years ago
"Assertion failure: *flagp != GCF_FINAL" with post-increment
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: jruderman, Assigned: mrbkap)
Details
(5 keywords, Whiteboard: [sg:critical?])
Attachments
(2 files)
1.81 KB,
patch
|
crowderbt
:
review+
brendan
:
review+
dveditz
:
approval1.8.1.5+
dveditz
:
approval1.8.0.13+
|
Details | Diff | Splinter Review |
2.40 KB,
text/plain
|
Details |
To reproduce: paste this into jsshell
this.__defineSetter__('x', gc);
this.__defineGetter__('x', Math.sin);
x = x++;
Debug:
Assertion failure: *flagp != GCF_FINAL, at jsgc.c:2499
Opt:
Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x00023011
Thread 0 Crashed:
0 js 0x00023011 js_EmitTree + 11342
1 js 0x0002de89 js_MarkStackFrame + 325
2 js 0x0002e3eb js_GC + 816
3 js 0x000058c9 JS_GC + 66
4 js 0x0000279e GC + 34
5 js 0x0003bb73 js_Invoke + 1843
6 js 0x0003bfac js_InternalInvoke + 181
7 js 0x0003c136 js_InternalGetOrSet + 261
8 js 0x00041765 js_NativeSet + 165
9 js 0x00045b61 js_SetProperty + 1084
10 js 0x00031dfc js_Interpret + 6390
11 js 0x0003b37a js_Execute + 513
12 js 0x000079c3 JS_ExecuteScript + 56
13 js 0x00002095 Process + 1105
14 js 0x00004df9 main + 2270
15 js 0x00001c26 _start + 216
16 js 0x00001b4d start + 41
Reporter | ||
Updated•18 years ago
|
Whiteboard: [sg:critical?]
Assignee | ||
Comment 1•18 years ago
|
||
So, the post-increment code goes through some effort to root rtmp (the old value) but no attempt to root rval, which is the new value. So, I think that we call OBJ_SET_PROPERTY with an unrooted rval, which gets collected. I'm not really sure what the cleanest way to fix this is.
We could make JSOP_INC* take another stack slot and push rval too, or is there a cleaner way?
Comment 2•18 years ago
|
||
Is there a way to swap rval into the root protecting rtmp, once rtmp is protected by something else? If not, more stack.
/be
Assignee | ||
Comment 4•18 years ago
|
||
My initial diagnosis was not correct. The parameter to OBJ_SET_PROPERTY is, in fact, safe from GC (first, because it's a parameter to the setter, then because it's stored in a GC-safe object). The problem is actually that the old value needs to be protected across the OBJ_SET_PROPERTY, not just across the js_NewNumberValue.
Assignee | ||
Updated•18 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 5•18 years ago
|
||
With this patch, the testcase runs cleanly for me, since rtmp is now protected over both the js_NewNumberValue and the OBJ_SET_PROPERTY.
Attachment #265554 -
Flags: review?(crowder)
Attachment #265554 -
Flags: review?(brendan)
Updated•18 years ago
|
Attachment #265554 -
Flags: review?(crowder) → review+
Assignee | ||
Comment 6•18 years ago
|
||
Fix checked into trunk.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Comment 7•18 years ago
|
||
Comment on attachment 265554 [details] [diff] [review]
Proposed fix
Whew -- I *thought* we did not need another root -- a relief to know that's true still.
/be
Attachment #265554 -
Flags: review?(brendan) → review+
Comment 8•18 years ago
|
||
Updated•18 years ago
|
Flags: in-testsuite+
Comment 9•18 years ago
|
||
This affects the 1.8.0 and 1.8 branches, too.
Flags: wanted1.8.1.x+
Flags: wanted1.8.0.x+
Flags: blocking1.8.1.5?
Flags: blocking1.8.0.13?
Updated•18 years ago
|
Flags: blocking1.8.1.5?
Flags: blocking1.8.1.5+
Flags: blocking1.8.0.13?
Flags: blocking1.8.0.13+
Assignee | ||
Comment 10•18 years ago
|
||
Comment on attachment 265554 [details] [diff] [review]
Proposed fix
This applies to the 1.8 and 1.8.0 branches as is.
Attachment #265554 -
Flags: approval1.8.1.5?
Attachment #265554 -
Flags: approval1.8.0.13?
Comment 11•18 years ago
|
||
Comment on attachment 265554 [details] [diff] [review]
Proposed fix
approved for 1.8.1.5 and 1.8.0.13, a=dveditz
Attachment #265554 -
Flags: approval1.8.1.5?
Attachment #265554 -
Flags: approval1.8.1.5+
Attachment #265554 -
Flags: approval1.8.0.13?
Attachment #265554 -
Flags: approval1.8.0.13+
Comment 13•18 years ago
|
||
verified fixed 1.8.1, 1.9.0 windows/linux/macppc opt/debug browser/shell 7/16
Status: RESOLVED → VERIFIED
Keywords: fixed1.8.1.5 → verified1.8.1.5
Updated•18 years ago
|
Group: security
Comment 14•17 years ago
|
||
/cvsroot/mozilla/js/tests/js1_5/GetSet/regress-375976.js,v <-- regress-375976.js
initial revision: 1.1
You need to log in
before you can comment on or make changes to this bug.
Description
•