Bug 28203 - Delegate methods that return structs cause issues in 64-bit mobile profile
Summary: Delegate methods that return structs cause issues in 64-bit mobile profile
Status: RESOLVED FIXED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Library (Xamarin.Mac.dll) ()
Version: 1.12.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Chris Hamons
URL:
Depends on:
Blocks:
 
Reported: 2015-03-19 13:13 UTC by Curtis Wensley
Modified: 2015-03-20 10:47 UTC (History)
2 users (show)

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


Attachments
Sample to reproduce the issue (15.39 KB, application/zip)
2015-03-19 13:48 UTC, Curtis Wensley
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 FIXED

Description Curtis Wensley 2015-03-19 13:13:57 UTC
Currently you cannot create unified Xamarin.Mac apps in 64-bit that target the mobile profile (which is currently the only supported way of creating 64-bit apps I believe?).  This does not happen when targeting the full net45 profile.

To reproduce, create a new Xamarin.Mac unified application, then add the following line to AppDelegate.DidFinishLaunching:

mainWindowController.Window.WillClose += (sender, e) => Console.WriteLine("Woo");

Run the program and try resizing the form - it disappears.  From my testing, this is because the WillResize delegate method gets called, but the return value is not properly returned.

I've attached a full sample as well.
Comment 1 Curtis Wensley 2015-03-19 13:48:26 UTC
Created attachment 10415 [details]
Sample to reproduce the issue
Comment 2 Ram Chandra 2015-03-20 07:45:45 UTC
I have checked this issue and with the help of attached project I am able to reproduce the reported behavior.

Screencast: http://www.screencast.com/t/fq7JmSYMW

IDE Log : https://gist.github.com/Udham1/8d61691c52e1f0e1ec41

Environment Info:

=== Xamarin Studio ===

Version 5.8.1 (build 8)
Installation UUID: ce927b2a-2c07-44c5-b186-09cfdafba6dc
Runtime:
	Mono 3.12.1 ((detached/b63df7d)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312010002

=== Apple Developer Tools ===

Xcode 6.2 (6776)
Build 6C131e

=== Xamarin.iOS ===

Version: 8.8.1.9 (Business Edition)
Hash: 7e1f69e
Branch: 
Build date: 2015-03-12 15:35:49-0400

=== Xamarin.Android ===

Version: 4.20.1.0 (Business Edition)
Android SDK: /Users/xamarin76/Desktop/android-sdk-macosx
	Supported Android versions:
		1.6    (API level 4)
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Xamarin.Mac ===

Version: 1.12.0.14 (Business Edition)

=== Build Information ===

Release ID: 508010008
Git revision: f8e52bf493869b6a320a95400553dc9ea8b7ef22
Build date: 2015-03-13 16:16:49-04
Xamarin addins: 84d611cc17567a68daad719327e90af06d2ae327

=== Operating System ===

Mac OS X 10.9.5
Darwin Xamarin76s-Mac-mini.local 13.4.0 Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
Comment 3 Chris Hamons 2015-03-20 10:47:47 UTC
Curtis - We _just_ actually found this ourselves earlier this week. There was s subtle registar marshaling bug that is only hit on 64-bit, and only in some cases (as you found).

Try this package:

https://www.dropbox.com/s/1rd58s01mmhgd5m/xamarin.mac-1.12.0.15-registar-fix.pkg?dl=0

That has a fix that fixes it for me. I'm going to post a link on the forum for this fix. It will be fixed in XM 2.0, which should be hitting alpha within a week or two.