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
iOS 10 and Chipmunk crash
-
- Posts: 7
- Joined: Fri Dec 19, 2014 6:17 pm
- Contact:
iOS 10 and Chipmunk crash
- Attachments
-
- 232323232324443333.jpg (223.27 KiB) Viewed 47237 times
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: iOS 10 and Chipmunk crash
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?
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/
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: iOS 10 and Chipmunk crash
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/
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
-
- Posts: 7
- Joined: Fri Dec 19, 2014 6:17 pm
- Contact:
Re: iOS 10 and Chipmunk crash
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
- 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.
-
- Posts: 7
- Joined: Fri Dec 19, 2014 6:17 pm
- Contact:
Re: iOS 10 and Chipmunk crash
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.
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 (121.26 KiB) Viewed 47150 times
Last edited by yomanx on Mon Oct 03, 2016 8:31 am, edited 1 time in total.
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: iOS 10 and Chipmunk crash
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. :-\
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/
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
-
- Posts: 7
- Joined: Fri Dec 19, 2014 6:17 pm
- Contact:
Re: iOS 10 and Chipmunk crash
after tests we fixed this bug, atm i'am not shure what fixed it.
maybe after bomb detonation or some extra delays..
maybe
Code: Select all
bomb.physicsBody = nil;
Last edited by yomanx on Wed Nov 09, 2016 8:53 pm, edited 1 time in total.
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: iOS 10 and Chipmunk crash
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.
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/
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Who is online
Users browsing this forum: No registered users and 1 guest