Bug 13762 - iOS Unit Tests Project EXC_BAD_ACCESS involving UIWebView
Summary: iOS Unit Tests Project EXC_BAD_ACCESS involving UIWebView
Status: RESOLVED UPSTREAM
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 6.4.0
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-08-05 15:52 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2017-03-20 18:57 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Test case (3.19 KB, application/zip)
2013-08-05 15:52 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Details
Full crash log (77.01 KB, application/octet-stream)
2013-08-05 15:53 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Details
Version info (1.19 KB, text/plain)
2013-08-05 15:57 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED UPSTREAM

Description Brendan Zagaeski (Xamarin Team, assistant) 2013-08-05 15:52:28 UTC
Created attachment 4544 [details]
Test case

## Steps to reproduce
1. Create a new iOS Unit Tests Project (or used the attached example).
2. *From Xamarin Studio* run the project on the simulator (I haven't tried on device). It seems to be easier to produce the crash with Debugging on, but it's possible to produce it without debugging.
3. Select "Credits".
4. Select "About Xamarin". I can produce the crash using just "About MonoTouch" or "About Font Awesome" too. I haven't tried the others.
5. Go back using the "Credits" button.
6. Repeat steps 4 and 5 a few times. The delay between steps 4 and 5 seems to be important.

http://screencast.com/t/opCQxmIa

If I run the app by clicking the icon on the simulator instead of via Xamarin Studio, I cannot produce the problem.


## Result
The application crashes with a SIGSEGV

### Crash log excerpt
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	0x9be0d9c6 __pthread_kill + 10
1   libsystem_c.dylib             	0x92e60f78 pthread_kill + 106
2   libsystem_sim_c.dylib         	0x0425d57b abort + 140
3   UnitTestTest                  	0x000b0c52 mono_handle_native_sigsegv + 562
4   UnitTestTest                  	0x00054215 mono_arch_handle_altstack_exception + 149
5   UnitTestTest                  	0x000df371 mono_sigsegv_signal_handler + 369
6   libsystem_c.dylib             	0x92eb659b _sigtramp + 43
7   ???                           	0xffffffff 0 + 4294967295
8   UnitTestTest                  	0x000df200 mono_sigill_signal_handler + 48
9   UIKit                         	0x029768c9 -[UIWebViewWebViewDelegate webView:identifierForInitialRequest:fromDataSource:] + 63
10  CoreFoundation                	0x0138d1bd __invoking___ + 29
11  CoreFoundation                	0x0138d0d6 -[NSInvocation invoke] + 342
12  CoreFoundation                	0x0138d24a -[NSInvocation invokeWithTarget:] + 74
13  WebKit                        	0x06bf26a1 -[_WebSafeForwarder forwardInvocation:] + 257


### Application Output
mono-rt:   at <unknown> <0xffffffff>
mono-rt:   at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <IL 0x0009f, 0xffffffff>
mono-rt:   at MonoTouch.UIKit.UIApplication.Main (string[],string,string) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:38
mono-rt:   at UnitTestTest.Application.Main (string[]) [0x00008] in /User/USER/Projects/UnitTestTest/UnitTestTest/Main.cs:16
mono-rt:   at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff>

mono-rt: 
Native stacktrace:

mono-rt: 
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================
Comment 1 Brendan Zagaeski (Xamarin Team, assistant) 2013-08-05 15:53:51 UTC
Created attachment 4545 [details]
Full crash log
Comment 2 Brendan Zagaeski (Xamarin Team, assistant) 2013-08-05 15:57:26 UTC
Created attachment 4546 [details]
Version info
Comment 3 Vincent Dondain [MSFT] 2017-03-20 18:57:41 UTC
Hi Brendan,

I cannot reproduce this bug anymore, the TouchRunner is working fine for me now with this environment: https://gist.github.com/VincentDondain/c2d17d736188b6079728d4933ca0491c

I assume this have been fixed upstream.

As a side note: the UI Test templates are not using this runner anymore.