Mono ios uncertain crash Solution

Source: Internet
Author: User

I have been using mono for ios development for a year. I have been experiencing a headache because of the crash, and no explicit error is thrown during the crash.

When debugging a bug two days ago, it was inexplicably rolled back during serialization. Later, under the guidance of a great God (blog address), I found a solution!

In case of this crash, the output error in Application output is as follows:

 
 monoeg_g_log +   get_numerous_trampoline +  ==================================================================================================================================

In addition, this error is random. Sometimes it runs normally and sometimes it is abnormal. In the output error content above, we can see the word trampoline, the first sentence of monoeg_g_log is that the system is trying to record the error log. In this case, we can determine that this is the default trampoline of mono (trampoline) the number is smaller than the number of trampoline required by your application.

Here, Rolf Bjarne Kvinge explains the trampoline number: The corresponding link

On device we generate all the necessary code at build time in a process known as Ahead of Time compilation (similar to Microsoft's ngen), because we're not allowed to jit code on devices. Unfortunately there are a few things that cannot be determined statically - for instance generic interfaces might need different vtables depending on which type the interface is instantiated with. (For this case it is technically possible to determine the maximum number of vtables, but the number would be potentially enormous - multiply the number of generic interfaces times the number of types in your app...). We cannot allocate memory for these vtables dynamically at runtime, so we've picked a reasonable default and allow the user to increase this value if they run into issues. This is the basic theory for the trampolines (the exact problem is a bit different, depending on the type of trampolines, but that's not really important).So you can add as many trampolines as you want, but memory usage will increase. That's also all there is to it: the app will not get slower (unless if the increased memory usage causes it to run slower, due to out-of-memory warnings, etc). It also means that you only have to increase the number of trampolines of the type you're actually having problems with, if you increase the others you'll increase the size of your executable needlessly.
 

(Poor English, try your best to translate ):

Because mono does not allow real-time compilation of code on Apple devices, mono will directly compile the code into ARM assembly code through AOT compilation technology during compilation. However, there are still some issues that cannot be determined statically during compilation: for example, generic interfaces may need different virtual tables (a set of execution methods is stored at runtime ), this depends on the type of the interface when it is instantiated. (Technically, it is possible to determine the maximum number of virtual tables, but this number may be large --

After reading this, I think you have a certain understanding of the trampoline number. How can I set it!

Open xamarin studio, right-click the project file, and select option. In the arguments parameter field, enter: -aot "nrgctx-trampolines = 4096"-aot "nce-trampolines = 4096"-aot "ntrampolines = 4096"

See:

Of trampolines of type message running device, You can create more type trampolines (type SPECIFIC) by modifying your project options section. you want to add extra arguments-aot number of trampolines. try increasing number until you have enough of trampolines of type message on device. you can create more type trampolines (type RGCTX) by modifying your project options section. you want to add extra arguments-aot number of trampolines. try increasing number until you have enough of trampolines of type message on device. you can create more type trampolines (type IBD Thunks) by modifying your project options section. you want to add extra arguments-aot number of IBD Thunk trampolines. try increasing number until you have enough your usage of interfaces.

The following is a translation:

Ran  of trampolines of type 
 
 
 of trampolines of type 
 
 
 of trampolines of type 
 
 
 
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.