iOS 10 and Chipmunk crash

Discuss any Chipmunk bugs here.

iOS 10 and Chipmunk crash

Postby yomanx » Tue Sep 20, 2016 3:11 pm

Hi friends,

Sometimes my game crashing with this log:

ZombieBasketball was compiled with optimization - stepping may behave oddly; variables may not be available.
(lldb)


Something like this bug was fixed by slembcke in iOS 9, but now in iOS 10 game started crashing again :?
Attachments
232323232324443333.jpg
232323232324443333.jpg (223.27 KiB) Viewed 3479 times
yomanx
 
Posts: 7
Joined: Fri Dec 19, 2014 6:17 pm

Re: iOS 10 and Chipmunk crash

Postby slembcke » Wed Sep 21, 2016 10:02 am

That's odd. It's almost definitely caused by the body being freed before the shape attached to it. Since the shape should be retaining the body, I'm not sure how that's possible though. Especially so since ARC is involved.

The ObjectiveChipmunk memory code is pretty straightforward, maybe 10 lines of code involved, and hasn't changed in (5?) years. I sort of doubt there is anything wrong there. The rest uses ARC, so I doubt there is something wrong there too.

The only other clue there is that it's trying to operate on a static body. Are you creating any static bodies yourself?
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: iOS 10 and Chipmunk crash

Postby slembcke » Wed Sep 21, 2016 10:04 am

Another possibility that is more insidious is that you might be accidentally using a body (or CCNode) after it's been freed and somehow causing it to be double released. It's sort of unlikely, but it's possible. Try enabling guard malloc, or zombies. They might shed some light.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: iOS 10 and Chipmunk crash

Postby yomanx » Sat Oct 01, 2016 10:14 pm

after dozens tests:

- Guard malloc does not launch an application on my devices it writes about the missing library, we can start it just on the simulators, but it always crashing
- When we turned ON Zombie Objects, we no longer received this bug crash, just crash when the memory out.


we have thousands static bodies..

gameplay, everything on physics https://youtu.be/sYEd4XbJlRg?t=25s


ps today i did test mode on the level where i had crash with 500+ enemies, unlimited lives, and hundreds of weapon using and not received crash, but when i play 20-40 waves i will have this crash :?
Last edited by yomanx on Sun Oct 02, 2016 11:56 am, edited 1 time in total.
yomanx
 
Posts: 7
Joined: Fri Dec 19, 2014 6:17 pm

Re: iOS 10 and Chipmunk crash

Postby yomanx » Sun Oct 02, 2016 11:47 am

Maybe something wrong in our code?
its the moment when the mine touching ground, and then its old body is removed and after 0.25 seconds there is a new static sensor body created.
Attachments
Снимок экрана 2016-10-02 в 19.44.39.png
Снимок экрана 2016-10-02 в 19.44.39.png (121.26 KiB) Viewed 3392 times
Last edited by yomanx on Mon Oct 03, 2016 8:31 am, edited 1 time in total.
yomanx
 
Posts: 7
Joined: Fri Dec 19, 2014 6:17 pm

Re: iOS 10 and Chipmunk crash

Postby slembcke » Sun Oct 02, 2016 8:09 pm

I don't immediately see anything wrong with that, but maybe there is a race condition? There is nothing preventing another ccPhysicsBegin: method call from happening again after the block is scheduled.

It should still be safe from a memory error though, so I can't explain that. I guess I'd try running it with the Allocations instrument. You can search for the memory address it's crashing on and maybe see if it's being double released somehow. Not quite sure what you'd do with the information though. :-\
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: iOS 10 and Chipmunk crash

Postby yomanx » Tue Nov 01, 2016 7:34 pm

after tests we fixed this bug, atm i'am not shure what fixed it.

maybe
Code: Select all
bomb.physicsBody = nil;
after bomb detonation or some extra delays..
Last edited by yomanx on Wed Nov 09, 2016 8:53 pm, edited 1 time in total.
yomanx
 
Posts: 7
Joined: Fri Dec 19, 2014 6:17 pm

Re: iOS 10 and Chipmunk crash

Postby slembcke » Wed Nov 02, 2016 11:51 am

Hmm. It was a mysterious crash for sure. Good that it's working for you now.

Hopefully it wasn't actually bug in Chipmunk with some weird undefined behavior.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm


Return to Bugs

Who is online

Users browsing this forum: No registered users and 0 guests

cron