Hi there,
The Vungle plugin is causing a crash on iOS three minutes after an app using it is suspended. I believe what’s happening is that Vungle is registering some sort of background process (e.g., to download videos) that isn’t being cleaned up properly on suspend. From some posts on StackOverflow, 180 seconds (three minutes) is the limit for such activities to run, which is why the crash is occurring then.
Here is a simple project that reproduces the bug. (Add your Vungle key to ads.init.)
build.settings
settings = { plugins = { ["CoronaProvider.ads.vungle"] = { publisherId = "com.vungle" } } }
main.lua
local ads = require("ads") ads.init("vungle", "YOUR VUNGLE KEY HERE") local onSystemEvent = function(event) for k,v in pairs(event) do print(k,v) end end Runtime:addEventListener("system", onSystemEvent)
Steps to reproduce the crash:
- Build and install. I built with Corona 2371 and installed on an iPhone 5 running iOS 7.1.2
- Launch the app, then suspend it. In the Xcode console, you’ll see the application start and suspend events fire
- Wait three minutes plus a few seconds
- In the Xcode console, you’ll see a crash
Sample crash report (unrelated log lines have been removed):
Jul 30 07:53:05 Andrews-iPhone-5 Test[2365] \<Warning\>: name system Jul 30 07:53:05 Andrews-iPhone-5 Test[2365] \<Warning\>: type applicationStart Jul 30 07:53:16 Andrews-iPhone-5 Test[2365] \<Warning\>: name system Jul 30 07:53:16 Andrews-iPhone-5 Test[2365] \<Warning\>: type applicationSuspend Jul 30 07:56:17 Andrews-iPhone-5 backboardd[28] \<Warning\>: Test[2365] has active assertions beyond permitted time: {( \<BKProcessAssertion: 0x1658ef40\> identifier: Called by Test, from machineName process: Test[2365] permittedBackgroundDuration: 180.000000 reason: finishTask owner pid:2365 preventSuspend preventIdleSleep preventSuspendOnSleep )} Jul 30 07:56:17 Andrews-iPhone-5 backboardd[28] \<Warning\>: Forcing crash report of Test[2365]... Jul 30 07:56:18 Andrews-iPhone-5 backboardd[28] \<Warning\>: Finished crash reporting. Jul 30 07:56:18 Andrews-iPhone-5 backboardd[28] \<Warning\>: pid\_suspend failed for [2365]: Unknown error: -1, Unknown error: -1 Jul 30 07:56:18 Andrews-iPhone-5 com.apple.launchd[1] (UIKitApplication:com.aukstudios.test[0xf65c][2365]) \<Notice\>: (UIKitApplication:com.aukstudios.test[0xf65c]) Exited: Killed: 9 Jul 30 07:56:18 Andrews-iPhone-5 backboardd[28] \<Warning\>: Application 'UIKitApplication:com.aukstudios.test[0xf65c]' exited abnormally with signal 9: Killed: 9 Jul 30 07:56:18 Andrews-iPhone-5 ReportCrash[2368] \<Notice\>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/Test\_2014-07-30-075617\_Andrews-iPhone-5.ips using uid: 0 gid: 0, synthetic\_euid: 501 egid: 0
I’ve also observed this crash on Corona 2256 and iOS 7.0.2 from a build of mine over two months old, so I don’t think it’s a recent regression bug in the plugin but rather a bug that’s been there for some time that we just didn’t notice.
It would be great if anyone else in the community could try this and verify what I’m seeing.
Thanks.
- Andrew