开发者

debugging EXC_BAD_ACCESS in flash/iphone app

I'm using the iPhone packager that's part of Air 2.7 (adt -package ipa-ad-hoc ...) for a fairly large application. (It takes about ~30 min to run the packager.)

When the app runs on the iPhone, it will crash almost immediately-- long before it gets to my code. The cra开发者_Go百科sh log shows

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0xc0067bdb

The debugging facilities included with Flash Builder only work after the app has launched-- there doesn't seem to be anything to help me figure out why its not launching.

I've been able to get toy 'hello world' apps working, but I'm stymied here. Anyone else run into this problem? And, if so, what did you do to diagnose it?


Unfortunately, there doesn't seem to be any way to debug this, since its a problem with the packaging code that surrounds my code. :(

I ended up having to track this down the hard way by 'binary searching' my code-- that is, commenting out half of it, build, see if it crashes, if not comment out the other half, etc.

It took a while, but I narrowed it down to a single line of code. This code never gets a chance to run-- just the * presence* of this line causes the iOS app to crash on startup. Here it is reduced to its essence:

public class Foo extends EventDispatcher {
    public override function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void {
        var thisFunc:Function= arguments.callee;
        super.addEventListener(type, listener, useCapture, priority, useWeakReference);
    }
}

Somehow arguments.callee is what's causing the problem. This is otherwise valid AS3 code, so it must be a bug. I've filed an issue with Adobe here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜