Closed Bug 437716 Opened 16 years ago Closed 16 years ago

Errors are not getting caught in try/catch with two catch statements

Categories

(Tamarin Graveyard :: Virtual Machine, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED WORKSFORME

People

(Reporter: cpeyer, Assigned: tierney)

Details

transferred from player bugbase: #227458

try 
{
s = list.shift();
if (s.indexOf("mx_internal:") == 0)
s = new QName(mx_internal, s.substring(12));
if (s is String && s.indexOf("getChildAt(") == 0)
{
s = s.substring(11);
s = s.substring(0, s.indexOf(")"));
obj = obj.getChildAt(parseInt(s));
}
else if (s is String && s == "getTextField()")
{
obj = obj[getTextField]();
}
else
obj = obj[s]; //error happens here
}
catch (se:SecurityError)
{
trace("security error");
}
catch (e:Error) 
{
return null;
} 

The error should get caught in the second catch block, but, it isn't. In player 9, the error is caught.

Expected Results: Error should get caught by try/catch block.

Workaround:

Transferred Comments:
[tan 5/21/08] Entered Bug.
[tan 5/21/08] This error came from our Flex test framework that included this kind of try/catch block. 
[tan 5/21/08] I reproduced this with player 10 version 486
[johnchen 5/21/08] UTR on 487 debugger plugin. emailing Tan for more details
[johnchen 5/21/08] error thrown in standalone player:
SecurityError: Error #2148: SWF file file:////flashqa/bugfiles/227000%2D227999/227400%2D227499/227458/Menu%5FBasic.swf cannot access local resource file:///c|/tmp/ExcludeList.txt. Only local-with-filesystem and trusted local SWF files may access local resources.
at flash.net::URLStream/load()
at flash.net::URLLoader/load()
at ExcludeFileLocation$/loadTryNormal()[C:\depot\flex\qa\frameworks\mustella\ExcludeFileLocation.as:99]
at ExcludeFileLocation$/errorHandler()[C:\depot\flex\qa\frameworks\mustella\ExcludeFileLocation.as:75]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/redirectEvent()

Sandbox error, NAB. sandbox violation also repro with FP 9. NAB, closing
[johnchen 5/21/08] Joan Lafferty has updated the media~ behavior is indeed different from 9r124 and 10.487 debugger release standalone players. A runtime error occurs with FP 10: TypeError: Error #1034: Type Coercion failed: cannot convert -1 to Error.
[cmckeon 5/23/08] looks like a dupe of 186788
[johnchen 5/23/08] closing dup
[tan 5/24/08] Hey Colm, Alex Harui tells me that this is not a dupe of 186788. In our code, no events are involved. Our code looks something like this:

try {
...
} 
catch(se:SecurityError)
{
...
}
catch(e:Error)
{
...}

If the error is a SecurityError, the error is caught. If it isn't, it is not caught by the second catch.
[aharui 5/24/08] Furthermore, the same SWF works fine on player9, so this is some sort of FP10 injection
[johnchen 5/27/08] to qrb. tan or aharui , can you create a fla with minimal code to reproduce this so we can add this test case to the our ATS. Thanks.
[lthomaso 5/28/08] qrb opening
[ecostell 6/2/08] Set owner to Chris. Chris, can you send this to JIRA/AVM - attn. Eric T?
Assignee: nobody → tierney
This is fixed in the latest build of the player 10d529.  Closing out bug.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → WORKSFORME
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.