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
GitHub or Developer Community 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 2796 [details]
On behalf of email@example.com
Jourke de Boer writes :
I tried to create a project that reproduces the problem, but wasn't succesful. During the testing against the full app I did figure out what goes wrong and how to reproduce it consistently.
In the mono/mini/aot_compiler.c a change was made to set the pointer info for the trampoline. (https://github.com/mono/mono/commit/2a63257bf810ddfdb9a1e36a4f899d1ae599d558#mono/mini/aot-runtime.c)
The ptr setting was changed from method (and default klass) to a method/klass or other.
This change seems to affect the pointer tables kept internally. BTW: This is not the only place where this change is made, but the effect is the same.
If an interface (or and abstract class as in the 7457 case) with a generic parameter is used (i;e; IMyInterface<T> : ISomeOtherInterface), the table is corrupted.
The third or fourth time this info is used, I vrified this by running a fixed path in our platform which does this. It now reproduces the error consistently.
I reproduced this in a sample app, but the table corruption only appears with enough other type info in the app. So the sample app is too simple to reprodue the error.
The main generator for this kind of interfaces is based on an open source app (https://github.com/Redth/MonoTouch.UrlImageStore). Maybe you can combine my code or a sample app for this. I got sidetracked by a major issue, so I didn't have the time to finish the testing :-)
I attached a few stacktraces from the main app (AppstraDev) and the sourcecode. If you pass this information on, you should be able to tackle this problem. If get the same issue reproducable in my testapp, I'll attach it to the bugreport. This is still registered as fixed by the way.
Anyway, let me know if I can test hotfixes or provide you with more information.
Created attachment 2797 [details]
submitted on behalf of firstname.lastname@example.org
to the 'Additional mtouch arguments' field in the 'iphone build' tab in project options.
For more background, please refer to this discussion: http://monotouch.2284126.n4.nabble.com/Understanding-the-impact-of-trampolines-td4495086.html
The settings were: --nolinkaway --aot "ntrampolines=4096" --aot "nimt-trampolines=512"
I don't think that this setting is related however. Issues with running out of trampolines will result in "out of trampolines of type 0/2" messages and are quite consistent. I've run into those before.
Looking at the stack traces, this seems like running out of trampolines, but for some reason, the message is not printed out. Could you try increasing the number of trampolines even further, and see whenever that makes any difference ?
About the commit you mentioned, that commit is only in mono master, and not in monotouch.
email@example.com --> firstname.lastname@example.org
Increasing the trampolines did help. The testbuild removed the setting (mistake on my side) so it defaulted back to 512. It is now a lot harder to produce the error.
So as a workaround this works. New code already minimizes use of generics since using more than 3 generic parameters (rule of thumb) will cause runtime errors on the device or running out of trampolines. These two actions make this work for us for now. It takes the sting out of the error.
The commit was in the mono/mini branch (unless I misread it). I thought this implied that it was included in the base of monotouch. Deducing the error from that changeset produced the testcase so it could be reproduced easily and consitently. But it is all based on guessing how your code works from my standpoint.
I couldn't reproduce this using the provided testcase.
Monotouch stable doesn't suffer from this limitation anymore.