Game stutter and EXC_RESOURCE exception

Gah,  I’m pulling my hair out of an issue that seems to be occurring only on my iOS device (iPhone 6 running iOS 8) with the latest public build.

I have a game where objects are being thrown right-to-left on the screen and I am trying to catch them.  In later levels, the number of objects increase, and at a random point in these later levels the game stutters for about half a second.  When I connected my phone to the Xcode console window,  I noticed at the point of stutter a crash report log had been generated, with the following message on the console:

Jan &nbsp;3 00:09:36 DSI-iPhone ReportCrash[5213] \<Error\>: task\_set\_exception\_ports(B07, 400, D03, 0, 0) failed with error (4: (os/kern) invalid argument) Jan &nbsp;3 00:09:36 DSI-iPhone ReportCrash[5213] \<Notice\>: ReportCrash acting against PID 5212 Jan &nbsp;3 00:09:36 DSI-iPhone diagnosticd[5093] \<Error\>: error evaluating process info - pid: 5212, punique: 5212 Jan &nbsp;3 00:09:36 DSI-iPhone ReportCrash[5213] \<Notice\>: Formulating crash report for process Boutique Blitz[5212] Jan &nbsp;3 00:09:36 DSI-iPhone ReportCrash[5213] \<Notice\>: Saved report to /var/mobile/Library/Logs/CrashReporter/ExcResource\_Boutique Blitz\_2015-01-03-000936\_DSI-iPhone.ips

So I opened the device logs and noticed this in the crash log:

Exception Type:&nbsp; EXC\_RESOURCE Exception Subtype: WAKEUPS Exception Message: (Limit 150/sec) Observed 513/sec over 300 secs

Now, my game runs at 60 fps.  If i tweak it to 30 fps the stutter / crash log problem never appears to happen.  But 30 fps is not smooth for this game so that is not a solution or workaround for me.

I also have an enterFrame function, which I believe is the culprit.  But I don’t know exactly what part is causing this issue to happen. Here’s my enterFrame function, I hope someone can give me an idea? (Warning: trying to figure out what I’m doing here will hurt your eyes and brain)

-- -- This is how it works: &nbsp; -- &nbsp;For each level there will be a certain number of thrown objects -- &nbsp;shown on the screen at once (Level 1 can only have 1 obj at once). &nbsp; -- &nbsp;We will call each set of objects on the screen a 'wave'. -- -- &nbsp;After a certain number of waves, the level is incremented, and more -- &nbsp;objects will be shown at once on the screen (i.e. the waves will be -- &nbsp;bigger). -- updateScene = function(event) &nbsp; ------------------------------------------- &nbsp; -- Wait for last obj in wave to be created &nbsp; ------------------------------------------- &nbsp; if timer\_handles["eachObjInWave" .. throw\_info.num\_waves]&nbsp; &nbsp; &nbsp; or game\_state == "game\_over" or game\_state == "paused" then &nbsp; &nbsp; return &nbsp; end &nbsp; -- NOTE: There will be a pause after the last object in wave is thrown, before &nbsp; -- next wave is thrown again. &nbsp; local check\_id = throw\_info.allowed\_at\_once &nbsp; -- In later levels, have no pause; check after a certain number of objects thrown &nbsp; if throw\_info.allowed\_at\_once == throw\_info.max\_allowed then &nbsp; &nbsp; check\_id = check\_id - 3 &nbsp; end &nbsp; for id = 1, check\_id do &nbsp; &nbsp; if throw\_info[id].obj then &nbsp; &nbsp; &nbsp; return &nbsp; &nbsp; end &nbsp; end &nbsp; local delay\_after\_previous = throw\_info.delay\_list[throw\_info.allowed\_at\_once] &nbsp; onscreen\_id = 1 &nbsp; throw\_info.bonus\_thrown = false &nbsp; local created &nbsp; --------------------------------------------------------------------------------------- &nbsp; -- Here we draw each wave (throw\_info.allowed\_at\_once) &nbsp; --------------------------------------------------------------------------------------- &nbsp; timer\_handles["eachObjInWave" .. throw\_info.num\_waves] = timer.performWithDelay( delay\_after\_previous, function() &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; -- Create an object to throw, and perform three different transitions on it so that it &nbsp; &nbsp; -- does an arc from right to left. &nbsp; &nbsp; created = createThrowObj(throw\_info.level, onscreen\_id) &nbsp; &nbsp; if created then&nbsp; &nbsp; &nbsp; &nbsp; -------------------------------------------------------------------- &nbsp; &nbsp; &nbsp; -- If all objects have been thrown, we have completed a single wave &nbsp; &nbsp; &nbsp; -------------------------------------------------------------------- &nbsp; &nbsp; &nbsp; if onscreen\_id == throw\_info.allowed\_at\_once then &nbsp; &nbsp; &nbsp; &nbsp; throw\_info.num\_waves = throw\_info.num\_waves + 1 &nbsp; &nbsp; &nbsp; &nbsp; -------------------------------------------------------------------- &nbsp; &nbsp; &nbsp; &nbsp; -- Increase the level after a set number of waves &nbsp; &nbsp; &nbsp; &nbsp; -------------------------------------------------------------------- &nbsp; &nbsp; &nbsp; &nbsp; if (throw\_info.num\_waves % throw\_info.waves\_per\_level) == 0 then &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; throw\_info.level = throw\_info.level + 1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if throw\_info.allowed\_at\_once \< throw\_info.max\_allowed then &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; throw\_info.allowed\_at\_once = throw\_info.allowed\_at\_once + 1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end &nbsp; &nbsp; &nbsp; &nbsp; end &nbsp; &nbsp; &nbsp; end &nbsp; &nbsp; &nbsp; onscreen\_id = onscreen\_id + 1 &nbsp; &nbsp; end -- of IF created &nbsp; &nbsp; timer\_handles["eachObjInWave" .. throw\_info.num\_waves] = nil &nbsp; end, throw\_info.allowed\_at\_once) end

This issue was also discussed in the Unity3D forum. iOS 8 bug? I hope this doesn’t cause my app to get rejected.

http://forum.unity3d.com/threads/the-weird-ios8-unity3d-hiccup.273186/

This issue was also discussed in the Unity3D forum. iOS 8 bug? I hope this doesn’t cause my app to get rejected.

http://forum.unity3d.com/threads/the-weird-ios8-unity3d-hiccup.273186/

We are getting the same error - a brief stall which results in a crash report. The app doesn’t close but a crash report is sent to diagonostics:

IOS version: iOS8.2

Exception type: EXC_RESOURCE

Exception Subtype: WAKEUPS

Exception message: (Limit 150/sec) Observed 436/sec over 300 secs

According to other information on the web about this kind of error on iOS, it only ccurs on iOS 8. Even so, it would be useful to understand or be directed to any general tests to get a little closer as to what parts of the app is causing this.

Any advice much appreciated.

We are getting the same error - a brief stall which results in a crash report. The app doesn’t close but a crash report is sent to diagonostics:

IOS version: iOS8.2

Exception type: EXC_RESOURCE

Exception Subtype: WAKEUPS

Exception message: (Limit 150/sec) Observed 436/sec over 300 secs

According to other information on the web about this kind of error on iOS, it only ccurs on iOS 8. Even so, it would be useful to understand or be directed to any general tests to get a little closer as to what parts of the app is causing this.

Any advice much appreciated.