Closed Bug 415080 Opened 17 years ago Closed 14 years ago

Verifier's removal of NULL type causes later verification failure

Categories

(Tamarin Graveyard :: Virtual Machine, defect, P2)

x86
All
defect

Tracking

(Not tracked)

VERIFIED FIXED
Future

People

(Reporter: brbaker, Assigned: jodyer)

References

Details

(Whiteboard: verifier-cleanup)

Attachments

(1 file)

! this was found in Beta 3. I did not check beta 2.

A function which contains the following structure will cause : 
VerifyError: Error #1068: String and String cannot be reconciled.

I removed variables from the code to get the simplest possible function to cause this error.

    private function _badFunction(a : String = 'b') : Boolean {
        switch (true) {
            case true :
                a.indexOf('e');
                if(true == true) {
                    return true;
                } 
        }
        return false;
    }
 
 Actual Results:
 VerifyError: Error #1068: String and String cannot be reconciled.
 
 Expected Results:
 no error
 
 Workaround (if any):
Dont put a return inside an if, after an indexOf inside a switch in a function which takes a string as an argument.
 
 
Transferred Comments:

Richard Butler - Tue Jan 29 07:06:55 CST 2008
I have a similar error myself: "VerifyError: Error #1068: Boolean and ArrayCollection cannot be reconciled."

public function filter(item:Article):Boolean
{
	var found:Boolean = true;
			
	switch (false)
	{
		//case (keywords && filterByKeywords(item)):
		case (tags && filterByTags(item)):
		{
			found = false;
			break;
		}
	}
			
	return found;
}

"tags" is an ArrayCollection and the "filterByTags" function returns a Boolean. It seems that Flash Player is trying to compare the "false" in the switch with the ArrayCollection itself, rather than the expression: (tags && filterByTags(item)), which will resolve to a Boolean.

Brent Baker - Thu Jan 31 09:42:38 CST 2008
Confirmed the issue, and it is with the vm not the compiler. 

tamarin-central throws a verifier error running the generated abc but tamarin-tracing does not, and runs the code properly.

Need to transfer to bugzilla
Summary: Verify error with valid function. → TC: Verify error with valid function.
Priority: -- → P1
Summary: TC: Verify error with valid function. → Verify error with valid function.
Target Milestone: --- → flash10
Priority: P1 → P2
Target Milestone: flash10 → Future
Assignee: nobody → jodyer
another example: uncomment the call to ForIn_7() in test/acceptance/as3/Statements/for-each-in/eforin_001.as, and you'll get a Number/* type merge error, presumably because of the continue in the for-each-in loop.  (code after the continue is dead, but probably is verified).
ASC bug?  Back to Jeff for triage.
Priority: P2 → --
Target Milestone: Future → ---
This bug occurs because the verifier changes the type of local from String? to String along a path in which it proves it can't be null. ASC could insert a case to String?, but that is just arm wrestling with the verifier. An alternative fix is for the verifier to not make such an eager downcast unless it can prove that it can do so along all parallel paths.

A fix which removes the transition from String? to String is safe because it results in more programs (including the test case) being accepted. But, it will also gives back some speed that probably should not have been taken in the first place. There is little ASC can do to help with that optimization since there is not ABC name for String!.
Blocks: 413522
Summary: Verify error with valid function. → Verifier's removal of NULL type causes later verification failure
VerifyErrors are observable.
Flags: flashplayer-needsversioning+
Target Milestone: --- → Future
The JIT is what changes String? to String, and when verifying without the jit attached, the variable remains String? and there is no verify error.  

The insidious thing here is that any change to the way the jit does value numbering will potentially subtly change this behavior.
No longer blocks: 413522
Depends on: 413522
Flags: flashplayer-qrb+
Priority: -- → P2
Whiteboard: verifier-cleanup
fixed by 413522
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Verified Fixed tamarin-redux r4008
Status: RESOLVED → VERIFIED
Attachment #436702 - Flags: review?(brbaker)
Attachment #436702 - Flags: review?(brbaker) → review+
Flags: in-testsuite?
testcase patch pushed:
tr-argo -> 3921:ecbf85d7764b
tr -> 4288:ecbf85d7764b
Flags: in-testsuite? → in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: