Bug 22714 - [Xamarin.Mac 1.10] Enabling bundling causes "EntryPointNotFoundException" for xamarin_IntPtr_objc_msgSend_IntPtr()
Summary: [Xamarin.Mac 1.10] Enabling bundling causes "EntryPointNotFoundException" for...
Status: VERIFIED FIXED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: mmp ()
Version: 1.10.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Chris Hamons
URL:
Depends on:
Blocks:
 
Reported: 2014-09-05 22:39 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2014-11-17 06:13 UTC (History)
6 users (show)

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


Attachments
Test case (20.15 KB, application/zip)
2014-09-05 22:39 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:
VERIFIED FIXED

Description Brendan Zagaeski (Xamarin Team, assistant) 2014-09-05 22:39:56 UTC
Created attachment 7954 [details]
Test case

Starting with Xamarin.Mac 1.10, the version of the Mac launcher that gets included when bundling the Mono runtime is missing some symbols, such as `xamarin_IntPtr_objc_msgSend_IntPtr`.

Regression status: regression.



## Steps to reproduce

Build and run the attached test case in the Debug configuration.

The Debug configuration currently has bundling enabled. It has linking disabled to keep things simple.

The test case essentially just calls:
`NSBundle.MainBundle.InfoDictionary.ValueForKey()`



## Result on Xamarin.Mac 1.10

> System.EntryPointNotFoundException: xamarin_IntPtr_objc_msgSend_IntPtr
>  at (wrapper managed-to-native) MonoMac.ObjCRuntime.Messaging.xamarin_IntPtr_objc_msgSend_IntPtr (intptr,intptr,intptr) <IL 0x00011, 0x0008f>
>  at MonoMac.Foundation.NSObject.ValueForKey (MonoMac.Foundation.NSString) [0x00035] in /Users/builder/data/lanes/xamcore-lion-1.10-branch/1bfb1eb7/source/xamcore/src/build/compat/Foundation/NSObject.g.cs:713
>  at MacApp1.AppDelegate.FinishedLaunching (MonoMac.Foundation.NSObject) [0x00031] in /Volumes/ramdisk/MacApp1/MacApp1/AppDelegate.cs:22
>  at (wrapper dynamic-method) object.[MacApp1.AppDelegate.Void FinishedLaunching(MonoMac.Foundation.NSObject)] (MonoMac.Foundation.NSObject,MonoMac.ObjCRuntime.Selector,MonoMac.Foundation.NSObject) <IL 0x00011, 0x00062>
>  at (wrapper native-to-managed) object.[MacApp1.AppDelegate.Void FinishedLaunching(MonoMac.Foundation.NSObject)] (MonoMac.Foundation.NSObject,MonoMac.ObjCRuntime.Selector,MonoMac.Foundation.NSObject) <IL 0x0006c, 0x0017f>
>  at (wrapper managed-to-native) MonoMac.AppKit.NSApplication.NSApplicationMain (int,string[]) <0x00012>
>  at MonoMac.AppKit.NSApplication.Main (string[]) [0x00041] in /Users/builder/data/lanes/xamcore-lion-1.10-branch/1bfb1eb7/source/xamcore/src/AppKit/NSApplication.cs:105
>  at MacApp1.MainClass.Main (string[]) [0x00007] in /Volumes/ramdisk/MacApp1/MacApp1/Main.cs:14



## Result on Xamarin.Mac 1.8

The app runs without error whether bundling is enabled or not.



## Additional information

### Bundling enabled on Xamarin.Mac 1.10

> $ nm MacApp1/bin/Debug/MacApp1.app/Contents/MacOS/MacApp1  | grep xamarin_IntPtr


### Bundling disabled on Xamarin.Mac 1.10

> $ nm MacApp1/bin/Debug/MacApp1.app/Contents/MacOS/MacApp1  | grep xamarin_IntPtr
> 00003050 T _xamarin_IntPtr_objc_msgSendSuper_IntPtr
> 00002f00 T _xamarin_IntPtr_objc_msgSend_IntPtr


### Xamarin.Mac 1.8

On Xamarin.Mac 1.8, the `ValueForKey()` method uses a different native method `monomac_IntPtr_objc_msgSend_IntPtr()`.

> $ nm MacApp1/bin/Debug/MacApp1.app/Contents/MacOS/MacApp1  | grep monomac_IntPtr_objc_msgSend_IntPtr
> 00002c30 T _monomac_IntPtr_objc_msgSend_IntPtr



## Version information

Xamarin.Mac 1.10.0.10 (Business Edition)
Mono 3.8.0 (no/45d0ba1)

Xamarin Studio 5.3 (build 440)

Xcode 5.1 (5084), Build 5B130a
Mac OS X 10.9.4
Comment 2 Ram Chandra 2014-09-08 07:46:15 UTC
I have checked this issue with attached project and I am able to reproduce this issue.

When I enable the "Include the Mono runtime in the application bundle" option. I observed that, I am getting the "System.EntryPointNotFoundException". 

Note: When I disable the "Include the Mono runtime in the application bundle" I am not getting any error/ exception.

Screencast: http://www.screencast.com/t/BZRSgSX3
Exception details: https://gist.github.com/saurabh360/22a65faedde6f068bcc6

Environment Info:

=== Xamarin Studio ===

Version 5.3 (build 440)
Installation UUID: 6ea47b0d-1852-4aaf-808d-373ff0a5002b
Runtime:
	Mono 3.8.0 ((no/62a857e)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 308000007

=== Apple Developer Tools ===

Xcode 5.1 (5084)
Build 5B130a

=== Xamarin.iOS ===

Version: 7.4.0.108 (Enterprise Edition)
Hash: 77efa3f
Branch: 
Build date: 2014-08-26 07:59:55-0400

=== Xamarin.Android ===

Version: 4.16.0 (Enterprise Edition)
Android SDK: /Users/jatin66/Desktop/Backup/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.0   (API level 11)
		3.1   (API level 12)
		3.2   (API level 13)
		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)
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.Mac ===

Version: 1.12.0.1 (Enterprise Edition)

=== Build Information ===

Release ID: 503000440
Git revision: accb55419539e512cff857b14b80ec3107996511
Build date: 2014-09-01 08:53:05-04
Xamarin addins: 6dbac4b3a32df080bf98cde838ce89e573a92859

=== Operating System ===

Mac OS X 10.9.3
Darwin Jatin66s-iMac.local 13.2.0 Darwin Kernel Version 13.2.0
    Thu Apr 17 23:03:13 PDT 2014
    root:xnu-2422.100.13~1/RELEASE_X86_64 x86_64
Comment 3 Chris Hamons 2014-09-26 16:55:17 UTC
Just FYI, we have a fix for this internally and I will update this bug when it is released.
Comment 4 Chris Hamons 2014-10-01 15:41:44 UTC
This should be resolved in the latest Xamarin.Mac beta. Please reopen the bug if updating to that and rebuilding doesn't solve the issue for you.
Comment 5 Andreja 2014-10-17 04:45:22 UTC
When is this bug gonna be resolved in stable release.

When I run debug is fine but in release mode it still crashes when I try to use
ValueForKey. I found workaround but is cleaner to use this.

I'm using Xamarin mac

my machine settings

Xamarin Studio
Version 5.5.2 (build 3)
Installation UUID: c6bb4d3d-7995-4275-9fc6-daef40826155
Runtime:
	Mono 3.10.0 ((detached/e204655)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000023

Xamarin.Android
Not Installed

Apple Developer Tools
Xcode 6.0.1 (6528)
Build 6A317

Xamarin.Mac
Version: 1.10.0.13 (Business Edition)

Operating System
Mac OS X 10.9.5
Comment 6 Chris Hamons 2014-10-17 11:51:54 UTC
So it appears that release didn't have the fix or it was broken. I'm taking a look.

You can work around this by unchecking "Include the mono runtime in the application bundle".
Comment 7 Chris Hamons 2014-10-17 12:17:05 UTC
I was mistaken, this is in beta. Can you try beta channel? We hope to have in stable next week.
Comment 8 Andreja 2014-10-17 12:35:02 UTC
I'll have to wait until next week as I have dev machine with stable release i cannot use beta release.
Comment 9 Chris Hamons 2014-10-17 15:15:36 UTC
We should get that out early next week, possibly Monday.
Comment 10 Andreja 2014-10-21 05:42:49 UTC
ok retested it with debug/release mode with latest build (Version: 1.10.0.18) and now it works.
Comment 11 Jatin 2014-11-17 06:13:06 UTC
I have verified this issue with the latest build, i.e. XM 1.11.1.89 and have observed that now the exception is not appearing.

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

Build information:

=== Xamarin Studio ===

Version 5.5.4 (build 14)
Installation UUID: 449f40dd-b3f1-4028-9a6b-cca0d1a2307d
Runtime:
	Mono 3.10.0 ((detached/92c4884)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000031

=== Xamarin.Android ===

Version: 4.20.0.26 (Business Edition)
Android SDK: /Users/360logicaxamarinmacmini/Desktop/android-sdk-macosx_AndÃsdk
	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)
		3.2    (API level 13)
		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)

=== Apple Developer Tools ===

Xcode 5.1.1 (5085)
Build 5B1008

=== Xamarin.iOS ===

Version: 8.4.0.43 (Business Edition)
Hash: 840a925
Branch: 
Build date: 2014-11-16 21:03:22-0500

=== Xamarin.Mac ===

Version: 1.11.1.89 (Business Edition)

=== Build Information ===

Release ID: 505040014
Git revision: 0ba6e4604b0c07b002498251c20bde8a265b13be
Build date: 2014-11-11 15:38:26-05
Xamarin addins: 8ee37a13f91f85d350eeecbab99dff85d24d02dd

=== Operating System ===

Mac OS X 10.8.4
Darwin 360LogicasMacmini.local 12.4.0 Darwin Kernel Version 12.4.0
    Sun Mar 10 18:01:10 PDT 2013
    root:xnu-2050.24.6~1/RELEASE_X86_64 x86_64