Bus error - Simulator crashes every time

Thanks for the response.

I actually rebooted my machine earlier today and that seemed to fix the problem. Never did figure out what caused it to begin with. [import]uid: 70 topic_id: 204 reply_id: 250[/import]

Glad to hear it “fixed” itself :slight_smile:

carlos [import]uid: 24 topic_id: 204 reply_id: 254[/import]

I also had this bizarre error involving CGSResolveShmemReference

I was commenting out code like mad to find the source of the error.

Rebooted the Mac as Abica mentioned and it “fixed” itself… [import]uid: 11393 topic_id: 204 reply_id: 14115[/import]

hmm…

I just erased corona. I guess it’s time to give it another shot, (crashed simulator every time was the prob, macbook 1gb ram 1.5.8 [import]uid: 34829 topic_id: 204 reply_id: 20914[/import]

still getting the crash.

Not sure what’s up.

have a look here - http://developer.anscamobile.com/forum/2011/02/05/android-corona-osx- for the crash report. [import]uid: 34829 topic_id: 204 reply_id: 20923[/import]

I’ve started getting this crash too! Sometimes it works and sometimes it doesn’t.

Here’s the terminal output, which doesn’t show any coding error …

Copyright © 2009-2010 A n s c a , I n c .
Version: 2.0.0
Build: 2011.280
The file sandbox for this project is located at the following folder:
(/Users/stefan/Library/Application Support/Corona Simulator/Spelling-F88FA69B144530F8234241E222760D1A)
appFont VAGRoundedBT-Regular
lastScene startUp
main: clean startUp
clean: texture memory 827392
/Applications/Corona.2011.280/Corona Terminal: line 9: 4738 Bus error “$path/Corona Simulator.app/Contents/MacOS/Corona Simulator” $*
logout
Here’s the part of the dump report showing the thread that crashes …
Process: Corona Simulator [4738]
Path: /Applications/Corona.2011.280/Corona Simulator.app/Contents/MacOS/Corona Simulator
Identifier: com.anscamobile.Corona_Simulator
Version: ??? (1.0)
Code Type: X86 (Native)
Parent Process: bash [4736]

Date/Time: 2011-02-07 11:55:26.143 +0000
OS Version: Mac OS X 10.6.6 (10J567)
Report Version: 6

Interval Since Last Report: 340814 sec
Crashes Since Last Report: 31
Per-App Interval Since Last Report: 330734 sec
Per-App Crashes Since Last Report: 28
Anonymous UUID: A2B5DBC4-C850-4A16-93D8-140FB68087AC

Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000010
Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 …nscamobile.Corona_Simulator 0x0006b1b1 0x1000 + 434609
1 …nscamobile.Corona_Simulator 0x000541e9 0x1000 + 340457
2 …nscamobile.Corona_Simulator 0x000589ae 0x1000 + 358830
3 …nscamobile.Corona_Simulator 0x0005950c 0x1000 + 361740
4 …nscamobile.Corona_Simulator 0x0007902d 0x1000 + 491565
5 …nscamobile.Corona_Simulator 0x0000fbef 0x1000 + 60399
6 com.apple.AppKit 0x938a2cf8 -[NSWindow sendEvent:] + 5693
7 com.apple.AppKit 0x937bb817 -[NSApplication sendEvent:] + 6431
8 com.apple.AppKit 0x9374f2a7 -[NSApplication run] + 917
9 com.apple.AppKit 0x937472d9 NSApplicationMain + 574
10 …nscamobile.Corona_Simulator 0x000028d9 0x1000 + 6361

Thread 1: Dispatch queue: com.apple.libdispatch-manager
0 libSystem.B.dylib 0x914df982 kevent + 10
1 libSystem.B.dylib 0x914e009c _dispatch_mgr_invoke + 215
2 libSystem.B.dylib 0x914df559 _dispatch_queue_invoke + 163
3 libSystem.B.dylib 0x914df2fe _dispatch_worker_thread2 + 240
4 libSystem.B.dylib 0x914ded81 _pthread_wqthread + 390
5 libSystem.B.dylib 0x914debc6 start_wqthread + 30

Thread 2:
0 libSystem.B.dylib 0x914dea12 __workq_kernreturn + 10
1 libSystem.B.dylib 0x914defa8 _pthread_wqthread + 941
2 libSystem.B.dylib 0x914debc6 start_wqthread + 30

Thread 3:
0 libSystem.B.dylib 0x914dea12 __workq_kernreturn + 10
1 libSystem.B.dylib 0x914defa8 _pthread_wqthread + 941
2 libSystem.B.dylib 0x914debc6 start_wqthread + 30

Thread 4: com.apple.CFSocket.private
0 libSystem.B.dylib 0x914d80c6 select$DARWIN_EXTSN + 10
1 com.apple.CoreFoundation 0x94dd6c83 __CFSocketManager + 1091
2 libSystem.B.dylib 0x914e685d _pthread_start + 345
3 libSystem.B.dylib 0x914e66e2 thread_start + 34

Thread 5:
0 libSystem.B.dylib 0x914dea12 __workq_kernreturn + 10
1 libSystem.B.dylib 0x914defa8 _pthread_wqthread + 941
2 libSystem.B.dylib 0x914debc6 start_wqthread + 30

Thread 6:
0 libSystem.B.dylib 0x914b915a semaphore_timedwait_signal_trap + 10
1 libSystem.B.dylib 0x914e6ce5 _pthread_cond_wait + 1066
2 libSystem.B.dylib 0x91515ac8 pthread_cond_timedwait_relative_np + 47
3 com.apple.audio.CoreAudio 0x976443c7 CAGuard::WaitFor(unsigned long long) + 219
4 com.apple.audio.CoreAudio 0x976473f9 CAGuard::WaitUntil(unsigned long long) + 289
5 com.apple.audio.CoreAudio 0x97644cf6 HP_IOThread::WorkLoop() + 1892
6 com.apple.audio.CoreAudio 0x9764458d HP_IOThread::ThreadEntry(HP_IOThread*) + 17
7 com.apple.audio.CoreAudio 0x976444a4 CAPThread::Entry(CAPThread*) + 140
8 libSystem.B.dylib 0x914e685d _pthread_start + 345
9 libSystem.B.dylib 0x914e66e2 thread_start + 34

Thread 7:
0 libSystem.B.dylib 0x914b920e mach_wait_until + 10
1 libSystem.B.dylib 0x91540819 nanosleep + 345
2 SDL 0x001b0453 SDL_Delay + 99
3 net.playcontrol.ALmixer 0x0013fc72 Stream_Data_Thread_Callback + 4138
4 SDL 0x001a1ecd SDL_Linked_Version + 397
5 SDL 0x001b01f1 SDL_SemWait + 49
6 libSystem.B.dylib 0x914e685d _pthread_start + 345
7 libSystem.B.dylib 0x914e66e2 thread_start + 34

Thread 0 crashed with X86 Thread State (32-bit):
eax: 0x00000000 ebx: 0x000541c6 ecx: 0x006ee980 edx: 0x006ee980
edi: 0x006ee980 esi: 0x006f1c60 ebp: 0xbffff2a8 esp: 0xbffff290
ss: 0x0000001f efl: 0x00010286 eip: 0x0006b1b1 cs: 0x00000017
ds: 0x0000001f es: 0x0000001f fs: 0x00000000 gs: 0x00000037
cr2: 0x00000010
[import]uid: 2646 topic_id: 204 reply_id: 21152[/import]

Solved my problem! I’d lost a ‘return true’ line at the end of a collision event handler. [import]uid: 2646 topic_id: 204 reply_id: 21397[/import]

Glad to hear.

Mine may be a noob thing.

I haven’t loaded my own program was just running the simulator and crash happens (simulator doesn’t even finish loading). [import]uid: 34829 topic_id: 204 reply_id: 21724[/import]

I have the same issue. Right after I start my app, the simulator crashes and the terminal says:

/Applications/CoronaSDK/Corona Terminal: line 9: 24764 Bus error   
"$path/Corona Simulator.app/Contents/MacOS/Corona Simulator" $\*  
logout  

My error seems different from everyone else’s. It’s probably just a simple coding mistake. But still, does anyone know what this means? [import]uid: 38000 topic_id: 204 reply_id: 58628[/import]

I just noticed that this only happens on one of my director scenes, so that means it’s probably a coding error. But still, does anyone know what sort of error would cause this? [import]uid: 38000 topic_id: 204 reply_id: 59399[/import]

If it happens on scene change, I have two suggestions of what to look for;

  1. Does the scene change on a collision event?

  2. When the second scene loads, what happens immediately with physics? Are you adding bodies? Removing bodies? Etc.

Peach :slight_smile: [import]uid: 52491 topic_id: 204 reply_id: 59465[/import]

Last night I was able to narrow it down to the physics (i.e. when I comment out the physics lines, it works fine) but today I open it up and uncommented the physics lines and it works just fine. I don’t know exactly what caused it, but it seems to be fixed.
But will there be issues when changing scenes on a collision? I was planning on using a popup when two things collided. Is there a workaround for this?
Thanks for your help! [import]uid: 38000 topic_id: 204 reply_id: 59592[/import]

Peach,
After a little bit of work, I got it working, but just now I started getting the bus error again. Let me explain:
My game is a scrolling game in which objects are moved by transition.to from one side of the screen to the other. However, when any of these objects collide with the stationary player, I get the following error numerous times:
ERROR: Cannot translate an object before collision is resolved.
just before the simulator crashes with the bus error. I assume this is the issue with the physics engine that crashes when you try to remove an object, but how can I cancel the transition.to to keep this from happening? FYI, I also try to remove the object after the collision but I use a timer to do it 100 ms after the collision. Could that be part of my issue? [import]uid: 38000 topic_id: 204 reply_id: 59637[/import]

You want to remove it AFTER the collision is resolved, yes. So make sure you are using event.phase == “ended”, for one thing.

The other thing is your transitions - is there a reason you’re using them rather than setting linear velocity? If so, that’s fine, it would just be a lot simpler (I think, I don’t know exactly how your scroller is set up) than transitions.

Peach :slight_smile: [import]uid: 52491 topic_id: 204 reply_id: 59692[/import]

I am checking to be sure that the phase is ended, but I still get the error.
Regarding the linear velocity, I really didn’t think about that when I wrote the code. I wrote the movement code a while before I implemented physics, so I didn’t consider it. I will take a look at it and think about using that. However, I currently set the objects as sensors, so that they would not bounce against each each other or the player. Can you apply liner force to a sensor, or do I need to change it to something else?
Thank you for your help and thoughts on this. [import]uid: 38000 topic_id: 204 reply_id: 59789[/import]

Hey Peter,

No, you could set the linear velocity easily on sensors as well. I wrote a really quick demo for you so you can see how it works. Try this in a new project and note how both circles are sensors and with linear velocity applied they still move freely through each other;

[lua]require ( “physics” )
physics.start()
physics.setGravity( 0, 0 )

local circle1 = display.newCircle( 160, 300, 30 )
physics.addBody(circle1, “dynamic”, {friction = 0.1, bounce = 0.2, density=0.1, isSensor=true})

circle1:setLinearVelocity(0,-50)

local circle2 = display.newCircle( 160, 400, 30 )
physics.addBody(circle2, “dynamic”, {friction = 0.1, bounce = 0.2, density=0.1, isSensor=true})

circle2:setLinearVelocity(0,-100)[/lua]

Peach

PS - Forgive somewhat messy code, a little rushed tonight. [import]uid: 52491 topic_id: 204 reply_id: 59848[/import]

Thanks for the example! That is definitely the best way to do it. However, now, instead of the previous error, I get and error saying

/Applications/CoronaSDK/Corona Terminal: line 9: 7938 Segmentation fault "$path/Corona Simulator.app/Contents/MacOS/Corona Simulator" $\*  

or the bus error (it can change every time seemingly randomly), right before the simulator crashes. This only happens when I call a scene change within the collision event, but it still happens if I put on a timer of 1sec or more.
What is going on here?

[import]uid: 38000 topic_id: 204 reply_id: 59932[/import]

I really can’t tell you exactly what to do because I didn’t write the code, so I’m not sure what kind of mistakes could potentially be there.

I can only suggest that you continue trying to debug, or if you require assistance to try; http://www.anscamobile.com/corona/support/

Peach [import]uid: 52491 topic_id: 204 reply_id: 60005[/import]

Thanks for all your help. After some debugging today, I figured out that it was due to physics:stop(), which was called after a collision. Took that out, and it worked fine. Hope this helps anyone else with this problem.
Thanks again for your time! [import]uid: 38000 topic_id: 204 reply_id: 60154[/import]

Glad to hear it’s all good now :slight_smile:

Peach [import]uid: 52491 topic_id: 204 reply_id: 60661[/import]