Bug 3409 - Overriding TouchesBegan causes SIGEGV
Summary: Overriding TouchesBegan causes SIGEGV
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 5.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-02-11 17:03 UTC by Ian
Modified: 2012-02-19 00:04 UTC (History)
3 users (show)

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

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 FIXED

Description Ian 2012-02-11 17:03:33 UTC
I create a view and add it to a master view. 

Monotouch: 5.2.3

When I add this override with nothing in it, I get a SIGSEGV when the control is tapped. When I remove it, all is well. Not sure what's causing it.

		public override void TouchesBegan (NSSet touches, UIEvent evt)
		{
			base.TouchesBegan (touches, evt);
                }   


GoldSilver(4464,0xacd3f2c0) malloc: *** error for object 0x9d89474: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
GoldSilver(4464,0xacd3f2c0) malloc: *** error for object 0x9d89364: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
GoldSilver(4464,0xacd3f2c0) malloc: *** error for object 0x9d89074: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
Stacktrace:

  at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <IL 0x0009f, 0xffffffff>
  at MonoTouch.UIKit.UIApplication.Main (string[],string,string) [0x00042] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:29
  at General.Application.Main (string[]) [0x00000] in /Users/vink/Dropbox/Dev/iOS/UNIVERSAL/GoldSilver/GoldSilver/Main.cs:14
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff>

Native stacktrace:

	0   GoldSilver                          0x00090b7c mono_handle_native_sigsegv + 284
	1   GoldSilver                          0x00005f28 mono_sigsegv_signal_handler + 248
	2   libsystem_c.dylib                   0x9857559b _sigtramp + 43
	3   ???                                 0xffffffff 0x0 + 4294967295
	4   GraphicsServices                    0x0478afa9 PurpleEventCallback + 1274
	5   CoreFoundation                      0x011951c5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
	6   CoreFoundation                      0x010fa022 __CFRunLoopDoSource1 + 146
	7   CoreFoundation                      0x010f890a __CFRunLoopRun + 2218
	8   CoreFoundation                      0x010f7db4 CFRunLoopRunSpecific + 212
	9   CoreFoundation                      0x010f7ccb CFRunLoopRunInMode + 123
	10  GraphicsServices                    0x04789879 GSEventRunModal + 207
	11  GraphicsServices                    0x0478993e GSEventRun + 114
	12  UIKit                               0x02190a9b UIApplicationMain + 1175
	13  ???                                 0x0e4bd7fd 0x0 + 239851517
	14  ???                                 0x0cff5ea0 0x0 + 218062496
	15  ???                                 0x0cff5b98 0x0 + 218061720
	16  ???                                 0x0cff5cee 0x0 + 218062062
	17  GoldSilver                          0x0000a292 mono_jit_runtime_invoke + 722
	18  GoldSilver                          0x0016a17e mono_runtime_invoke + 126
	19  GoldSilver                          0x0016e264 mono_runtime_exec_main + 420
	20  GoldSilver                          0x00173685 mono_runtime_run_main + 725
	21  GoldSilver                          0x00067495 mono_jit_exec + 149
	22  GoldSilver                          0x002116c9 main + 2825
	23  GoldSilver                          0x000032e5 start + 53
	24  ???                                 0x00000005 0x0 + 5

=================================================================
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 Rolf Bjarne Kvinge [MSFT] 2012-02-13 07:36:18 UTC
I just created a new project from a templated and overrode TouchesBegan in the view, and it didn't crash, neither on a device nor in the simulator. Can you provide a test project where this happens for you?
Comment 2 Ian 2012-02-13 12:05:58 UTC
It appears to be related to a much bigger issue related to Bug 3425

None of my apps work any more.
Comment 3 Miguel de Icaza [MSFT] 2012-02-18 22:54:09 UTC
Hello Ian,

This seems like you are running your application with the iOS 4.3 SDK instead of the iOS 5.0 SDK.

The fix is to make the iPhone simulator default to the iOS 5 SDK.

The only way I have found to change the simulator version is to wait for the
simulator crash and then a dialog is shown that offers you to pick a different
SDK:

[Swtich SDKs]

And then pick the 5.0 version.

I do not know how to do this programmatically, other than waiting for the
crash.
Comment 4 Ian 2012-02-19 00:04:42 UTC
I removed xcode, reinstalled it and it works fine now.