Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
Posts: 21
Registered: ‎10-17-2009
My Device: Not Specified

Stack overflow (error 1023) on PB - when there is no recursion

Hello,

 

This is a follow-up to a previous problem I had where the debug version of an app works fine on the PB but the release version crashed. I have found the error code associated with the crash: 1023 - a stack overflow. Besides the obvious "why is this NOT happening in debug" question, I can't figure out the cause of this problem: it happens when the stack is 7 functions deep.

 

And it consistently happen at the same place. I switched my architecture to do resource loading between the frame animations (it is a game), which entails a very different call graph, but it stills happens at the same place.

 

The function called is 'ranchInit()' without any parameters. It is not a function that is overridden. And in fact it doesn't even get inside of the function. Just calling 'ranchInit' creates the error.

 

Some guidance, hint, help would be welcomed, this just doesn't make any sense to me.

 

Alain-Daniel

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Stack overflow (error 1023) on PB - when there is no recursion

You may have considered this route already, but when faced with a perplexing problem like that my second course of action (after studying the code for non-obvious issues) is usually to make a "branch" of the project (i.e. a copy, in the source code repository) and start hacking out the non-essentials until I've got a much smaller version of the code that still demonstrates the problem. Ultimately, if possible, I'll get it down to a single file which I can then post online for assistance.

This can take quite some time, but in the process I usually end up solving the problem -- which is why you won't see many such posts from me. ;-) If I haven't solved it by then, usually someone else can easily reproduce it from the standalone test case and will then point me to the root cause.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Highlighted
Developer
Posts: 21
Registered: ‎10-17-2009
My Device: Not Specified

Re: Stack overflow (error 1023) on PB - when there is no recursion

Yeah, I do like to isolate the errors, but the nature of this one makes me think I'll need most of the classes of my project.

 

Nonetheless, I found a way around it: I broke down the function whose call was throwing the exception 1023. I made all the function variables class variables instead. I even put the inside of a for() loop in a separate function. That did the trick. The app can now pass over this section of the code.

 

However, I am not getting a stack underflow error a few more calls later... I am getting sick of this.