Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Vungle Plugin on iOS Crashes 3 Minutes After Suspend (active assertions beyond permitted time)
Started by aukStudios Jul 30 2014 04:19 AM

28 replies to this topic
vungle ios crash plugin
[TOPIC CONTROLS]
Page 1 of 2 1 2
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

aukStudios

[GLOBAL: userInfoPane.html]
aukStudios
  • Corona Geek

  • 1,003 posts
  • Corona SDK

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



[TOPIC: post.html]
#2

MAS1

[GLOBAL: userInfoPane.html]
MAS1
  • Contributor

  • 279 posts
  • Corona SDK

Hi Andrew,

 

I've just tested and got no such crash.  I use an iPod Touch 4th generation running iOS 6.1.6 and Corona SDK version 2317

 

I waited 4 minutes and did a suspend and resume with no problem.

 

After resume I watched a live (non test) Vungle video and then played for over 3 minutes and again suspended and resumed with no crash. 

 

Still, I'm concerned as my customers running on newer hardware with a more recent OS may be experiencing what you are...

 

Best,

 

Martin.



[TOPIC: post.html]
#3

aukStudios

[GLOBAL: userInfoPane.html]
aukStudios
  • Corona Geek

  • 1,003 posts
  • Corona SDK

Hi Martin, thanks for testing.

 

My understanding is that the background process limit is 3 minutes on iOS 7 but is 10 minutes on iOS 6 (http://stackoverflow.com/questions/22679845/ios7-background-task-myapp-has-active-assertions-beyond-permitted-time).  Since you're using iOS 6, would you mind trying again but this time waiting 10 minutes instead of 3?

 

- Andrew



[TOPIC: post.html]
#4

MAS1

[GLOBAL: userInfoPane.html]
MAS1
  • Contributor

  • 279 posts
  • Corona SDK

Hi Andrew,

 

I played my game for 11 minutes and then did a suspend and resume. Still works - no crash on resume.

 

You could alert Chris Mock at Vungle to this thread. I've found Chris to be very helpful in the past.

 

Best of luck!

 

Martin.



[TOPIC: post.html]
#5

aukStudios

[GLOBAL: userInfoPane.html]
aukStudios
  • Corona Geek

  • 1,003 posts
  • Corona SDK

Hi Martin. Thanks for checking again. My original post may not have been clear. You shouldn't play the game for 3 (or 10) minutes. Instead, you should launch it, then exit and leave it suspended for 3 (or 10) minutes. The crash occurs *while* the app is suspended. Thus, it's not horrible from a user experienxe standpoint, but it's still not good behavior.

[TOPIC: post.html]
#6

MAS1

[GLOBAL: userInfoPane.html]
MAS1
  • Contributor

  • 279 posts
  • Corona SDK

Hi Andrew,

 

This won't be much use but...

 

So, I launched the game, exited and restarted just over 10 minutes later. The game started from the very start - not a resume - and there were no errors/crashes/Vungle issues.

 

Martin.



[TOPIC: post.html]
#7

chris.mock

[GLOBAL: userInfoPane.html]
chris.mock
  • Observer

  • 13 posts
  • Corona SDK

Hi Martin. Thanks for checking again. My original post may not have been clear. You shouldn't play the game for 3 (or 10) minutes. Instead, you should launch it, then exit and leave it suspended for 3 (or 10) minutes. The crash occurs *while* the app is suspended. Thus, it's not horrible from a user experienxe standpoint, but it's still not good behavior.

 

Hi Andrew and all,

Let me reproduce this on our test iPhone 5 running iOS 7.1.2 and see what we can find. ~Chris



[TOPIC: post.html]
#8

jordyn.chuhaloff

[GLOBAL: userInfoPane.html]
jordyn.chuhaloff
  • Enthusiast

  • 49 posts
  • Enterprise

Hi Andrew, 

 

Currently, our iOS Corona plugin is on SDK 308. We have a fix for this issue in 309, which is currently in QA. Should be done pretty soon, then we'll push it out :)

 

Cheers,

Jordyn

Vungle 

Tech Support Engineer



[TOPIC: post.html]
#9

aukStudios

[GLOBAL: userInfoPane.html]
aukStudios
  • Corona Geek

  • 1,003 posts
  • Corona SDK

Thanks Chris and Jordyn for taking a look and confirming a fix is on the way.  If possible, would you mind updating this thread when version 309 is pushed?  Unfortunately, Corona doesn't provide us visibility when plugins are updated (though it's something I've chatted with them about improving), so if you have a chance to post on this thread, that would be fantastic.

 

- Andrew



[TOPIC: post.html]
#10

chris.mock

[GLOBAL: userInfoPane.html]
chris.mock
  • Observer

  • 13 posts
  • Corona SDK

We have 3.0.9 available on our dashboard which also means we sent it over to our partners. However, I do not have an exact timeframe when Corona will have it up. Vungle//Chris



[TOPIC: post.html]
#11

aukStudios

[GLOBAL: userInfoPane.html]
aukStudios
  • Corona Geek

  • 1,003 posts
  • Corona SDK

Thanks for the update!

 

Corona team, it would be great if you could reply on this thread when the version 3.0.9 Vungle plugin for iOS that Chris just mentioned is actually up on Corona's servers.

 

- Andrew



[TOPIC: post.html]
#12

jordyn.chuhaloff

[GLOBAL: userInfoPane.html]
jordyn.chuhaloff
  • Enthusiast

  • 49 posts
  • Enterprise

Hi Andrew, 

 

We pushed 309 yesterday, so if you're on the newest version of Corona, it should auto-update to 309 :)

 

Jordyn / Vungle 



[TOPIC: post.html]
#13

aukStudios

[GLOBAL: userInfoPane.html]
aukStudios
  • Corona Geek

  • 1,003 posts
  • Corona SDK

Thanks Jordyn.  I've just retested this and I'm still seeing the crash.  I retested using the same code as my original post, but this time on Corona 2393 (latest public release) and an iPad 3 running iOS 7.0.4.

 

Is Vungle 309 set to have a minimum Corona version even higher than Corona 2393 (latest public release)?  If so, that would explain why I'm still seeing the crash, in which case I'll try again with an even newer daily build.  If not, then it suggests to me that while you pushed Vungle 309, and hasn't been integrated into the Corona build process yet for some reason.

 

- Andrew



[TOPIC: post.html]
#14

jordyn.chuhaloff

[GLOBAL: userInfoPane.html]
jordyn.chuhaloff
  • Enthusiast

  • 49 posts
  • Enterprise

Hi Andrew, 

 

So sorry about that! We had a miscommunication over here, but apparently we have not pushed 309 to the public Corona repo, just the one we do testing on. I will update here again when it is ready. 

 

Thanks!

Jordyn/Vungle



[TOPIC: post.html]
#15

altafr

[GLOBAL: userInfoPane.html]
altafr
  • Contributor

  • 126 posts
  • Corona SDK

My Crash report

 

Aug 18 14:22:24 Designer-iPad nomsnombers[264] <Warning>: called when add is viewed
Aug 18 14:22:24 Designer-iPad nomsnombers[264] <Warning>: Corona ads ended
Aug 18 14:22:24 Designer-iPad nomsnombers[264] <Warning>: vungleVideoCompleted called
Aug 18 14:22:24 Designer-iPad nomsnombers[264] <Warning>: freeReviveGotAnimation called
Aug 18 14:22:24 Designer-iPad AppStore[265] <Warning>: [SSMetricsEventController] Direct-access controller is calling through XPC to flush Unreported Events
Aug 18 14:22:24 Designer-iPad AppStore[265] <Warning>: [SSMetricsEventController] Direct-access controller is calling through XPC to flush Unreported Events
Aug 18 14:22:26 Designer-iPad ReportCrash[266] <Notice>: ReportCrash acting against PID 264
Aug 18 14:22:26 Designer-iPad ReportCrash[266] <Notice>: Formulating crash report for process nomsnombers[264]
Aug 18 14:22:27 Designer-iPad com.apple.launchd[1] (UIKitApplication:com.funzytime.nomsnombers[0x654e][264]) <Warning>: (UIKitApplication:com.funzytime.nomsnombers[0x654e]) Job appears to have crashed: Segmentation fault: 11
Aug 18 14:22:27 Designer-iPad backboardd[29] <Warning>: Application 'UIKitApplication:com.funzytime.nomsnombers[0x654e]' exited abnormally with signal 11: Segmentation fault: 11
Aug 18 14:22:27 Designer-iPad mediaserverd[45] <Warning>: Encountered an XPC error while communicating with backboardd: <error: 0x3a1fa744> { count = 1, contents =
"XPCErrorDescription" => <string: 0x3a1fa9dc> { length = 22, contents = "Connection interrupted" }
}
Aug 18 14:22:27 Designer-iPad ReportCrash[266] <Notice>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/nomsnombers_2014-08-18-142226_Designer-iPad.plist using uid: 0 gid: 0, synthetic_euid: 501 egid: 0

Aug 18 14:22:27 Designer-iPad mediaserverd[45] <Warning>: 14:22:27.799 [0x23cc000] CMSession retain count > 1! 



[TOPIC: post.html]
#16

jordyn.chuhaloff

[GLOBAL: userInfoPane.html]
jordyn.chuhaloff
  • Enthusiast

  • 49 posts
  • Enterprise

Hi everyone! I've just tested and looks like 309 is ready :) Should fix the background crashes we've been seeing.

 

Jordyn / Vungle



[TOPIC: post.html]
#17

Stephen Lewis

[GLOBAL: userInfoPane.html]
Stephen Lewis
  • Contributor

  • 716 posts
  • Enterprise

@Andrew

 

Did the latest Vungle plugin fix the crash after 3 minutes suspend?  I am still seeing my iOS app restart rather than resume after being suspended for several minutes.  I use the Vungle plugin with the latest daily build, but I'm also using several other plugins so I'm curious to know if the issue has been fixed for you before I try to track down any other possible culprits.  Thanks for any info you can provide.

 

-Stephen



[TOPIC: post.html]
#18

aukStudios

[GLOBAL: userInfoPane.html]
aukStudios
  • Corona Geek

  • 1,003 posts
  • Corona SDK

Hi Stephen,

 

I just checked using my simple test project from the top of this thread, and no, the latest Vungle plugin didn't fix the issue.  (My test project includes only Vungle, so it's definitely Vungle that's the problem.)

 

Chris or Jordyn, it would be great if you could chime back on on this thread and confirm whether you can reproduce the issue.

 

Thanks.

 

- Andrew



[TOPIC: post.html]
#19

Stephen Lewis

[GLOBAL: userInfoPane.html]
Stephen Lewis
  • Contributor

  • 716 posts
  • Enterprise

Thanks for checking Andrew.

 

Yes, could someone from Vungle please chime in?  I'm pushing an update to my app soon and would like to continue to use Vungle.

 

Thanks,

 

-Stephen



[TOPIC: post.html]
#20

jordyn.chuhaloff

[GLOBAL: userInfoPane.html]
jordyn.chuhaloff
  • Enthusiast

  • 49 posts
  • Enterprise

Hi everyone, 

 

We thought we had fixed this issue in 3.0.9, but we actually fixed it in 3.0.10. So sorry for the hassle- 3.0.10 is in QA, and I'll let you know here when it's pushed to Corona.

 

Jordyn / Vungle



[TOPIC: post.html]
#21

Naomi

[GLOBAL: userInfoPane.html]
Naomi
  • Corona Geek

  • 2,303 posts
  • Corona SDK

I'm about to upload a release build to iTunes (which was built with Corona daily build 2419 at 11AM PST), but it looks like Vungle Ads silently fails, so all I see is the backup ads.

 

Could it be that I must wait for the latest plugin build to propagate and added to build server, then generate my release app before Vungle Ads would work as expected?

 

Naomi



[TOPIC: post.html]
#22

jordyn.chuhaloff

[GLOBAL: userInfoPane.html]
jordyn.chuhaloff
  • Enthusiast

  • 49 posts
  • Enterprise

Hi Naomi, 

 

It sounds like you're having a different issue. Please email me at tech-support@vungle.com with a code snippet. I'll want to see the place you init Vungle, play ad, and your build.settings :)

 

Thanks!

Jordyn / Vungle



[TOPIC: post.html]
#23

Naomi

[GLOBAL: userInfoPane.html]
Naomi
  • Corona Geek

  • 2,303 posts
  • Corona SDK

Will do, Jordyn.  Thank you.

 

Naomi



[TOPIC: post.html]
#24

MAS1

[GLOBAL: userInfoPane.html]
MAS1
  • Contributor

  • 279 posts
  • Corona SDK

@Jordyn

 

Any news on 3.0.10 out of QA?



[TOPIC: post.html]
#25

jordyn.chuhaloff

[GLOBAL: userInfoPane.html]
jordyn.chuhaloff
  • Enthusiast

  • 49 posts
  • Enterprise

3.0.10 is out of QA, and we've pushed it to our test repo with Corona. This means that it's likely you'll have access to it today (or maybe tomorrow). It's high on my priority list- I'll be doing the testing in the next hour :)

 

Jordyn / Vungle




[topic_controls]
Page 1 of 2 1 2
 
[/topic_controls]