Bug 19627 - (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain in Array.cs on Line 159
Summary: (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain i...
Status: RESOLVED INVALID
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 7.2.2
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-05-08 16:44 UTC by Jamie Mellway
Modified: 2014-05-13 06:35 UTC (History)
2 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 INVALID

Description Jamie Mellway 2014-05-08 16:44:26 UTC
(Similar to Bug 19198)

I get consistent crashes after I updated Xamarin.iOS.  I upgraded to 7.2.2.2 and I needed to add the "--registrar:legacy" mtouch argument.  The application works fine in Debug on my iPad Mini, but it crashes every time after 3:14 seconds (4x) or 5:17 seconds (1x) when deployed from TestFlight.  I got someone else who still has Xamarin.iOS 7.0.5.2 installed to deploy (after removing the mtouch argument) and that build is stable.

SIGPIPE
IllumitaskBriefiOS(wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain 
in Array.cs on Line 159
#	Binary Image Name	Address	Symbol
0	IllumitaskBriefiOS	0x0008cfc0	testflight_backtrace
1	IllumitaskBriefiOS	0x0008c878	TFSignalHandler
2	libsystem_platform.dylib	0x3aa65f92	_sigtramp
3	libsystem_kernel.dylib	0x3a9ee858	mach_msg
4	CoreFoundation	0x2f84189a	__CFRunLoopServiceMachPort
5	CoreFoundation	0x2f840006	__CFRunLoopRun
6	CoreFoundation	0x2f7aaf4e	CFRunLoopRunSpecific
7	CoreFoundation	0x2f7aad32	CFRunLoopRunInMode
8	GraphicsServices	0x346d0662	GSEventRunModal
9	UIKit	0x320f616c	UIApplicationMain
10	IllumitaskBriefiOS	0x0018fa9b	(wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain in Array.cs on Line 159
11	IllumitaskBriefiOS	0x0013b1cb	MonoTouch.UIKit.UIApplication:Main in .pmcs-compat.UIApplication.cs on Line 75
12	IllumitaskBriefiOS	0x00093903	Illumitask.Brief.Application:Main in on Line 1
13	IllumitaskBriefiOS	0x0035feb7	wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr
14	IllumitaskBriefiOS	0x00efb948	mono_jit_runtime_invoke in mini.c on Line 6716
15	IllumitaskBriefiOS	0x00f458c0	mono_runtime_invoke in object.c on Line 2828
16	IllumitaskBriefiOS	0x00f497e2	mono_runtime_exec_main in object.c on Line 4085
17	IllumitaskBriefiOS	0x00f4962a	mono_runtime_run_main in object.c on Line 3711
18	IllumitaskBriefiOS	0x00ee5154	mono_jit_exec in driver.g.c on Line 1009
19	IllumitaskBriefiOS	0x00f8fbf7	main in main.m on Line 486
20	libdyld.dylib	0x3a94bab6	start
Comment 1 Rolf Bjarne Kvinge [MSFT] 2014-05-09 02:20:39 UTC
Can you attach your project so that we can have a look at it?
Comment 2 Jamie Mellway 2014-05-09 13:14:39 UTC
Unfortunately the client will not allow me to post the project (even privately).
Comment 3 Jamie Mellway 2014-05-09 13:58:31 UTC
I've reverted my machine back to Xamarin.iOS 7.0.5.2 and it is stable.
Comment 4 Rolf Bjarne Kvinge [MSFT] 2014-05-12 06:18:45 UTC
> I upgraded to 7.2.2.2 and I needed to add the "--registrar:legacy" mtouch argument. 

Why did you need this? Did you get any errors (if so, which ones?)

> The application works fine in Debug on my iPad Mini, but it crashes every time after 3:14
> seconds (4x) or 5:17 seconds (1x) when deployed from TestFlight.

Can you try duplicating the project configuration from your TestFlight build to your Debug build and see if you can find out why one works and the other doesn't? The most important relevant project options are the ones in the Build/iOS Build page.
Comment 5 Jamie Mellway 2014-05-12 13:24:30 UTC
>Why did you need this? Did you get any errors (if so, which ones?)

I added --registrar:legacy since in 7.2.1 the new registrars are enabled by default.  We have in two spots: 

[Export("panned")]

public void DragContentView(UIPanGestureRecognizer panGesture)


This gives the compile error: 
Error MT4117: The registrar found a signature mismatch in the method '[namespace].[classname].DragContentView' - the selector 'panned' indicates the method takes 0 parameters, while the managed method has 1 parameters. (MT4117) (Brief.iOS)

I first attempted to add a colon so it is [Export("panned:")] which compiles but crashes the application on a swipe:

-[MainViewController panned]: unrecognized selector sent to instance 0x1904ce90

MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown.  Name: NSInvalidArgumentException Reason: -[MainViewController panned]: unrecognized selector sent to instance 0x1904ce90
  at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/.pmcs-compat.UIApplication.cs:38 

So, I went with the legacy registrar.

> Can you try duplicating the project configuration from your TestFlight build to
> your Debug build and see if you can find out why one works and the other
> doesn't? The most important relevant project options are the ones in the
> Build/iOS Build page
> The differences in the Build/iOS Build are:

Debug: Enabled debugging, ARMv7+ARMv7s, SGen
Ad-Hoc: ARMv7

Now that I've updated Xamarin.iOS back to 7.2.2.2, I cannot seem to reproduce the crash with new builds.  I dunno if reverting to 7.0.5.2 and then updating to 7.2.2.2 cleaned something out or not, but it is now working.  The code hasn't changed.
Comment 6 Rolf Bjarne Kvinge [MSFT] 2014-05-13 06:35:21 UTC
(In reply to comment #5)
> >Why did you need this? Did you get any errors (if so, which ones?)
> 
> I added --registrar:legacy since in 7.2.1 the new registrars are enabled by
> default.  We have in two spots: 
> 
> [Export("panned")]
> 
public void DragContentView(UIPanGestureRecognizer panGesture)

> 
> This gives the compile error: 
> Error MT4117: The registrar found a signature mismatch in the method
> '[namespace].[classname].DragContentView' - the selector 'panned' indicates the
> method takes 0 parameters, while the managed method has 1 parameters. (MT4117)
> (Brief.iOS)
> 
> I first attempted to add a colon so it is [Export("panned:")] which compiles
> but crashes the application on a swipe:
> 
> -[MainViewController panned]: unrecognized selector sent to instance 0x1904ce90

You're using "panned" somewhere else in your code as well, you need to change all "panned" string constants into "panned:".

> > Can you try duplicating the project configuration from your TestFlight build to
> > your Debug build and see if you can find out why one works and the other
> > doesn't? The most important relevant project options are the ones in the
> > Build/iOS Build page
> > The differences in the Build/iOS Build are:
> 
> Debug: Enabled debugging, ARMv7+ARMv7s, SGen
> Ad-Hoc: ARMv7
> 
> Now that I've updated Xamarin.iOS back to 7.2.2.2, I cannot seem to reproduce
> the crash with new builds.  I dunno if reverting to 7.0.5.2 and then updating
> to 7.2.2.2 cleaned something out or not, but it is now working.  The code
> hasn't changed.

OK, I'm closing this bug report then. Feel free to reopen if the same issue shows up again.