Build 873 Device crash issue

Hello,

I’m experiencing a strange and very persistent crash on build 873. There is no error in the terminal window, but my app crashes as soon as I push a button. It does not crash on the simulator or the Xcode Simulator. However, it crashes when i run it on my devices (iPhone, iPad, and iPod touch). Build 870 and below work fine on the devices. One thing to note is that I am using the director class. Has anyone experienced these kinds of issues with build 873? Any help is appreciated.

Thank you [import]uid: 47722 topic_id: 29641 reply_id: 329641[/import]

Hi,

You might want to dig up the crash logs from the device (through the XCode organizer). You obviously won’t be able to get any specifics, but it might be able to give you a clue as to what’s causing it.

Ali [import]uid: 10499 topic_id: 29641 reply_id: 118997[/import]

Me too.
I rollbacked to 870, and it works fine. [import]uid: 155824 topic_id: 29641 reply_id: 119009[/import]

Can anyone get any of the Corona sample apps to crash with 873? Any of the button or touch samples?

-Tom [import]uid: 7559 topic_id: 29641 reply_id: 119096[/import]

I just build a few sample apps with 873 and installed them on an iPhone4 and didn’t see any problems. I even build a large project using Director and it ran fine too.

Build 873 now uses the latest Physics Box2D library. In this version there is a slight change to joints that could cause instability if the ratio of mass between two objects is greater than 10:1.

-Tom [import]uid: 7559 topic_id: 29641 reply_id: 119119[/import]

Hi everyone,

Tom, I don’t have any joints in my game, so I don’t think that’s my issue. However, I am using physics in general. Could something else with the new version of the physics engine be causing this?

hikimm: I’m glad to see I’m not the only one having the issue

I’m going to test Build 875 and 876 to see if it fixes anything. I’ll post with the results.

Thank you [import]uid: 47722 topic_id: 29641 reply_id: 119138[/import]

Build 876 doesn’t not fix it. I really don’t know where to look to diagnose the problem. [import]uid: 47722 topic_id: 29641 reply_id: 119158[/import]

I have the same problem, but managed to find the issue. Unfortunately, there’s no workaround… Calling physics.stop() will cause an immediate crash on iOS devices, at least in 875+. [import]uid: 36054 topic_id: 29641 reply_id: 119159[/import]

It’s the same thing. physics.stop is just broken :slight_smile:

You’re right that the simulators do not crash, not even the Xcode one. Made it difficult to debug this.
[import]uid: 36054 topic_id: 29641 reply_id: 119162[/import]

The code below will crash on device (it doesn’t crash in Corona simulator nor in the Xcode simulator). The code worked perfectly with older builds.

physics.stop() causes the crash, but it crashes only if I remove the physicsGroup first…

 local physics = require "physics"  
 physics.start()   
 physics.setGravity( 0, 10 )   
 physics.setScale( 60 )   
 physics.setPositionIterations( 8 )  
 physics.setVelocityIterations( 3 )  
  
  
 local physicsGroup = display.newGroup()  
  
 local wall = display.newRect(0,700,1024,10)  
 physics.addBody( wall, "static", { density=1, friction=0, bounce=0.4})  
  
 local sphere = display.newCircle(512,200,30)  
 physics.addBody( sphere, "dynamic", { density=1, friction=0, bounce=0.4})  
  
 physicsGroup:insert(wall)  
 physicsGroup:insert(sphere)  
  
 local function StopPhysics()  
 display.remove(physicsGroup)  
 physics.stop()  
 end  
  
 timer.performWithDelay(2000,StopPhysics,1)  

[import]uid: 13507 topic_id: 29641 reply_id: 119161[/import]

@polygonblog,

Thanks for posting the code. I was able to reproduce the problem and I’ll create a bug report to get it fixed. This code works with build 870 but crashes on 873.

Thanks,
Tom [import]uid: 7559 topic_id: 29641 reply_id: 119164[/import]

@Tom. Great news. I have also narrowed the issue down to physics.stop() in my code. I’ll be looking out for the build with the fix.

Thank you to Puzzle Runner and polygonblog for their excellent help with this issue.
Thanks again. [import]uid: 47722 topic_id: 29641 reply_id: 119165[/import]

Just got word from Walter that he fixed the Physics.stop bug and it will be in the next Daily Build. Thanks everyone for helping to narrow down the problem.

Update: Daily Build 878 fixes the physics.stop crash problem.

-Tom [import]uid: 7559 topic_id: 29641 reply_id: 119170[/import]

I think the bug isn’t completely fixed yet. The test case doesn’t crash, but I have a game that crashes when I call physics.stop(). It works fine in both Corona and Xcode simulators. I’m using build 2012.904.

I have a large test case and no time to reduce it now. Let me know if you still want it. I could send the whole game with all the assets (35MB).

My workaround for now is to never call physics.stop().

This feels related:
http://web-c1.anscamobile.com/forum/2012/08/12/physicsstop-causing-problems [import]uid: 13507 topic_id: 29641 reply_id: 123515[/import]

I’d like to also note this bug is still present.

“Build 873 now uses the latest Physics Box2D library. In this version there is a slight change to joints that could cause instability if the ratio of mass between two objects is greater than 10:1.”

^ This is exactly the case of when physics.stop() causes a crash on the device. [import]uid: 54030 topic_id: 29641 reply_id: 123527[/import]

We have no reported cases of physic crashes active. The fact that it doesn’t crash in Corona Simulator or Xcode Simulator doesn’t mean that it’s a Corona bug. Lots of issues are timing-related and only show up on certain devices or because devices support multi-touch which you can’t simulate on the simulators.

It still could be a subtle bug in Corona but we would need a small project and the steps to demonstrate the issue. We can’t accept large projects because we end up debugging the project and trying to eliminate the extra code to isolate the crash, which is very time consuming for us. If we had lots of reported cases like this, this may be an option if we felt it pointed to a Corona bug.

-Tom [import]uid: 7559 topic_id: 29641 reply_id: 123537[/import]

I think the bug isn’t completely fixed yet. The test case doesn’t crash, but I have a game that crashes when I call physics.stop(). It works fine in both Corona and Xcode simulators. I’m using build 2012.904.

I have a large test case and no time to reduce it now. Let me know if you still want it. I could send the whole game with all the assets (35MB).

My workaround for now is to never call physics.stop().

This feels related:
http://web-c1.anscamobile.com/forum/2012/08/12/physicsstop-causing-problems [import]uid: 13507 topic_id: 29641 reply_id: 123515[/import]

I’d like to also note this bug is still present.

“Build 873 now uses the latest Physics Box2D library. In this version there is a slight change to joints that could cause instability if the ratio of mass between two objects is greater than 10:1.”

^ This is exactly the case of when physics.stop() causes a crash on the device. [import]uid: 54030 topic_id: 29641 reply_id: 123527[/import]

We have no reported cases of physic crashes active. The fact that it doesn’t crash in Corona Simulator or Xcode Simulator doesn’t mean that it’s a Corona bug. Lots of issues are timing-related and only show up on certain devices or because devices support multi-touch which you can’t simulate on the simulators.

It still could be a subtle bug in Corona but we would need a small project and the steps to demonstrate the issue. We can’t accept large projects because we end up debugging the project and trying to eliminate the extra code to isolate the crash, which is very time consuming for us. If we had lots of reported cases like this, this may be an option if we felt it pointed to a Corona bug.

-Tom [import]uid: 7559 topic_id: 29641 reply_id: 123537[/import]