Signal 10 without any idea to solve that

Hello

I have to launch my app before the end of this week but I encounter some time this crash :

SpringBoard: Application 'insight' exited abnormally with signal 10: Bus error: 10  

I do not know to solve that since there’s is no log that can help me, nothing in corona debuguer nor in console for xcode simulator.

If someone can give me some ideas…

Frédéric
[import]uid: 5578 topic_id: 27643 reply_id: 327643[/import]

Hmm, does this happen if you do the following:

  1. Delete app from device
  2. Re-install via xcode (build your app again)
  3. Test

Is this crash consistent? Can you re-produce it at the same place everytime? [import]uid: 84637 topic_id: 27643 reply_id: 112195[/import]

SIGBUS is generated generally because of one of two reasons:

  1. You are trying to access a memory address that doesn’t exist.
  2. You’re trying to access memory that isn’t aligned on a 4 or 8 byte boundary.

Most likely #1 is the reason given how Corona operates.

Are you using Storyboard or Director? Frequently you will start a timer or have a transition.to execute some onComplete code after a scene has transitioned out of memory and that is a very frequent cause of this.

You could also be calling a function that’s been written over by a variable too. Consider this theoretical scenario:

   
local function fred()  
 -- do stuff for function fred  
 return true  
end  
  
fred = 10  
-- since "fred" is really just a variable that holds the address of a function, it can be easily overwritten.  
  
-- later on in the code:  
  
someVar = fred()  

The program will try to execute the function fred, but the address of fred is no longer were it lived in memory, but is now at memory address 10, which is invalid. The system will generate a signal 10 SIGBUS error and crash.

This is why if you don’t cancel timers, transitions, audio or any thing that is asynchronous that has a call back and executes after that code is removed from memory (i.e. scene change with storyboard) your code goes BOOM.

Corona has no facilities to hep you track them down. The MACH kernal for iOS and OS-X and the Linux kernal for Android are not setup to dump memory cores that you could run a debugger on. The debugging tools like CIDER and CoronaComplete also cannot catch these errors. You just have to hunt for things, and if necessary brute force debug it by commenting out things until the problem goes away.

99% of my SIGBUS and SIGSEGV (signal 11 Segment Violation) errors happen because I missed a call back that fired after I switched scenes in Storyboard or Director . [import]uid: 19626 topic_id: 27643 reply_id: 112207[/import]

Thanks a lot fot this explanation.

I use Storyboard.

I believe it was a transition.to that relies on a remote download of an image (which I change after).

Corona is weak on debug phase.
Saving, then building for Xcode simulator is a VERY SLOW process.

The corona simulator should also parse all lua file before launching app, to check syntax error.

I have try cider but it adds some lua file and line in my code…

CoronaComplete is not good for editing.

Corona Project Manager crashes at launch and I am still waiting help for the support (seems it is because of dropbox).

I am still searching for a good IDE with debug and doc inside.

Wouldn’t it possible to use Xcode ? [import]uid: 5578 topic_id: 27643 reply_id: 112277[/import]

Xcode used to, but no longer supports the ability to do syntax highlighting and code completion for Lua. If you go to the blog and read the “How to report bugs” blog post, Eric has an example at the bottom that each of us should do to prompt Apple to add that support back. If you want to use Xcode, you need to submit the bug report that he talks about.

However, your corona app doesn’t run under Xcode while in the Simulator. There isn’t a way that I know now of catching SIGSEGV and SIGBUS errors in any of the existing tools, Corona created or not. Xcode would not help.

The reason for that is Corona Apps are basically a program that reads Lua files that have been converted to byte code and it runs the byte code in it’s own processor. When a bus error happens, its because your lua code crashed the Corona processor sitting above it. That process has no debugging symbols for a debugger to use but even if it did, you would be debugging inside of the corona VM not in your app’s lua code.

Perhaps some day, Corona can do a better job of catching memory errors and have it not crash the overall app.
[import]uid: 19626 topic_id: 27643 reply_id: 112310[/import]

Thanks for all this deep knowledge that you share !

I think it comes from the connection network : it seems that the app do not work properly if the network is weak or out of work.

Also Apple says she rejects app that do not handle check for connection, but how to do that all the time during the app is opened ?

On every scene with a listener ? Does that mean I have to embed all the code into a listener/function that check the network reachability ? [import]uid: 5578 topic_id: 27643 reply_id: 112375[/import]

For iOS you can check network status with the Reachability APIs.
http://developer.anscamobile.com/reference/index/network/detect-network-status/networksetstatuslistener [import]uid: 7559 topic_id: 27643 reply_id: 112404[/import]