Closed Bug 496813 Opened 16 years ago Closed 16 years ago

"Assertion failure: isInt32(*p)" with simple testcase

Categories

(Core :: JavaScript Engine, defect, P1)

x86
macOS
defect

Tracking

()

RESOLVED FIXED
mozilla1.9.1

People

(Reporter: jruderman, Assigned: dvander)

Details

(Keywords: assertion, fixed1.9.1, testcase)

Attachments

(1 file)

for (var i = 0; i < 4; ++i) { var x = 1; for (var j = 0; j < 3; ++j) { if (j > 1) { x = {}; } } } print(x); Incorrectly gives 2885984 when it should give "[object Object]". If I change the inner loop bound from 3 to 4, I get an assertion instead: Assertion failure: isInt32(*p), at ../jstracer.cpp:2031 This bug affects both TM tip and 1.9.1 branch. The testcase is simple enough that I'd expect web sites to hit it.
Flags: blocking1.9.1?
This is really not fun. I don't understand why none of our tests catches this stuff.
Assignee: general → gal
Priority: -- → P1
Target Milestone: --- → mozilla1.9.1
Flags: blocking1.9.1? → blocking1.9.1+
Reduced testcase: function f() { x = 1; for (var j = 0; j < 3; ++j) { if (j > 1) { x = {}; } } } f(); f(); f(); print(x);
Attached patch fixSplinter Review
Silly bug. Side exit coalescing code wasn't checking that both exits had the same number of global types.
Assignee: gal → dvander
Status: NEW → ASSIGNED
Attachment #382165 - Flags: review?(gal)
Comment on attachment 382165 [details] [diff] [review] fix Possible fix but I think it would be better to extend the destination map if it matches but is too short.
Attachment #382165 - Flags: review?(gal) → review+
Comment on attachment 382165 [details] [diff] [review] fix r+ with the rationale that memcmp without length check is wrong for sure and this is a minimal fix. will discuss further whether this causes duplicate traces which could be avoided by growing an existing trace.
Are we memcmp'ing off the end of an allocation even with the patch? /be
(In reply to comment #6) > Are we memcmp'ing off the end of an allocation even with the patch? > > /be Since stack slots should always match, it should be okay.
Would asserting that be vacuous? Not obviously but maybe I am missing context. /be
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Group: core-security
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: