Vungle causing crash on app resume from suspend?

I’m getting a reliably repeatable crash on iOS devices after showing a Vungle ad with audio.   After the Vungle ad (full screen interstitial video) has completed it returns to my game.  If any time after that I suspend my app by pressing the ‘home’ key, then resume the game, it crashes with a seg. fault 11 error in the console.  

The reason I suspect it’s related to Vungle audio is because i hear the audio from the old ad play again for about 1/2 second before the crash.  I have a listener function for the ‘resume’ event where I do an audio.resume for my game’s audio that was paused by the suspend, so perhaps Vungle is not cleaning up it’s audio properly after playing the ad.  To be clear, I’m letting the ad finish and my game continue as normal before I initiate the suspend/resume that triggers the crash.

If I suspend/resume my app before the first Vungle ad plays it doesn’t crash.

This is using daily build 1198 and tested on an iPhone 5.  I haven’t tested on Android yet.

I’m wondering if anyone who is using Vungle can try suspending/resuming their app after a Vungle ad plays and see if they get a similar crash or not?

EDIT:

Additional output from the console log at time of crash, so definitely something to do with audio:

<Warning>:  Job appears to have crashed: Segmentation fault: 11

<Warning>: Application exited abnormally with signal 11: Segmentation fault: 11

 <Error>: 12:35:24.264 <AudioControl> AudioSessionSetClientPlayState(4166): cannot get ClientInfo

<Error>: 12:35:24.266 <AudioControl> AudioQueue: Error ‘ini?’ from AudioSessionSetClientPlayState(4166)

<Error>: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary

I should also mention that I have to manually pause audio in my game while playing a Vungle ad, otherwise the audio from the ad and the app play over each other and sounds like a mess.  So I then have to manually audio.resume in a vungle ad listener when it encounters an adEnd event.   This all seems to work fine, except for this crash after a pause/resume of the app after showing an ad.

EDIT 2:

I also get the same crash if I pause/resume my game while the ad is playing.  If anybody has a live app on the appstore that uses Vungle ads I’d be happy to download and test to see if it crashes with Vungle ads.

I just tested the Vungle sample app on the Xcode simulator and is also crashes if I do a suspend/resume after the ad plays. So it is a bug unrelated to my code and will likely crash any Corona app using the Vungle plugin to display ads.  

Since this is a third party plugin what is the process for getting this bug the attention it needs?

Hey, @HardBoiledIndustries, try sending email to tech-support@vungle.com with details and mention Corona SDK plugin.  Based on my experience, they are very responsive.

Naomi

Thanks Naomi, I did manage to find that tech support email on their site (I think the link to it from Corona’s docs is incorrect).  Hopefully I’ll hear back from them soon.

I’m curious if you are using Vungle in any of your apps, live or not, and if you’re able to reproduce the crash I describe.  Since I was able to crash their sample app I’m afraid it could be a problem that affects anyone using the current Vungle plugin.  Would love to be proved wrong.

-Stephen

Hi Stephen,

Thanks for highlighting this.  I’ve just experienced this issue in daily build 1202, iPhone 5 running iOS 6.1.

I don’t remember having an issue like this a few weeks ago, so I suspect that Vungle updated their plugin behind-the-scenes, introducing this bug.  It points to the importance of getting changelogs for the plugins, which currently we don’t get.

  • Andrew

Hi Andrew,

Thanks for the confirmation.  I got an auto response from Vungle that they received my email to support so fingers crossed they will respond and push out a fix soon.

It’s not exactly a change log but I found the github where they are hosting the plugin code.  It indicates the last update occurred 5 days ago (to fix an Android issue that seems unrelated to this bug).  

https://github.com/Vungle/coronaplugin-release

I agree we need more transparency wrt plugin updates.  As we rely more and more on third party plugins it could get messy not knowing if a plugin has been updated and potentially introducing a new bug, especially if the third party doesn’t have a presence on these forums.  And we can’t roll back to a previous version if a problem is discovered.

Hi Stephen,

Glad we’re in agreement about the need for more transparency when third-party plugins change.  I started a thread about it here: http://forums.coronalabs.com/topic/39238-plugin-changelogs-and-regression-bugs/.

  • Andrew

I agree with both of you, Stephen @HardBoiledIndustries and Andrew @aukStudios.

BTW, the issue you posted, Stephen, is not present on Android device.  I’ll let you know how it goes on my end once I had a chance to test this issue on iOS device.

Let’s hope you’ll hear back from Vungle tech person soon.

Naomi

FYI, I just tried rebuilding my app using daily build 1190, and the crash didn’t occur, whereas it does occur in build 1202.  This suggests that plugin versions are indeed tied to daily build versions, which answers one of the questions I raised in the other thread: http://forums.coronalabs.com/topic/39238-plugin-changelogs-and-regression-bugs/.

  • Andrew

Ah, good to know.  Thank you, Andrew, for verifying this.  So it sounds like it’s iOS specific issue.  Let’s hope it gets fixed right away.

Naomi

Actually, I spoke too soon.  I can get the crash to occur in build 1190 too, and also in build 1179.  The reason I at first didn’t reproduce it in 1190 is because I waited for the ad to finish, closed it, and then suspended and resumed.  When doing it this way, I can’t reproduce the crash consistently.  But now I’m testing by suspending during the Vungle ad, which does seem to reproduce the crash consistently.

  • Andrew

Thank you for following up, Andrew.  I tested both ways on Android device, and it didn’t crash.  So it’s definitely iOS specific issue.  Too bad, so plugin update will affect all versions of Corona then…

Naomi

I’m not sure that a plugin update will affect all previous Corona builds though.  Even though I’m now able to reproduce this crash going back to build 1179, it’s possible that it already existed then, and we just never noticed it until now.  We’ll need to get clarification on how it works from the Corona team in the other thread.

  • Andrew

Yeah, I just tested on build 1185 and it still exhibited the crash.  I was also able to crash the Vungle Sample app on the Xcode simulator with the older version of Corona.  Here’s the link to the sample app:

https://github.com/Vungle/coronaplugin-release/tree/master/samples

To see the crash simply build the sample for the Xcode simulator.  Open the app and let it load and play an ad.  Once the ad is finished (When I tested it with various builds of Corona it didn’t matter if the ad finished or not, it would still crash) , suspend the app by hitting the virtual home key.  Then reopen the app.  Within about 5 seconds the app will crash.

My assumption is the plugins are not associated with a particular version of Corona and we always get the latest plugin when we fire up any version of Corona, but it would be good to get some official confirmation from someone at CL to know how it actually works.

Also, this could very well be Corona Labs’ bug.  The plugin might have worked against some previous build that Vungle used to create the plugin but there could have been a regression bug in a later version of Corona that broke the plugin.   Still, without transparency or communication (hello Corona Labs?  Mr. Vungle?)  we’re in the dark.

Also, just to confirm Naomi’s findings, I couldn’t get the same crash on an Android device so so far it looks like an iOS specific issue.

Well, so far 3 days and several emails to tech-support@vungle.com and I have yet to get a response.  Not exactly building up my confidence in the viability of this “featured partner” of Corona.   It’s too bad because the video interstitials seemed to be of high quality.  I guess I’ll have to rip Vungle out and use a different ad provider  :unsure:

And… cue the response from tech support:

Apologies for the delay in response – we’ve actually had a number of
these problems come through in the last few days. It stems from a recent
change we made to the underlying iOS SDK in order to ensure
compatibility with iOS 7, and it seems to have broken the Corona plugin
for a number of publishers.

We’re planning on rolling out an update by the end of the week.

Whew!  

Thanks for the update, Stephen @HardBoiledIndustries.  Glad to hear it is being addressed.

Naomi

I see that there was an update to Vungle Plugin a day ago:

https://github.com/Vungle/coronaplugin-release

I wonder if it is deployed already, and whether or not it fixed the issue with iOS version.  

FYI, I am just about ready to upload an update to Google Play, and so far, I haven’t seen any issue with Vungle on Android device – and I’ve done tons and tons of testing.  In fact, I’m just about ready to to feel sick doing this whole back key & home key, and various combination thereof while video is playing as well as after the video ends.

In other words, the latest vungle plugin update probably didn’t affect Android version (which is a good thing.)

Naomi

@Naomi, this is probably I stupid question, but do we need to do anything to “update” Vungle? I will assume not since it is a plugin and so the update is done for us?

I still need to check if the issue raised by hardboiledegg has been resolved since I am preparing a new update with all the ad networks implemented (Vungle,Chartboost and Revmob)

Thanks a lot.

Mo