Search Issue Tracker

Won't Fix

Votes

0

Found in

2020.3.44f1

2021.3.18f1

2022.2.5f1

2023.1.0b2

Issue ID

UUM-26414

Regression

No

Crash on LoadSceneAsyncNameIndexInternal_Injected when entering Play Mode

--

-

How to reproduce:

# Open the user attached project
# Open the “GameExampleScene” scene
# Enter Play Mode
# Observe the crash

Reproducible with: 2020.3.44f1, 2021.3.18f1, 2022.2.5f1, 2023.1.0b2

Reproduced on: Windows 10 (Intel)

Note: Build and Run doesn’t crash

First lines of stack trace:
0x0000029b79f75d43 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.SceneManagement.SceneManagerAPIInternal:LoadSceneAsyncNameIndexInternal_Injected (string,int,UnityEngine.SceneManagement.LoadSceneParameters&,bool)
0x0000029b79f75c53 (Mono JIT Code) UnityEngine.SceneManagement.SceneManagerAPIInternal:LoadSceneAsyncNameIndexInternal (string,int,UnityEngine.SceneManagement.LoadSceneParameters,bool)
0x0000029b79f75bd3 (Mono JIT Code) UnityEngine.SceneManagement.SceneManagerAPI:LoadSceneAsyncByNameOrIndex (string,int,UnityEngine.SceneManagement.LoadSceneParameters,bool)
0x0000029b79f75991 (Mono JIT Code) UnityEngine.SceneManagement.SceneManager:LoadSceneAsyncNameIndexInternal (string,int,UnityEngine.SceneManagement.LoadSceneParameters,bool)
0x0000029b79f758a3 (Mono JIT Code) UnityEngine.SceneManagement.SceneManager:LoadScene (int,UnityEngine.SceneManagement.LoadSceneParameters)

  1. Resolution Note:

    We could not reproduce the crash, but we could reproduce a hang on LoadScene() when entering Play Mode. This hang is caused by the following user code in the Update() function of Timer.cs:

    void Update()
    {
    while (inPaused == false)
    {
    currentTime -= 1 * Time.deltaTime;
    countdownText.text = currentTime.ToString("0");
    if (currentTime <= 0)
    {
    currentTime = 0;
    // Cuando llegue a 0 el timer pasamos a la siguiente escena
    SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
    }
    }
    }

    This code results in an infinite while-loop calling to SceneManager.LoadScene(). Removing the while-condition solves the hang.

    Please note that Update() gets called every frame, so there is no need for a while-loop here. An if-condition is sufficient. To verify that your code does what you expect it to do, it can be useful to use log-messages throughout your code or attach a debugger to step through it.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.