• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by ___Petr___ · Oct 28, 2013 at 11:27 AM · iosarraycrashdebugmono

Unity iOS unreproducable crashes in methods of ArrayList with mono_gc_out_of_memory

We have crashes in our Unity iOS app.
We cannot reproduce them when debugging, but we regularly catch this crash.

We tried to analyze crash logs. (crash log is in the bottom of the post) We examine part of code mentioned in crash log (m_Controller... methods), and cant see something that could cause crash.
We tried to imagine situations that can occurs in that part of code, but see nothing that can lead to crash. There are small* array of strings which is loadaed from disk, and modified. We thinking of rewriting this part of code, but we afraid that otherp part of program can affect and lead to this crash, and that crash will remain after rewriting.

We tried to add try-catch block in this part of code and process situation when exception occurs gracefully (move user to our app's main menu), but we have to remove this block due to requirements to our app.

Also, I think that crash occurs only (or at least much more frequent) in Ad-hoc build (which uses Release configuration in Xcode). In parts of crash logs you can see mono_gc_out_of_memory in GC_malloc, which is looking very strange to me (I thought that iOS generates memory warning when memory is low, but possibly mono has its own constraints)

Also, there is another one or two crashes in this part of code with different crash logs (without mono_gc_out_of_memory, but ), but all of them occurs in methods of ArrayList ( ArrayList.Clear() in other situations).

Can you help us with this situation? Can you give us any advice please on how should we deal with this crashes?

 Exception Type:  EXC_BREAKPOINT (SIGTRAP)
 Exception Codes: 0x0000000000000001, 0x00000000e7ffdefe
 Crashed Thread:  0
 
 Thread 0 name:  Dispatch queue: com.apple.main-thread
 Thread 0 Crashed:
 0   MyApp                           0x00f0e150 CrashedCheckBellowForHintsWhy() (CrashReporter.mm:73)
 1   MyApp                           0x00dcd888 m_wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 200
 2   MyApp                           0x01462eec mono_jit_runtime_invoke + 2152
 3   MyApp                           0x01504f24 mono_runtime_invoke + 132
 4   MyApp                           0x015050a8 mono_runtime_delegate_invoke + 128
 5   MyApp                           0x0150931c call_unhandled_exception_delegate + 340
 6   MyApp                           0x0150b230 mono_unhandled_exception + 328
 7   MyApp                           0x01473080 mono_handle_exception_internal + 952
 8   MyApp                           0x01473918 mono_handle_exception + 64
 9   MyApp                           0x0148f6d8 mono_arm_throw_exception + 184
 10  MyApp                           0x00e76ecc throw_exception + 44
 11  MyApp                           0x014b7f44 mono_gc_out_of_memory + 16
 12  MyApp                           0x0156a62c GC_generic_malloc + 452
 13  MyApp                           0x0156a6cc GC_malloc + 140
 14  MyApp                           0x015045fc mono_array_new_specific + 272
 15  MyApp                           0x00dd27ac m_wrapper_managed_to_native_object___icall_wrapper_mono_array_new_specific_intptr_int + 68
 16  MyApp                           0x00b7b2b8 m_System_Collections_ArrayList_InsertRange_int_System_Collections_ICollection + 212
 17  MyApp                           0x00b7b898 m_System_Collections_ArrayList_AddRange_System_Collections_ICollection + 52
 18  MyApp                           0x001fc3fc m_Controller_PrepareSkins_string_string_string_string_string_string_string__ + 1600
 19  MyApp                           0x001fda88 m_Controller_Awake + 4972
Comment

People who like this

0 Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image vexe · Oct 28, 2013 at 01:08 PM 0
Share

Have you considered maybe using generic lists instead of ArrayList? (which you should never use btw)

avatar image ___Petr___ · Oct 28, 2013 at 01:21 PM 0
Share

Yes, we tried to replace ArrayLists with List<>, but this no help (had the same bug)

avatar image Graham-Dunnett ♦♦ · Oct 28, 2013 at 01:52 PM 0
Share

Is the help you are getting on the forum no good? http://forum.unity3d.com/threads/207576-iOS-unreproducable-crash-when-working-with-ArrayList-(and-mono_gc_out_of_memory)

avatar image vexe · Oct 28, 2013 at 02:27 PM 0
Share

Petr, next time please provide crosslinks when you ask questions in multiple locations. It's not nice for someone to write you something, and then discover that somebody else gave you the same info in the other place you asked.

avatar image ___Petr___ · Oct 30, 2013 at 07:36 AM 0
Share

@vexe sorry , I did not think about this. I will try to be more attentive next time. We continue to elaborating this issue, we replace all .AddRanges with .Add in foreach, and will test today

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

17 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

iOS Xcode debug 0 Answers

IOS Crash Report 0 Answers

Using AssetBundles as IAP Crashing 0 Answers

Failed to load AOT module ... in aot-only mode. 1 Answer

Line Renderer causes crash on iPad on Startup 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges