Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Created attachment 634 [details]
Open attached project, run on device. It will crash (see second attachment).
Now enable linking (either sdk or all assemblies), and verify that it doesn't crash.
Created attachment 635 [details]
CC Sebastian, possible linker issue.
Reported in assistly #3077 (priority).
From a _pre-build_ look the Cut method is not used anywhere so the linker will (by design) remove it.
Since it's (likely) not present in the linked application that may be the reason why it does not crash. I will investigate further...
a. No link: work on simulator, crash on device
b. Link SDK : work (normal since Cut method won't be removed)
c. Link all: work (Cut is not linked out, its [Export]'ed)
It will be fun to see why the linker can avoid that crash in the trampoline!
Linking does remove UIResponder.Cut, which use the same "cut:" selector but has different method signature, from monotouch.dll.
I believe the device trampoline is calling the wrong one (while the simulator gets it right*) leading to the crash.
* by design or by chance (the code paths are very different)
and UIResponder.Cut is implemented to support UIResponderStandardEditActions protocol which defines 'cut:' as
where we implement it as
void Cut ();
The solution is to override Cut. Of course it's better if the right one is available - that's fixed in GIT and the old methods still exists and are marked [Obsolete] for backward compatibility.
public override void Cut (NSObject sender)
revision: d0cd84830891c0e47590e46bb1afc27db65978e9 (master)
I'll backport to branches tomorrow morning