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 91 [details]
Interlocked.Exchange<T> crashes app on device (I have iPod4)
others Interlocked.XXX worked
- create windows-based app for iPhone
- add variables to AppDelegate
string str = null;
- insert first line of code in AppDelegate.FinishedLaunching
Interlocked.Exchange( ref str, "one" );
Confirmed. It happens with, or without, the linker being enabled.
Not sure why the AOT compiler is not able to detect and compile a string version of this call.
Reducing the severity to Normal since you can use the non-generic overload that accept System.Object to pass string instances as a workaround.
That same issue has hit other people (before 184.108.40.206)
It looks like AOT is well aware of the generic type to use:
imac:Keychain sebastienpouliot$ MONO_PATH=/Users/sebastienpouliot/git/monotouch-samples/Keychain/Keychain/bin/iPhone/Debug/Keychain.app /Developer/MonoTouch/usr/bin/arm-darwin-mono --debug --aot=full,static,asmonly,soft-debug,iphone-abi,outfile=Keychain.exe.6.s -v -v "/Users/sebastienpouliot/git/monotouch-samples/Keychain/Keychain/bin/iPhone/Debug/Keychain.app/Keychain.exe" | grep Interlock
call R202 <- [System.Threading.Interlocked:Exchange<string> (string&,string)] [arm_r0 <- R203] [arm_r1 <- R204] [arm_v5 <- R201] clobbers: c
So I wonder if this could be a (undocumented) AOT (or full-AOT) restriction wrt internal calls:
[ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
public extern static T Exchange<T> (ref T location1, T value) where T:class;
Fixed by 79b99d358b1321759ea3a42f22eaf141aecf0e79 on the mono 2.10 branch.
Thanks Zoltan! I'll test the fix and include it into monotouch.
Thanks for the test case!