Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emulator crash halfway through instrumentation should be categorized differently #885

Closed
Tracked by #9136
premun opened this issue May 13, 2022 · 0 comments · Fixed by #889
Closed
Tracked by #9136

Emulator crash halfway through instrumentation should be categorized differently #885

premun opened this issue May 13, 2022 · 0 comments · Fixed by #889
Assignees
Labels
android Android area bug emulator Related to an emulator/Simulator

Comments

@premun
Copy link
Member

premun commented May 13, 2022

Context

When an emulator crashes halfway through the instrumentation, it doesn't return an exit code but the call itself seems to end with -2.
We then try to logcat the logs but emulator is not responding.

Example log:

[08:57:51] dbug: Executing command: '/datadisks/disk1/work/B1CD0972/p/microsoft.dotnet.xharness.cli/1.0.0-prerelease.22256.2/runtimes/any/native/adb/linux/adb -s emulator-5554 shell am instrument -w net.dot.System.Net.Security.Tests/net.dot.MonoRunner'
[09:27:51] fail: Waiting for command timed out: execution may be compromised
[09:27:51] info: Running instrumentation class net.dot.MonoRunner timed out after waiting 1800.005893 seconds
[09:27:51] dbug: Exit code: -2
                 Std out:
                 
                 
                 
[09:27:54] dbug: Executing command: '/datadisks/disk1/work/B1CD0972/p/microsoft.dotnet.xharness.cli/1.0.0-prerelease.22256.2/runtimes/any/native/adb/linux/adb -s emulator-5554 logcat -d '
[09:27:54] info: Wrote current ADB log to /datadisks/disk1/work/B1CD0972/w/B25F0992/uploads/adb-logcat-net.dot.System.Net.Security.Tests-net.dot.MonoRunner.log
[09:27:54] info: Attempting to remove apk 'net.dot.System.Net.Security.Tests'..
[09:27:54] dbug: Executing command: '/datadisks/disk1/work/B1CD0972/p/microsoft.dotnet.xharness.cli/1.0.0-prerelease.22256.2/runtimes/any/native/adb/linux/adb -s emulator-5554 uninstall net.dot.System.Net.Security.Tests'
[09:27:55] info: Successfully uninstalled net.dot.System.Net.Security.Tests
[09:27:55] dbug: Saving diagnostics data to '/datadisks/disk1/work/B1CD0972/w/B25F0992/e/diagnostics.json'
XHarness exit code: 82 (RETURN_CODE_NOT_SET)
+ exit 82

Solution

We should categorize this as a crash. We should decide whether a TIMED_OUT, an APP_CRASH (user error) or something like SIMULATOR_FAILURE which would be considered as infra failure and retried.
We should probably try to run this app again and see if it fails again.

The ADB log suggests it's an infra failure as the emulator hung. The failing logcat suggests the same so we could also decide based on that.

ADB log

D/DOTNET ( 3408): assembly_preload_hook: System.ComponentModel /data/data/net.dot.System.Net.Security.Tests/files
D/DOTNET ( 3408): assembly_preload_hook: System.Threading.ThreadPool /data/data/net.dot.System.Net.Security.Tests/files
I/art ( 3408): Background sticky concurrent mark sweep GC freed 52190(1722KB) AllocSpace objects, 0(0B) LOS objects, 12% free, 9MB/11MB, paused 581us total 118.837ms
D/DOTNET ( 3408): assembly_preload_hook: Microsoft.Win32.Registry /data/data/net.dot.System.Net.Security.Tests/files
D/DOTNET ( 3408): assembly_preload_hook: Microsoft.Win32.Primitives /data/data/net.dot.System.Net.Security.Tests/files
D/DOTNET ( 3408): assembly_preload_hook: Microsoft.DotNet.RemoteExecutor /data/data/net.dot.System.Net.Security.Tests/files
D/DOTNET ( 3408): assembly_preload_hook: System.Resources.ResourceManager /data/data/net.dot.System.Net.Security.Tests/files
D/DOTNET ( 3408): assembly_preload_hook: System.Diagnostics.FileVersionInfo /data/data/net.dot.System.Net.Security.Tests/files
W/art ( 3408): Native thread exiting without having called DetachCurrentThread (maybe it's going to use a pthread_key_create destructor?): Thread[12,tid=3428,Native,Thread*=0xe2346c00,peer=0x12c050e0,"Thread-63"]
D/DOTNET ( 3408): DetatchThreadFromJNI: Detaching thread from JNI
D/DOTNET ( 3408): GetJNIEnv: Registering JNI thread detach. env ptr 0xdfe4c3c0. Key: 38
I/DOTNET ( 3408): [Test environment: 32-bit .NET [collection-per-class, non-parallel]]
I/DOTNET ( 3408): [Test framework: xUnit.net 2.4.2.0]
I/DOTNET ( 3408):
I/DOTNET ( 3408): Test collection for System.Net.Security.Tests.ServerAsyncAuthenticateTest
D/DOTNET ( 3408): assembly_preload_hook: System.Text.Encoding /data/data/net.dot.System.Net.Security.Tests/files
D/DOTNET ( 3408): GetJNIEnv: Registering JNI thread detach. env ptr 0xe152a860. Key: 38
W/art ( 3408): Native thread exiting without having called DetachCurrentThread (maybe it's going to use a pthread_key_create destructor?): Thread[13,tid=3426,Native,Thread*=0xe2346c00,peer=0x12c05140,"Thread-65"]
D/DOTNET ( 3408): DetatchThreadFromJNI: Detaching thread from JNI
I/UsageStatsService( 1471): User[0] Flushing usage stats to disk
W/BatteryStatsImpl( 1471): Couldn't get kernel wake lock stats
I/ProcessStatsService( 1471): Prepared write state in 0ms
I/ActivityManager( 1471): Killing 2220:com.android.dialer/u0a4 (adj 15): empty for 1801s
W/libprocessgroup( 1471): failed to open /acct/uid_10004/pid_2220/cgroup.procs: No such file or directory
I/ActivityManager( 1471): Killing 2279:com.android.calendar/u0a17 (adj 11): empty for 1823s
I/ActivityManager( 1471): Killing 2400:com.android.mms/u0a9 (adj 13): empty for 1839s
D/CountryDetector( 1471): No listener is left
I/ActivityManager( 1471): Killing 1949:com.android.printspooler/u0a39 (adj 13): empty for 1841s
I/ActivityManager( 1471): Killing 2165:com.android.exchange/u0a27 (adj 13): empty for 1842s
I/ActivityManager( 1471): Killing 2181:com.android.email/u0a25 (adj 13): empty for 1842s
I/ActivityManager( 1471): Killing 2366:com.android.managedprovisioning/u0a8 (adj 13): empty for 1842s
W/libprocessgroup( 1471): failed to open /acct/uid_10017/pid_2279/cgroup.procs: No such file or directory
W/libprocessgroup( 1471): failed to open /acct/uid_10039/pid_1949/cgroup.procs: No such file or directory
W/libprocessgroup( 1471): failed to open /acct/uid_10027/pid_2165/cgroup.procs: No such file or directory
W/libprocessgroup( 1471): failed to open /acct/uid_10025/pid_2181/cgroup.procs: No such file or directory
W/libprocessgroup( 1471): failed to open /acct/uid_10008/pid_2366/cgroup.procs: No such file or directory
W/libprocessgroup( 1471): failed to open /acct/uid_10009/pid_2400/cgroup.procs: No such file or directory

@premun premun added bug android Android area emulator Related to an emulator/Simulator labels May 13, 2022
@premun premun self-assigned this May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Android area bug emulator Related to an emulator/Simulator
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant