Closed Bug 568826 Opened 14 years ago Closed 14 years ago

TM: "Assertion failed: LIR type error (start of writer pipeline): arg 4 of 'calli' is 'ldi' which has type int32 (expected float64): 0 ("

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
critical

Tracking

()

VERIFIED FIXED
Tracking Status
blocking2.0 --- final+
status1.9.2 --- unaffected
status1.9.1 --- unaffected

People

(Reporter: gkw, Assigned: gal)

Details

(Keywords: assertion, regression, testcase, Whiteboard: [sg:critical], fixed-in-tracemonkey [critsmash:patch])

Attachments

(1 file)

NaN = []
for (var a = 0; a < 2; ++a) {
    if (a == 1) {
        for each(e in [NaN, Infinity, NaN]) {}
    }
}

asserts js debug shell on TM tip with -j at Assertion failed: LIR type error (start of writer pipeline): arg 4 of 'calli' is 'ldi' which has type int32 (expected float64): 0 (../nanojit/LIR.cpp:2642)

s-s because this is a LIR type error. Assuming [sg:critical?] unless otherwise noted.
autoBisect shows it is probably related to the following regression window:

http://hg.mozilla.org/tracemonkey/pushloghtml?fromchange=37083&tochange=37ee0e47774d

I have no idea if it involves bug 463137 or bug 521692.
blocking2.0: --- → ?
Extra LIR info from technique in bug 558633 comment #6 :

=== BEGIN Initial LIR ===
  00: start
  01: ebx = parami 0 ebx
  02: esi = parami 1 esi
  03: edi = parami 2 edi
  04: state = parami 0 ecx
  05: label1:
  06: sp = ldi.o state[8]
  07: rp = ldi.o state[24]
  08: cx = ldi.o state[0]
  09: eos = ldi.o state[12]
  10: eor = ldi.o state[28]
  11: ldi4 = ldi.csro cx[0]
  12: immi1 = immi 0
  13: eqi3 = eqi ldi4, immi1/*0*/
  14: xf4: xf eqi3 -> pc=0x40c7df imacpc=0x0 sp+8 rp+0 (GuardID=001)
  15: globalObj = immi 16785408
  16: $global0 = ldd.o eos[1096]
  17: $stack0 = ldi.s sp[0]
  18: ldi3 = ldi.o $stack0[4]
  19: ~JSSLOT_CLASS_MASK_BITS = immi -4
  20: andi4 = andi ldi3, ~JSSLOT_CLASS_MASK_BITS/*-4*/
  21: clasp = immi 2079104
  22: guard(class is Iterator) = eqi andi4, clasp/*2079104*/
  23: xf3: xf guard(class is Iterator) -> pc=0x40c7e0 imacpc=0x0 sp+8 rp+0 (GuardID=002)
  24: ldi1 = ldi.c $stack0[16]
  25: cursor = ldi.o ldi1[4]
  26: next = ldi.o cursor[0]
  27: JSVAL_DOUBLE = immi 2
  28: JSVAL_TAGMASK = immi 7
  29: andi3 = andi next, JSVAL_TAGMASK/*7*/
  30: eqi2 = eqi andi3, JSVAL_DOUBLE/*2*/
  31: JSVAL_INT = immi 1
  32: andi2 = andi next, JSVAL_INT/*1*/
  33: ori1 = ori andi2, eqi2
  34: eqi1 = eqi ori1, immi1/*0*/
  35: xt1: xt eqi1 -> pc=0x40c7e0 imacpc=0x0 sp+8 rp+0 (GuardID=003)
  36: js_UnboxDouble1 = calld. #js_UnboxDouble ( next )
  37: sizeof(jsval) = immi 4
  38: addi1 = addi cursor, sizeof(jsval)/*4*/
  39: sti.o ldi1[4] = addi1
  40: std.o eos[1096] = js_UnboxDouble1
  41: ldi2 = ldi.o $stack0[4]
  42: andi1 = andi ldi2, ~JSSLOT_CLASS_MASK_BITS/*-4*/
  43: guard(class is Iterator) = eqi andi1, clasp/*2079104*/
  44: xf2: xf guard(class is Iterator) -> pc=0x40c7e3 imacpc=0x0 sp+8 rp+0 (GuardID=004)
  45: cursor2 = ldi.o ldi1[4]
  46: end = ldi.o ldi1[8]
  47: lti1 = lti cursor2, end
  48: xf1: xf lti1 -> pc=0x40c7e3 imacpc=0x0 sp+8 rp+0 (GuardID=005)
  49: j -> label1
  50: livei state
  51: x1: x  -> pc=0x40c7df imacpc=0x0 sp+8 rp+0 (GuardID=006)
=== END Initial LIR ===
Comment 3 was tested on 32-bit debug Mac shell.
The lir is very helpful. Thanks gary!
Assignee: general → gal
blocking2.0: ? → final+
Man, nick's improved asserts for call argument types are _really_ helpful here.

Assertion failed: LIR type error (start of writer pipeline): arg 4 of 'calli' is 'ldq' which has type int64 (expected float64): 0 (../nanojit/LIR.cpp:2642)
We fail to ignore writing to a read-only property of the global object (NaN). Old and very bad bug. Affects branches.
Whiteboard: [sg:critical?] → [sg:critical]
Ok, so here is what happens:

We make a NaN property on the global object and assign it []. Since we are assigning, we don't run the resolve hook. This is wrong. We should never be able to make NaN with a different value since its permanent read-only. When we get Infinity shortly thereafter, we run the resolve hook and paint over NaN with the value nan, which is out of sync with the tracker and we die.

A search shows that at least for these global properties we only do this in the shell, not the browser:

http://mxr.mozilla.org/mozilla-central/search?string=JS_ResolveStandardClass&find=&findi=&filter=^[^\0]*%24&hitlimit=&tree=mozilla-central
Attached patch patchSplinter Review
OS: Mac OS X → All
Hardware: x86 → All
Attachment #448139 - Flags: review?(jorendorff)
Attachment #448139 - Flags: review?(jorendorff) → review+
http://hg.mozilla.org/tracemonkey/rev/92a66e7519b7
blocking1.9.1: --- → ?
blocking1.9.2: --- → ?
Whiteboard: [sg:critical] → [sg:critical], fixed-in-tracemonkey
Whiteboard: [sg:critical], fixed-in-tracemonkey → [sg:critical], fixed-in-tracemonkey [critsmash:patch]
blocking1.9.1: ? → .11+
blocking1.9.2: ? → .5+
http://hg.mozilla.org/mozilla-central/rev/92a66e7519b7
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
blocking1.9.2: .5+ → .6+
Any hope for branch patches for this?
This is shell only (neither file is linked into the browser). Don't block on it. Also, shell workers are not in 1.9.2 or 1.9.1.
Ok, thanks!
blocking1.9.1: .11+ → ---
blocking1.9.2: .7+ → ---
Group: core-security
Tracer has been long gone on trunk, marking verified.
Status: RESOLVED → VERIFIED
Automatically extracted testcase for this bug was committed:

https://hg.mozilla.org/mozilla-central/rev/efaf8960a929
Flags: in-testsuite+
> Automatically extracted testcase for this bug was committed:
> 
> https://hg.mozilla.org/mozilla-central/rev/efaf8960a929

That's not much help because this bug was in the trace JIT, which is long dead.
(In reply to Nicholas Nethercote [:njn] from comment #17)

> That's not much help because this bug was in the trace JIT, which is long
> dead.

See bug 567577 comment 20.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: