Search Unity

Crashing every single time the main scene loads

Discussion in 'macOS' started by InsaneGoblin, Sep 18, 2018.

  1. InsaneGoblin

    InsaneGoblin

    Joined:
    Jun 2, 2013
    Posts:
    239
    Desperate for help. We tried everything as we can't get the OSX build to work. The codebase is too large (100k lines) and the builds seem to always fail for the most trivial issue (any random nullRef). It was working fine last year, until we went from 5.6 to 2017.x. Upgraded many times and currently on 2018.1. We simply cannot find out why it does what it does.

    Here is a crash log, hopefully you guys can see something that we don't: https://pastebin.com/nbafsZtZ
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Yikes! That shouldn't be possible (assuming you're not using any native plug-ins). Definitely looks like a Unity bug.

    It appears that something under the hood is not initialized properly, and so when it's used, it is likely to crash — the details will vary depending on what junk was in the uninitialized memory.

    Clearly it's happening when the scene is being loaded, and you say it's quite reproducible. So I would just make a copy of your entire project folder, and start ripping things out. Make a build that goes directly to the main scene (bypassing your title or loading scene or whatever), and make sure it still occurs. Then start aggressively deleting stuff from the main scene. When the problem goes away, undo the last deletion step, and delete a smaller part of that (or delete other stuff that appears to be unrelated). Repeat until you've got a reasonably small project to send to Unity.
     
  3. InsaneGoblin

    InsaneGoblin

    Joined:
    Jun 2, 2013
    Posts:
    239
    I'm afraid that is not possible. The game loads fine until the main menu, but there's A LOT going on when the map is generated on the main game, which is where it crashes. Everything is intertwined, so I can't just remove elements. To give you some context and get an idea of its complexity, this is the game: https://store.steampowered.com/app/671440/Rise_of_Industry/
     
  4. InsaneGoblin

    InsaneGoblin

    Joined:
    Jun 2, 2013
    Posts:
    239
  5. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Use the debugger? Or put in some Debug.Logs to see where it's crashing.

    --Eric
     
  6. InsaneGoblin

    InsaneGoblin

    Joined:
    Jun 2, 2013
    Posts:
    239
    As said, the log is clean (we even use PBDs). Only random NullRefs here and there, which are harmless in this context
     
  7. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Well, I've explained what you need to do... you say it's not possible, but what you really mean is that it's not easy. However, if there are no other options, you may have to just roll up your sleeves and do it anyway.

    If your game really is so intertwined that you can't touch anything, perhaps you take this opportunity to refactor it.
     
  8. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    If you don't want to use the debugger or do anything else to narrow the problem down, I'm not really sure what else to say.

    --Eric