Closed Bug 433950 Opened 17 years ago Closed 13 years ago

Verification error (Stack Overflow) due to VM calling method on null reference; ASC?

Categories

(Tamarin Graveyard :: Virtual Machine, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID
Future

People

(Reporter: cpeyer, Assigned: jodyer)

Details

Attachments

(3 files)

Unfortunately, I haven't been able to narrow this bug down to a VM only case. Here's the report from Jeff Mott: The attached FLA generates the errors below in test movie. The exception dialog in the standalone player just gives the final stack overflow error. The VM seems to be confused by the code, and is trying to call a method on a null reference. Tweaking the code in any of several ways allows the VM to figure out that the reference is null, at which point it throws a null error instead of a stack overflow. Here’s the code: import flash.text.engine.* var normalFD:FontDescription = new FontDescription("Arial","normal") var normalEF:ElementFormat = new ElementFormat(normalFD, 16) var te1:TextElement = new TextElement ("Hello World", normalEF); var group1:Vector.<ContentElement> = new Vector.<ContentElement>() group1.push(te1) var ge1:GroupElement = new GroupElement(group1) var tb1:TextBlock = new TextBlock(ge1) var line:TextLine = tb1.createTextLine(); line.y = 50; line.x = 50; addChild(line); checkMetrics(line); function checkMetrics(line:TextLine) { var tb:TextBlock = line.textBlock; // If we use tb1 directly here, no stack overflow var ce:ContentElement = tb.content ; var ef:ElementFormat = ce.elementFormat; // ef is null. But inside this function the vm tries to call getFontMetrics anyway. // Duplicating this code outside this function we get a null exception. If we examine ef in any way // with an if test or even a trace, the VM realizes it is null and we get a null exception. //trace (ef) var metrics = ef.getFontMetrics(); }
Attached file Stack overflow error.
Target Milestone: --- → flash10
Priority: -- → P1
Target Milestone: flash10 → Future
Flags: in-testsuite?
Flags: flashplayer-triage+
Flags: flashplayer-qrb?
Blocks: 478870
Blocks: 481413
No longer blocks: 478870
Target Milestone: Future → flash10.x
No longer blocks: 481413
Flags: flashplayer-qrb? → flashplayer-qrb+
Assignee: nobody → rreitmai
The error is a verification error, not a run-time error, and is in the current flashruntime-redux as well (tested standalone-debug-debugger). Stepping through it we find that max_stack is 1, so the DUP instruction fails. Looks like an ASC bug (though it could, at a stretch, be a verifier bug - computing the wrong value for max_stack). To Jeff for triage.
Assignee: rreitmai → jodyer
Priority: P1 → --
Summary: Stack Overflow due to VM calling method on null reference. → Verification error (Stack Overflow) due to VM calling method on null reference; ASC?
Target Milestone: flash10.1 → ---
Status: NEW → ASSIGNED
Target Milestone: --- → Future
This bug is caused by the optimizer turned on by the -optimize switch. It is replacing a setlocal/getlocal pair with a dup without checking the max stack to make sure there is room for the extra operand. The bug is real, but I'm not familiar enough with the optimizer to know the risk involved in attempting a fix. I would think fairly low, but then with Falcon, the optimizers life expectancy may be short. Reassigning to Default for review.
Assignee: jodyer → nobody
Jeff, please file an ASC bug and cross-reference that bug here, then close this bug.
Assignee: nobody → jodyer
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: