Search Issue Tracker

Active

Votes

0

Found in

2018.3.0f2

Issue ID

1111601

Regression

No

[Editor building to Android] Unity hangs while building GVR SDK to a device over Wi-Fi

Mobile

-

-

Priority: 3Not yet prioritized for a release

-

Severity: 1Crash, freeze, data loss, work stops

Repro steps:
1. Download the newest SDK: https://github.com/googlevr/gvr-unity-sdk/releases
2. Create a new project, import the unity package
3. In Player Settings change the "Minimum API Level" to 19
4. Open the Build Settings Window and add all of the scenes to it, change the build target to Android
5. Connect the device through ADB over Wi-Fi (disconnect device from USB)
6. Build and Run

Actual: Editor freezes with numerous "error:more than one device/emulator" messages in the log

Reproducible with: 2018.3.3f1, 2019.1.0a14, 2019.2.0a3

DUT:
Reproduced on:
VLNQA00003, Razer Razer Phone (Phone), Android 7.1.1, CPU: Snapdragon 835 MSM8998, GPU: Adreno (TM) 540
VLNQA00166, Huawei P20 (EML-L29), Android 8.1.0, CPU: HiSilicon Kirin 970, GPU: Mali-G72
VLNQA00257, Sony Xperia XZ Premium (G8141), Android 8.0.0, CPU: Snapdragon 835 MSM8998, GPU: Adreno (TM) 540
VLNQA00101, Samsung Galaxy Note8 (SM-N950U), Android 8.0.0, CPU: Snapdragon 835 MSM8998, GPU: Adreno (TM) 540

Didn't reproduce on:
VLNQA00001, Google Pixel 2 (Pixel 2), Android 9, CPU: Snapdragon 835 MSM8998, GPU: Adreno (TM) 540

Notes:
- Couldn’t test with 2017.4 because of numerous errors
- Didn’t repro on Windows
- Doesn't freeze consistently
- No repro when building with Xcode over Wi-Fi

replacing Process.WaitForExit with while(!process.HasExited){} workarounds the issue.

replacing Process.WaitForExit with while (!Process.WaitForExit (100)) doesn't help also.

--> HANGS HERE ( even though the process was already exited)
Wait_internal(), WaitHandle (System.Threading)@mscorlib.dll
System.Threading.WaitHandle.Wait_internal() in
System.Threading.WaitHandle.WaitOneNative(Microsoft.Win32.SafeHandles.SafeWaitHandle waitableSafeHandle, uint millisecondsTimeout, bool hasThreadAffinity, bool exitContext) in
System.Threading.WaitHandle.InternalWaitOne(Microsoft.Win32.SafeHandles.SafeWaitHandle waitableSafeHandle, long millisecondsTimeout, bool hasThreadAffinity, bool exitContext) in
System.Threading.WaitHandle.WaitOne(long timeout, bool exitContext) in
System.Threading.WaitHandle.WaitOne(int millisecondsTimeout, bool exitContext) in
System.Diagnostics.Process.WaitForExit(int milliseconds) in
System.Diagnostics.Process.WaitForExit() in
UnityEditor.Utils.Program.WaitForExit() in /Users/tomasdirvanauskas/Documents/Projects/input-new-ios/Editor/Mono/Utils/Program.cs:173
UnityEditor.Android.Command.RunWithShellExecute(string command, string args, string workingdir, string errorMsg) in /Users/tomasdirvanauskas/Documents/Projects/input-new-ios/PlatformDependent/AndroidPlayer/Editor/Managed/Android/Command.cs:121
UnityEditor.Android.AndroidJavaTools.RunJavaWithShellExecute(string args, string workingdir, string error) in /Users/tomasdirvanauskas/Documents/Projects/input-new-ios/PlatformDependent/AndroidPlayer/Editor/Managed/Android/AndroidJavaTools.cs:126
UnityEditor.Android.GradleWrapper.WarmupGradle(UnityEditor.Android.AndroidJavaTools javaTools, string workingDir, string baseCommand) in /Users/tomasdirvanauskas/Documents/Projects/input-new-ios/PlatformDependent/AndroidPlayer/Editor/Managed/Android/Gradle.cs:196
UnityEditor.Android.PostProcessAndroidPlayer.ExecuteWarmup.AnonymousMethod__0() in /Users/tomasdirvanauskas/Documents/Projects/input-new-ios/PlatformDependent/AndroidPlayer/Editor/Managed/PostProcessAndroidPlayer.cs:124
System.Threading.ThreadHelper.ThreadStart_Context(System.Threading.ThreadHelper state) in
System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Threading.ThreadHelper state, bool preserveSyncCtx) in
System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Threading.ThreadHelper state, bool preserveSyncCtx) in
System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Threading.ThreadHelper state) in
System.Threading.ThreadHelper.ThreadStart() in

on native side it's

#0 0x00007fff60209246 in semaphore_wait_trap ()
#1 0x000000014878d0c5 in mono_os_sem_wait [inlined] at /Users/builduser/builds/vm/mono/mono/metadata/../../mono/utils/mono-os-semaphore.h:90
#2 0x000000014878d0bb in mono_coop_sem_wait [inlined] at /Users/builduser/builds/vm/mono/mono/metadata/../../mono/utils/mono-coop-semaphore.h:43
#3 0x000000014878d0b2 in process_wait at /Users/builduser/builds/vm/mono/mono/metadata/w32process-unix.c:652
#4 0x00000001488548f9 in mono_w32handle_ops_specialwait [inlined] at /Users/builduser/builds/vm/mono/mono/metadata/w32handle.c:584
#5 0x00000001488548d1 in mono_w32handle_wait_one at /Users/builduser/builds/vm/mono/mono/metadata/w32handle.c:836
#6 0x0000000148854c80 in mono_w32handle_wait_multiple at /Users/builduser/builds/vm/mono/mono/metadata/w32handle.c:923
#7 0x00000001488372b4 in ves_icall_System_Threading_WaitHandle_Wait_internal at /Users/builduser/builds/vm/mono/mono/metadata/threads.c:1975
#8 0x0000000150e63ec8 in 0x150e63ec8 ()
#9 0x00000001510fdbc3 in 0x1510fdbc3 ()
#10 0x00000001510feecb in 0x1510feecb ()
#11 0x00000001510edeab in 0x1510edeab ()
#12 0x00000001510eda4b in 0x1510eda4b ()
#13 0x00000001511214e3 in 0x1511214e3 ()
#14 0x0000000152d9418b in 0x152d9418b ()

NOTE: Attaching Xcode and pausing/resuming somehow revives the app and process starts to continue.

Some additional notes after looking together with @lukasz, seems like finalizer thread is stuck also, thus process status is not updated via mono_w32process_signal_finished, that's why Process.WaitForExit never quits

All about bugs

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