Bug 131 - mmp improperly links apps
Summary: mmp improperly links apps
Status: RESOLVED FIXED
Alias: None
Product: MonoMac
Classification: Desktop
Component: Bindings ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- enhancement
Target Milestone: ---
Assignee: Sebastien Pouliot
URL:
Depends on:
Blocks:
 
Reported: 2011-08-01 11:53 UTC by Jonathan Pryor
Modified: 2011-08-01 16:22 UTC (History)
1 user (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 Jonathan Pryor 2011-08-01 11:53:27 UTC
If I:
 1. Build MfaActivation.app in MD 2.4.2 (Open MTActivation.sln, build), 
 2. Select the MTActivation project in the Solution pane
 3. Click Project > Create Mac Installer:
    [x] Include Mono in application bundle
        Linker: Link all assemblies
 4. Click Create Package
 5. Enter a path name (no spaces!), e.g. /tmp/MfaActivation.app
 6. Run the app (in Terminal):

    MFA_ACTIVATION_CWD=/tmp /tmp/MfaActivation.app/Contents/MacOS/MfaActivation 

 7. Click the Activate button

Expected results:

Not show the actual results (it should show some other error, e.g. unable to find `client` or something).

Actual results:

2011-08-01 11:50:26.390 MfaActivation[46216:707] -[__monomac_internal_ActionDispatcher __monomac_internal_ActionDispatcher_activated:]: unrecognized selector sent to instance 0x5821f0
2011-08-01 11:50:26.391 MfaActivation[46216:707] -[__monomac_internal_ActionDispatcher __monomac_internal_ActionDispatcher_activated:]: unrecognized selector sent to instance 0x5821f0
2011-08-01 11:50:26.393 MfaActivation[46216:707] (
	0   CoreFoundation                      0x9159fe77 __raiseError + 231
	1   libobjc.A.dylib                     0x9a6d1149 objc_exception_throw + 155
	2   CoreFoundation                      0x915a3480 -[NSObject doesNotRecognizeSelector:] + 256
	3   CoreFoundation                      0x914f28a9 ___forwarding___ + 457
	4   CoreFoundation                      0x914f2672 _CF_forwarding_prep_0 + 50
	5   CoreFoundation                      0x914f5901 -[NSObject performSelector:withObject:] + 65
	6   AppKit                              0x9201c937 -[NSApplication sendAction:to:from:] + 232
	7   AppKit                              0x9201c814 -[NSControl sendAction:to:] + 102
	8   AppKit                              0x9201c717 -[NSCell _sendActionFrom:] + 160
	9   AppKit                              0x9201bad2 -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 2295
	10  AppKit                              0x9209eb59 -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 501
	11  AppKit                              0x9201a513 -[NSControl mouseDown:] + 943
	12  AppKit                              0x91fe380a -[NSWindow sendEvent:] + 7514
	13  AppKit                              0x91f7bb23 -[NSApplication sendEvent:] + 4936
	14  AppKit                              0x91f0d52b -[NSApplication run] + 1000
	15  AppKit                              0x921a0b54 NSApplicationMain + 1054
	16  ???                                 0x007e9bc2 0x0 + 8297410
	17  ???                                 0x007e9b08 0x0 + 8297224
	18  ???                                 0x004eaa0a 0x0 + 5155338
	19  ???                                 0x004eaacd 0x0 + 5155533
	20  MfaActivation                       0x00010064 mono_jit_runtime_invoke + 164
	21  MfaActivation                       0x001c06ea mono_runtime_invoke + 137
	22  MfaActivation                       0x001c2ff8 mono_runtime_exec_main + 669
	23  MfaActivation                       0x001c2332 mono_runtime_run_main + 843
	24  MfaActivation                       0x00002a0e main + 1422
	25  MfaActivation                       0x00002435 start + 53
)

It looks like monomac/src/AppKit/ActionDispatcher.cs!ActionDispatcher.OnActivated is being linked away, or something else similarly "bad."
Comment 1 Sebastien Pouliot 2011-08-01 15:30:11 UTC
It happens on both "link all" and "link sdk only" so something important is removed.
Comment 2 Sebastien Pouliot 2011-08-01 16:22:51 UTC
Fixed in cbab32c4811051237618fe12eea2bc6f41fcdd77 (missing [Preserve] attributes).
Note that you'll need a new MonoMac.dll to get the fix (until MD ships a fixed version).

p.s. I assume that never worked (w/linking) - otherwise I don't know what could have caused this (the linker did its job).