Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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
1
Question by elenzil · Oct 08, 2015 at 08:51 PM · iosunity5hang

iOS 9, unity sometimes hangs in main(). iOS kills process after 20s

Hi All -

we're looking at an issue which is fairly troubling. on iOS 9.0.1 and 9.0.2, our app sometimes hangs in the very initial launch screen, and iOS terminates the process after 20 seconds. in the iOS log (captured using the excellent deviceconsole utility), the signature of a hung launch is:

  • the absence of the line -> registered mono modules.

  • the eventual presence of a line like this: Oct 8 00:03:06 <device name> SpringBoard[48] <Warning>: Forcing crash report of <FBApplicationProcess: 0x18ab0050; <app name>; pid: 355> (reason: 1, description: <app bundle id> failed to launch after 20.00s (launchIntent: foreground-interactive))

Details:

  • On some iOS 9 devices it happens in about 30% of launches, others more like 15%.

  • It never happens on iOS 8.

  • It does not happen when run directly from xcode (this makes sense because an xcode launch is not a springboard launch)

  • We've tried Unity 5.1.2 (our default) with XCode 6, and Unity 5.2.1 p2 with XCode 7, with the same results.

  • In a successful run, the log line -> registered mono modules appears pretty much instantly.

  • It happens across a suite of 3 of our apps, all of which are build on Unity 5.1.2, but if we go back to versions build on Unity 4.6, the problem does not happen.

I'm worried the the absence of -> registered mono modules indicates that the problem is extremely early in the app-launch process, specifically inside main:


int main(int argc, char* argv[])
{
    @autoreleasepool
    {
        UnityInitTrampoline();
        UnityParseCommandLine(argc, argv);
        RegisterMonoModules();
        NSLog(@"-> registered mono modules %p\n", &constsection);
Comment
Add comment · Show 6
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 elenzil · Oct 08, 2015 at 06:16 PM 0
Share

uh oh: i added more NSLog()s to the code snip above, and the problem distinctly no longer reproduces.

avatar image HuuPC · Nov 04, 2015 at 11:25 AM 0
Share

I have same problem. Did you get a solution?

avatar image elenzil HuuPC · Nov 04, 2015 at 06:23 PM 1
Share

not really. the NSLog() thing i mentioned did seem stable as a fix, even if it's hideously hackish. what i actually ended up doing was inserting both an NSLog() statement and a hard sleep of 15ms or so in between each of those three statements there in main().

in pseudo-code, something like this:

 void hardSleep(long ms) {
   long finishTime = time_now_ms() + ms;
   while (time_now_ms() < finishTime) {
     // do nothing
   }
 }
 
 main() {
   NSLog("foobar1");
   hardSleep(15);
 
   UnityInitTrampoline();
 
   NSLog("foobar2");  
   hardSleep(15);
 
   UnityParseCommandLine();
 
   NSLog("foobar3");  
   hardSleep(15);
 
   Register$$anonymous$$ono$$anonymous$$odules();
 
   NSLog("foobar4");  
   hardSleep(15);
 }

avatar image HuuPC elenzil · Nov 05, 2015 at 01:59 AM 0
Share

oh thanks, I try your hack and the problem seems be solved.

avatar image HuuPC · Nov 11, 2015 at 10:04 AM 0
Share

Hi @elenzil, any further information about that problem?

avatar image elenzil HuuPC · Nov 12, 2015 at 06:20 PM 0
Share

nope, sorry.

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.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Abysmal performance with Unity 5 on a Retina iPad - was fine with Unity 4.6 1 Answer

Images in canvas flicker and have a glitch effect just in IOS build.(VIDEO) 0 Answers

[iOS] EXC_BAD_ACCESS , when creating match with UNET 0 Answers

Play/Pause Buttons Access in Apple TV 1 Answer

AudioMixer Script Not working ios 64bit build 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