5 Replies Latest reply on Aug 31, 2011 10:25 AM by Flex harUI

    How to debug a runtime stack underflow error?


      I'm really struggling to resolve a stack underflow that I'm getting.  The traceback I get at runtime is:


      VerifyError: Error #1024: Stack underflow occurred.

      at flash.events::EventDispatcher/dispatchEventFunction()

      at flash.events::EventDispatcher/dispatchEvent()

      at flash.net::URLLoader/onComplete()


      This is particularly difficult to debug because when I run in debug mode it does not happen at all.  It only happens when compiled as a release.


      Does anyone have any tips on how to debug a Stack Underflow?  Are have a clean explanation of what that means for Flash?


      In case it helps, this error is occurring when I click a button whose handler makes an RPC call, which uses a URLLoader, an AsyncToken, and then invokes the set of AsyncResponder instances associated with the AsyncToken.  With some server-side logging as well as some logging hacked into the swf, I know that the UrlLoader is successfully doing and GET'ing a crossdomain.xml file, is correctly processing it (if I wreck it, I get a security error), and is also successfully completing the "load" request (the server sends the data)... the underflow seems to be happening in the Event.COMPLETE listening/handling process (as is, of course, implied by the traceback as well).


      mxmlc used = from flex_sdk_4.5.0.20967

      Example player (I've tried a few) =