Project: titanium
Issue TIMOB-18532: iOS: Application crash from advertising content in WebView
h6.Issue Description While attempting to serve ads inside a WebView using Google Publisher Tags with an mRaid payload the app crashes. h6.Steps to replicate Drop the sample code below in app.js and get it to run at device. Reproduced on iPhone 5s iOS 8.1 h6.Sample Code {code} Titanium.UI.setBackgroundColor('#000'); var webview = Titanium.UI.createWebView(); webview.html = '

'; var window = Titanium.UI.createWindow(); window.add(webview); window.open({	modal : true }); {code} h6.Xcode console output 3.5.0.GA SDK {code} Feb 6 10:20:45 iPhone-5s locationd[55] : Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0 Feb 6 10:20:45 iPhone-5s Super.Simple[174] : assertion failed: 12B411: libxpc.dylib + 71820 [AD580443-238D-3997-8D09-004C210D0C18]: 0x7d Feb 6 10:20:45 iPhone-5s Unknown[174] : Feb 6 10:20:45 iPhone-5s Super.Simple[174] : [DEBUG] Reading stylesheet from: /private/var/mobile/Containers/Bundle/Application/BCC4EAE9-12C9-4C43-9635-ED9EFAF4DE50/Super.Simple.app/stylesheet.plist Feb 6 10:20:45 iPhone-5s Super.Simple[174] : [INFO] Super.Simple/1.0 (3.5.0.0014f83) Feb 6 10:20:45 iPhone-5s Super.Simple[174] : [DEBUG] Loading: /private/var/mobile/Containers/Bundle/Application/BCC4EAE9-12C9-4C43-9635-ED9EFAF4DE50/Super.Simple.app/app.js, Resource: app_js Feb 6 10:20:45 iPhone-5s Super.Simple[174] : [DEBUG] Loading: /private/var/mobile/Containers/Bundle/Application/BCC4EAE9-12C9-4C43-9635-ED9EFAF4DE50/Super.Simple.app/_app_props_.json, Resource: _app_props__json Feb 6 10:20:45 iPhone-5s Super.Simple[174] : [DEBUG] Application booted in 133.444965 ms Feb 6 10:20:45 iPhone-5s Super.Simple[174] : [DEBUG] New scheme: { URL: file:///private/var/mobile/Containers/Bundle/Application/BCC4EAE9-12C9-4C43-9635-ED9EFAF4DE50/Super.Simple.app/ } Feb 6 10:20:45 iPhone-5s Super.Simple[174] : [DEBUG] New scheme: { URL: file:///private/var/mobile/Containers/Bundle/Application/BCC4EAE9-12C9-4C43-9635-ED9EFAF4DE50/Super.Simple.app/ } Feb 6 10:20:45 iPhone-5s Super.Simple[174] : [DEBUG] New scheme: { URL: http://tpc.googlesyndication.com/safeframe/1-0-1/html/container.html } Feb 6 10:20:46 iPhone-5s locationd[55] : Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0 Feb 6 10:20:49 iPhone-5s cloudd[156] : (Note ) MC: User has completed cloud configuration. Not showing UI again. Feb 6 10:20:51 iPhone-5s Super.Simple[174] : [ERROR] The application has crashed with an uncaught exception 'NSRangeException'.	Reason:	*** -[__NSCFString substringFromIndex:]: Index 104 out of bounds; string length 103	Stack trace:	0 CoreFoundation 0x000000018409de48 + 132	1 libobjc.A.dylib 0x00000001947900e4 objc_exception_throw + 60	2 CoreFoundation 0x000000018409dd88 + 0	3 Foundation 0x0000000184ea81c0 + 136	4 Super.Simple 0x000000010008060c Super.Simple + 312844	5 Super.Simple 0x0000000100116d04 Super.Simple + 929028	6 CFNetwork 0x0000000183ae8d54 + 72	7 CFNetwork 0x0000000183a02fe0 + 32	8 CFNetwork 0x0000000183a02fa4 + 76	9 CoreFoundation 0x0000000183f80bfc CFArrayApplyFunction + 68	10 CFNetwork 0x0000000183a02e50 + 136	11 CFNetwork 0x0000000183a02d04 + 312	12 CFNetwork 0x0000000183a02b30 + 68	13 CoreFoundation 0x00000001840560e8 + 24	14 CoreFoundation 0x000000018405538c + 264	15 CoreFoundation 0x000000018405343c + 712	16 CoreFoundation 0x0000000183f811f4 CFRunLoopRunSpecific + 396	17 WebCore 0x0000000191b5be08 + 288	18 JavaScriptCore 0x0000000185504b80 + 24	19 libsystem_pthread.dylib 0x0000000194fb3e80 + 164	20 libsystem_pthread.dylib 0x0000000194fb3ddc + 0	21 libsystem_pthread.dylib 0x0000000194fb0fb0 thread_start + 4 Feb 6 10:20:51 iPhone-5s Super.Simple[174] : *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSCFString substringFromIndex:]: Index 104 out of bounds; string length 103'	*** First throw call stack:	(0x18409de48 0x1947900e4 0x18409dd88 0x184ea81c0 0x10008060c 0x100116d04 0x183ae8d54 0x183a02fe0 0x183a02fa4 0x183f80bfc 0x183a02e50 0x183a02d04 0x183a02b30 0x1840560e8 0x18405538c 0x18405343c 0x183f811f4 0x191b5be08 0x185504b80 0x194fb3e80 0x194fb3ddc 0x194fb0fb0) Feb 6 10:20:51 iPhone-5s ReportCrash[176] : task_set_exception_ports(B07, 400, D03, 0, 0) failed with error (4: (os/kern) invalid argument) Feb 6 10:20:51 iPhone-5s ReportCrash[176] : ReportCrash acting against PID 174 Feb 6 10:20:52 iPhone-5s ReportCrash[176] : Formulating crash report for process Super.Simple[174] Feb 6 10:20:52 iPhone-5s mediaserverd[19] : '' com.appc.test(pid = 174) setting DiscoveryMode = DiscoveryMode_None, currentDiscoveryMode = DiscoveryMode_None Feb 6 10:20:52 iPhone-5s com.apple.xpc.launchd[1] (UIKitApplication:com.appc.test[0xc0c5][174]) : Service exited due to signal: Abort trap: 6 Feb 6 10:20:53 iPhone-5s SpringBoard[48] : [MPUSystemMediaControls] Updating supported commands for now playing application. Feb 6 10:20:53 iPhone-5s SpringBoard[48] : [MPUSystemMediaControls] Updating supported commands for now playing application. Feb 6 10:20:53 iPhone-5s SpringBoard[48] : Unable to get short BSD proc info for 174: No such process Feb 6 10:20:53 iPhone-5s SpringBoard[48] : Unable to get short BSD proc info for 174: No such process Feb 6 10:20:53 iPhone-5s ReportCrash[176] : Saved report to /var/mobile/Library/Logs/CrashReporter/Super.Simple_2015-02-06-102051_iPhone-5s.ips Feb 6 10:20:53 iPhone-5s SpringBoard[48] : Application 'UIKitApplication:com.appc.test[0xc0c5]' crashed. Feb 6 10:20:53 iPhone-5s assertiond[58] : pid_suspend failed for : Unknown error: -1, Unknown error: -1 Feb 6 10:20:53 iPhone-5s assertiond[58] : Could not set priority of to 2, priority: No such process Feb 6 10:20:53 iPhone-5s assertiond[58] : Could not set priority of to 4096, priority: No such process Feb 6 10:20:53 iPhone-5s UserEventAgent[17] : id=com.appc.test pid=174, state=0 {code}
Story points: 8