Game with iAds crashes after ads.show() call

Hi,

I want to implement iAds in my game.
It looks pretty simple, however after calling ads.show() my application crashes.

Same thing happens when using sample code.

Here;s the crashlog:

Incident Identifier: 8ECE4911-F550-455B-8D32-7B5346A553ED  
CrashReporter Key: 830ebf1a3dc3173e26195c3debe5ea9ebfab66ec  
Hardware Model: iPad3,3  
Process: iAds [36017]  
Path: /var/mobile/Applications/763CB566-FAAA-43FE-A713-0153D40A3D7B/iAds.app/iAds  
Identifier: iAds  
Version: ??? (???)  
Code Type: ARM (Native)  
Parent Process: launchd [1]  
  
Date/Time: 2013-01-31 14:51:19.836 +0100  
OS Version: iOS 6.0 (10A403)  
Report Version: 104  
  
Exception Type: EXC\_BAD\_ACCESS (SIGBUS)  
Exception Codes: EXC\_ARM\_DA\_ALIGN at 0x656d6172  
Crashed Thread: 0  
  
Thread 0 name: Dispatch queue: com.apple.main-thread  
Thread 0 Crashed:  
0 CoreFoundation 0x387f1d30 CFRetain + 20  
1 CoreFoundation 0x388037e8 +[\_\_NSDictionaryI \_\_new:::::] + 352  
2 CoreFoundation 0x3880363a -[\_\_NSPlaceholderDictionary initWithObjects:forKeys:count:] + 354  
3 CoreFoundation 0x3883a0ce +[NSDictionary dictionaryWithObjects:forKeys:count:] + 46  
4 iAd 0x3b3c2690 -[ADBannerView \_sanitizeAndForwardErrorToDelegate:] + 392  
5 iAd 0x3b3c22b0 -[ADBannerView setDelegate:] + 240  
6 iAds 0x001a2afc 0x9b000 + 1080060  
7 iAds 0x001a26d6 0x9b000 + 1078998  
8 iAds 0x001a24c6 0x9b000 + 1078470  
9 iAds 0x0011844a 0x9b000 + 513098  
10 iAds 0x0012554e 0x9b000 + 566606  
11 iAds 0x00118576 0x9b000 + 513398  
12 iAds 0x00112098 0x9b000 + 487576  
13 iAds 0x00125818 0x9b000 + 567320  
14 iAds 0x001187a2 0x9b000 + 513954  
15 iAds 0x00112070 0x9b000 + 487536  
16 iAds 0x0013ad56 0x9b000 + 654678  
17 iAds 0x00130d66 0x9b000 + 613734  
18 iAds 0x00130d7a 0x9b000 + 613754  
19 iAds 0x0013425a 0x9b000 + 627290  
20 iAds 0x0013470c 0x9b000 + 628492  
21 iAds 0x00134374 0x9b000 + 627572  
22 iAds 0x001346ae 0x9b000 + 628398  
23 iAds 0x0014ee76 0x9b000 + 736886  
24 iAds 0x000d2c46 0x9b000 + 228422  
25 UIKit 0x39695ad2 forwardTouchMethod + 230  
26 UIKit 0x39695ad2 forwardTouchMethod + 230  
27 UIKit 0x395675f4 -[UIWindow \_sendTouchesForEvent:] + 520  
28 UIKit 0x39554804 -[UIApplication sendEvent:] + 376  
29 UIKit 0x3955411e \_UIApplicationHandleEvent + 6150  
30 GraphicsServices 0x3828c5a0 \_PurpleEventCallback + 588  
31 GraphicsServices 0x3828c1ce PurpleEventCallback + 30  
32 CoreFoundation 0x38887170 \_\_CFRUNLOOP\_IS\_CALLING\_OUT\_TO\_A\_SOURCE1\_PERFORM\_FUNCTION\_\_ + 32  
33 CoreFoundation 0x38887112 \_\_CFRunLoopDoSource1 + 134  
34 CoreFoundation 0x38885f94 \_\_CFRunLoopRun + 1380  
35 CoreFoundation 0x387f8eb8 CFRunLoopRunSpecific + 352  
36 CoreFoundation 0x387f8d44 CFRunLoopRunInMode + 100  
37 GraphicsServices 0x3828b2e6 GSEventRunModal + 70  
38 UIKit 0x395a82fc UIApplicationMain + 1116  
39 iAds 0x0009d3ba 0x9b000 + 9146  
40 iAds 0x0009d374 0x9b000 + 9076  
  
Thread 1:  
0 libsystem\_kernel.dylib 0x33ebed98 \_\_workq\_kernreturn + 8  
1 libsystem\_c.dylib 0x37f3dcf6 \_pthread\_workq\_return + 14  
2 libsystem\_c.dylib 0x37f3da12 \_pthread\_wqthread + 362  
3 libsystem\_c.dylib 0x37f3d8a0 start\_wqthread + 4  
  
Thread 2 name: Dispatch queue: com.apple.libdispatch-manager  
Thread 2:  
0 libsystem\_kernel.dylib 0x33eae648 kevent64 + 24  
1 libdispatch.dylib 0x3ab84974 \_dispatch\_mgr\_invoke + 792  
2 libdispatch.dylib 0x3ab84654 \_dispatch\_mgr\_thread$VARIANT$mp + 32  
  
Thread 3:  
0 libsystem\_kernel.dylib 0x33ebed98 \_\_workq\_kernreturn + 8  
1 libsystem\_c.dylib 0x37f3dcf6 \_pthread\_workq\_return + 14  
2 libsystem\_c.dylib 0x37f3da12 \_pthread\_wqthread + 362  
3 libsystem\_c.dylib 0x37f3d8a0 start\_wqthread + 4  
  
Thread 4 name: WebThread  
Thread 4:  
0 libsystem\_kernel.dylib 0x33eadeb4 mach\_msg\_trap + 20  
1 libsystem\_kernel.dylib 0x33eae048 mach\_msg + 36  
2 CoreFoundation 0x38887040 \_\_CFRunLoopServiceMachPort + 124  
3 CoreFoundation 0x38885d9e \_\_CFRunLoopRun + 878  
4 CoreFoundation 0x387f8eb8 CFRunLoopRunSpecific + 352  
5 CoreFoundation 0x387f8d44 CFRunLoopRunInMode + 100  
6 WebCore 0x35e68a70 \_ZL12RunWebThreadPv + 440  
7 libsystem\_c.dylib 0x37f4830e \_pthread\_start + 306  
8 libsystem\_c.dylib 0x37f481d4 thread\_start + 4  
  
Thread 5 name: com.apple.NSURLConnectionLoader  
Thread 5:  
0 libsystem\_kernel.dylib 0x33eadeb4 mach\_msg\_trap + 20  
1 libsystem\_kernel.dylib 0x33eae048 mach\_msg + 36  
2 CoreFoundation 0x38887040 \_\_CFRunLoopServiceMachPort + 124  
3 CoreFoundation 0x38885d9e \_\_CFRunLoopRun + 878  
4 CoreFoundation 0x387f8eb8 CFRunLoopRunSpecific + 352  
5 CoreFoundation 0x387f8d44 CFRunLoopRunInMode + 100  
6 Foundation 0x35191bc8 +[NSURLConnection(Loader) \_resourceLoadLoop:] + 304  
7 Foundation 0x35215678 \_\_NSThread\_\_main\_\_ + 968  
8 libsystem\_c.dylib 0x37f4830e \_pthread\_start + 306  
9 libsystem\_c.dylib 0x37f481d4 thread\_start + 4  
  
Thread 6:  
0 libsystem\_kernel.dylib 0x33ebed98 \_\_workq\_kernreturn + 8  
1 libsystem\_c.dylib 0x37f3dcf6 \_pthread\_workq\_return + 14  
2 libsystem\_c.dylib 0x37f3da12 \_pthread\_wqthread + 362  
3 libsystem\_c.dylib 0x37f3d8a0 start\_wqthread + 4  
  
Thread 7:  
0 libsystem\_kernel.dylib 0x33ebed98 \_\_workq\_kernreturn + 8  
1 libsystem\_c.dylib 0x37f3dcf6 \_pthread\_workq\_return + 14  
2 libsystem\_c.dylib 0x37f3da12 \_pthread\_wqthread + 362  
3 libsystem\_c.dylib 0x37f3d8a0 start\_wqthread + 4  
  
Thread 8 name: com.apple.CFSocket.private  
Thread 8:  
0 libsystem\_kernel.dylib 0x33ebe594 \_\_select + 20  
1 CoreFoundation 0x3888b1f2 \_\_CFSocketManager + 674  
2 libsystem\_c.dylib 0x37f4830e \_pthread\_start + 306  
3 libsystem\_c.dylib 0x37f481d4 thread\_start + 4  
  
Thread 0 crashed with ARM Thread State (32-bit):  
 r0: 0x656d6172 r1: 0x00000000 r2: 0x00000000 r3: 0x00000000  
 r4: 0x656d6172 r5: 0x1cda8e28 r6: 0x00000003 r7: 0x2fd642f4  
 r8: 0x00000002 r9: 0x00000039 r10: 0x2fd64370 r11: 0x3d03cba8  
 ip: 0x387fca49 sp: 0x2fd642f0 lr: 0x388037ed pc: 0x387f1d30  
 cpsr: 0x200f0030  

There were few times when app didn’t crash, but my listener got an error event with this description:

response : The operation couldn’t be completed. Ad inventory unavailable  

Any ideas on what could have gone wrong?

I was testing on a device. [import]uid: 109453 topic_id: 35485 reply_id: 335485[/import]

Funny thing… it works ok on xcode simulator.
Still… crashes on a device :confused:
I was testing it using iPad 3, app build as iPhone only [import]uid: 109453 topic_id: 35485 reply_id: 141031[/import]

In my test crash on iPad but not crash on iPhone. Apple rejected my iPhone (not iPad) game because it’s crashed on iPad used for test by Apple’s team review.

Sorry for my bad english.

In past days I send to Apple a version of my game with iAd disabled if used on iPad. [import]uid: 96930 topic_id: 35485 reply_id: 141040[/import]

khadgar: thanks man… I’m wondering if this is common?
I’m not building universal app. I have separate version for ipad and separate for phones [ios/android].
I’m wondering if the ipad version will crash as well on ipad, I didn;t implement ads in that branch yet though. [import]uid: 109453 topic_id: 35485 reply_id: 141043[/import]

I do not know but for now suspected to have problems on the iPad, sure. [import]uid: 96930 topic_id: 35485 reply_id: 141045[/import]

Hi @krystian6 and @khadgar1,

We have verified that this is a bug. The iAds sample app crashes when you build for iPhone only and run it on an iPad.

@krystian6, can you please submit this as a bug report using the link below? You don’t need to provide a sample project, as the symptoms are shown in the Corona iAds sample app. But, by submitting the bug yourself, you’ll get a case number when it goes into the bug database, and you can track it.
http://developer.coronalabs.com/content/bug-submission

Sincerely,
Brent Sorrentino [import]uid: 200026 topic_id: 35485 reply_id: 141109[/import]

Bug submitted: Case 20620
Hope you can tackle it soon. [import]uid: 109453 topic_id: 35485 reply_id: 141155[/import]

Funny thing… it works ok on xcode simulator.
Still… crashes on a device :confused:
I was testing it using iPad 3, app build as iPhone only [import]uid: 109453 topic_id: 35485 reply_id: 141031[/import]

In my test crash on iPad but not crash on iPhone. Apple rejected my iPhone (not iPad) game because it’s crashed on iPad used for test by Apple’s team review.

Sorry for my bad english.

In past days I send to Apple a version of my game with iAd disabled if used on iPad. [import]uid: 96930 topic_id: 35485 reply_id: 141040[/import]

khadgar: thanks man… I’m wondering if this is common?
I’m not building universal app. I have separate version for ipad and separate for phones [ios/android].
I’m wondering if the ipad version will crash as well on ipad, I didn;t implement ads in that branch yet though. [import]uid: 109453 topic_id: 35485 reply_id: 141043[/import]

I do not know but for now suspected to have problems on the iPad, sure. [import]uid: 96930 topic_id: 35485 reply_id: 141045[/import]

Hi @krystian6 and @khadgar1,

We have verified that this is a bug. The iAds sample app crashes when you build for iPhone only and run it on an iPad.

@krystian6, can you please submit this as a bug report using the link below? You don’t need to provide a sample project, as the symptoms are shown in the Corona iAds sample app. But, by submitting the bug yourself, you’ll get a case number when it goes into the bug database, and you can track it.
http://developer.coronalabs.com/content/bug-submission

Sincerely,
Brent Sorrentino [import]uid: 200026 topic_id: 35485 reply_id: 141109[/import]

Bug submitted: Case 20620
Hope you can tackle it soon. [import]uid: 109453 topic_id: 35485 reply_id: 141155[/import]