[Resolved] Segmentation or Bus ERROR!

How would I start to address this issue? I don’t even know where to start!
What does this mean?

[code]

/Applications/Corona.243/Corona Terminal: line 9: 2214 Bus error “$path/Corona Simulator.app/Contents/MacOS/Corona Simulator” $*
logout
[Process completed]
[/code] [import]uid: 7197 topic_id: 4998 reply_id: 304998[/import]

-This is only relevant to Ricardo’s Director Class-

Solved:
The button handler was causing the issue. I went through and commented everything out. Last of course was the button handler. I switched it over to Ricardo’s button example, and that did it.

This does not work:

 local btnPlay = ui.newButton{  
 default = "images/play.png",  
 over = "images/play.png",  
 onEvent = playHandler,  
 id = "playBtn",  
 text = "",  
 size = 12,  
 emboss=true  
 }  

This works:

local bt02 = display.newImage("images/play.png") local function bt02t ( event ) if event.phase == "ended" then media.stopSound() director:changeScene("playerSelection","moveFromRight") end end bt02:addEventListener("touch",bt02t) bt02.x = 240 bt02.y = 80 localGroup:insert(bt02) [import]uid: 7197 topic_id: 4998 reply_id: 16310[/import]

I changed as you mentioned and I still have the Segmentation Faults.

Strange that the both demo applications: Ghost vs Monsters and Martian Control. They still use the ui.newButton and the Director class and it’s not crashing.

I follow the structure of these programs and they don’t differ much from my code. But mine still crashing randomly when touching any button(ui.newbutton) after I change a scene with Director class.

I almost finish my game but this crash is getting me crazy!

The last hope is to remove the Director class and do all the transitions by myself, but it’s scary thinking that the crash can happen also even without director class.

Any suggestions anybody? [import]uid: 9975 topic_id: 4998 reply_id: 23310[/import]

I had the same problem today, and was able to track it down to following:

When UI button ( from ui.lua -> ui.newButton) is used to change the scene within its nPress event handler and create new UI button handlers, it will crash. Not sure under which circumstances exactly will crash, but there is something wrong that I haven’t been able to track, except that it has to do something that the new UI button is being created while the newButtonHandler is still executing doing onPress event from the “main button”.
Looks like under some circumstances the program will enter into some sort of recursive loop which will give some stack overflow type of issue.
My bus error was happening when I was trying to insert the newly created button into a group.
I was not even using Director or Storyboard.

I was not great fan of ui.lua anyway, and this definitely means that I will rewrite it to use pseudo-classes instead of modules.

So bottom line is: create your own button code, ideally “class” based, or use ui.lua with extreme caution.

[import]uid: 80100 topic_id: 4998 reply_id: 107273[/import]