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

Unity 2021 + Android API 30 Smoke test crash #719

Closed
vaind opened this issue Apr 29, 2022 · 5 comments · Fixed by #1035
Closed

Unity 2021 + Android API 30 Smoke test crash #719

vaind opened this issue Apr 29, 2022 · 5 comments · Fixed by #1035

Comments

@vaind
Copy link
Collaborator

vaind commented Apr 29, 2022

After splitting the Android smoke test build into a separate job and running it via the integration-test scripts (i.e. create empty project, build, add unity, build, test) in PR #686, the "smoke-test" part of the test now consistently crashes the app in CI (not reproducible locally yet) when run a Unity 2021 build on Android API 30 x86 emulator - for example, see this run: https://github.com/getsentry/sentry-unity/runs/6227149023?check_suite_focus=true

--------- beginning of crash
04-29 11:22:58.137  3521  3554 E AndroidRuntime: FATAL EXCEPTION: UnityMain
04-29 11:22:58.137  3521  3554 E AndroidRuntime: Process: com.DefaultCompany.IntegrationTest, PID: 3521
04-29 11:22:58.137  3521  3554 E AndroidRuntime: java.lang.Error: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-29 11:22:58.137  3521  3554 E AndroidRuntime: Version '2021.3.1f1 (3b70a0754835)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'x86'
04-29 11:22:58.137  3521  3554 E AndroidRuntime: Build fingerprint: 'Android/sdk_phone_x86/generic_x86:11/RSR1.210210.001.A1/7193139:userdebug/dev-keys'
04-29 11:22:58.137  3521  3554 E AndroidRuntime: Revision: '0'
04-29 11:22:58.137  3521  3554 E AndroidRuntime: ABI: 'x86'
04-29 11:22:58.137  3521  3554 E AndroidRuntime: Timestamp: 2022-04-29 11:22:56+0000
04-29 11:22:58.137  3521  3554 E AndroidRuntime: pid: 3521, tid: 3554, name: UnityMain  >>> com.DefaultCompany.IntegrationTest <<<
04-29 11:22:58.137  3521  3554 E AndroidRuntime: uid: 10121
04-29 11:22:58.137  3521  3554 E AndroidRuntime: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x6c0000
04-29 11:22:58.137  3521  3554 E AndroidRuntime:     eax 00000000  ebx 00006000  ecx 00003f00  edx 006c0000
04-29 11:22:58.137  3521  3554 E AndroidRuntime:     edi 00004000  esi bbb23ff0
04-29 11:22:58.137  3521  3554 E AndroidRuntime:     ebp bd7bf3d8  esp bd7bf394  eip ee02a939
04-29 11:22:58.137  3521  3554 E AndroidRuntime: 
04-29 11:22:58.137  3521  3554 E AndroidRuntime: backtrace:
04-29 11:22:58.137  3521  3554 E AndroidRuntime:       #00 pc 00055939  /apex/com.android.runtime/lib/bionic/libc.so (wcscmp+825) (BuildId: 6e3a0180fa6637b68c0d181c343e6806)
04-29 11:22:58.137  3521  3554 E AndroidRuntime:       #01 pc 0061b349  /data/app/~~MYfxsgTRMT04Rp3X73WdCw==/com.DefaultCompany.IntegrationTest-GR7ZEbIrFLV7jIOJYcwF0g==/lib/x86/libunity.so (BuildId: 196160b2df8717a6f2d40e3d9d28e4b942cf61d4)
04-29 11:22:58.137  3521  3554 E AndroidRuntime:       #02 pc 005c7e3d  /data/app/~~MYfxsgTRMT04Rp3X73WdCw==/com.DefaultCompany.IntegrationTest-GR7ZEbIrFLV7jIOJYcwF0g==/lib/x86/libunity.so (BuildId: 196160b2df8717a6f2d40e3d9d28e4b942cf61d4)
04-29 11:22:58.137  3521  3554 E AndroidRuntime:       #03 pc 0075c12f  /data/app/~~MYfxsgTRMT04Rp3X73WdCw==/com.DefaultCompany.IntegrationTest-GR7ZEbIrFLV7jIOJYcwF0g==/lib/x86/libunity.so (BuildId: 196160b2df8717a6f2d40e3d9d28e4b942cf61d4)
04-29 11:22:58.137  3521  3554 E AndroidRuntime:       #04 pc 005b62ba  /data/app/~~MYfxsgTRMT04Rp3X73WdCw==/com.DefaultCompany.IntegrationTest-GR7ZEbIrFLV7jIOJYcwF0g==/lib/x86/libunity.so (BuildId: 196160b2df8717a6f2d40e3d9d28e4b942cf61d4)
04-29 11:22:58.137  3521  3554 E AndroidRuntime:       #05 pc 0056acd0  /data/app/~~MYfxsgTRMT04Rp3X73WdCw==/com.DefaultCompany.IntegrationTest-GR7ZEbIrFLV7jIOJYcwF0g==/lib/x86/libunity.so (BuildId: 196160b2df8717a6f2d40e3d9d28e4b942cf61d4)
04-29 11:22:58.137  3521  3554 E AndroidRuntime:       #06 pc 00303c23  /data/app/~~MYfxsgTRMT04Rp3X73WdCw==/com.DefaultCompany.IntegrationTest-GR7ZEbIrFLV7jIOJYcwF0g==/lib/x86/libunity.so (BuildId: 196160b2df8717a6f2d40e3d9d28e4b942cf61d4)
04-29 11:22:58.137  3521  3554 E AndroidRuntime:       #07 pc 0056b53b  /data/app/~~MYfxsgTRMT04Rp3X73WdCw==/com.DefaultCompany.IntegrationTest-GR7ZEbIrFLV7jIOJYcwF0g==/lib/x86/libunity.so (BuildId: 196160b2df8717a6f2d40e3d9d28e4b942cf61d4)
04-29 11:22:58.137  3521  3554 E AndroidRuntime:       #08 pc 0056b7ef  /data/app/~~MYfxsgTRMT04Rp3X73WdCw==/com.DefaultCompany.IntegrationTest-GR7ZEbIrFLV7jIOJYcwF0g==/lib/x86/libunity.so (BuildId: 196160b2df8717a6f2d40e3d9d28e4b942cf61d4)
04-29 11:22:58.137  3521  3554 E AndroidRuntime:       #09 pc 002cfbd9  /data/app/~~MYfxsgTRMT04Rp3X73WdCw==/com.DefaultCompany.IntegrationTest-GR7ZEbIrFLV7jIOJYcwF0g==/lib/x86/libunity.so (BuildId: 196160b2df8717a6f2d40e3d9d28e4b942cf61d4)
04-29 11:22:58.137  3521  3554 E AndroidRuntime:       #10 pc 002b8d32  /data/app/~~MYfxsgTRMT04Rp3X73WdCw==/com.DefaultCompany.IntegrationTest-GR7ZEbIrFLV7jIOJYcwF0g==/lib/x86/libunity.so (BuildId: 196160b2df8717a6f2d40e3d9d28e4b942cf61d4)
04-29 11:22:58.137  3521  3554 E AndroidRuntime:       #11 pc 002b9b34  /data/app/~~MYfxsgTRMT04Rp3X73WdCw==/com.DefaultCompany.IntegrationTest-GR7ZEbIrFLV7jIOJYcwF0g==/lib/x86/libunity.so (BuildId: 196160b2df8717a6f2d40e3d9d28e4b942cf61d4)
04-29 11:22:58.137  3521  3554 E AndroidRuntime:       #12 pc 002d22bb  /data/app/~~MYfxsgTRMT04Rp3X73WdCw==/com.DefaultCompany.IntegrationTest-GR7ZEbIrFLV7jIOJYcwF0g==/lib/x86/libunity.so (BuildId: 196160b2df8717a6f2d40e3d9d28e4b942cf61d4)
04-29 11:22:58.137  3521  3554 E AndroidRuntime:       #13 pc 00006298  /data/app/~~MYfxsgTRMT04Rp3X73WdCw==/com.DefaultCompany.IntegrationTest-GR7ZEbIrFLV7jIOJYcwF0g==/oat/x86/base.odex
04-29 11:22:58.137  3521  3554 E AndroidRuntime: 
04-29 11:22:58.137  3521  3554 E AndroidRuntime: 	at libc.wcscmp(wcscmp:825)
04-29 11:22:58.137  3521  3554 E AndroidRuntime: 	at libunity.0x61b349(Native Method)
04-29 11:22:58.137  3521  3554 E AndroidRuntime: 	at libunity.0x5c7e3d(Native Method)
04-29 11:22:58.137  3521  3554 E AndroidRuntime: 	at libunity.0x75c12f(Native Method)
04-29 11:22:58.137  3521  3554 E AndroidRuntime: 	at libunity.0x5b62ba(Native Method)
04-29 11:22:58.137  3521  3554 E AndroidRuntime: 	at libunity.0x56acd0(Native Method)
04-29 11:22:58.137  3521  3554 E AndroidRuntime: 	at libunity.0x303c23(Native Method)
04-29 11:22:58.137  3521  3554 E AndroidRuntime: 	at libunity.0x56b53b(Native Method)
04-29 11:22:58.137  3521  3554 E AndroidRuntime: 	at libunity.0x56b7ef(Native Method)
04-29 11:22:58.137  3521  3554 E AndroidRuntime: 	at libunity.0x2cfbd9(Native Method)
04-29 11:22:58.137  3521  3554 E AndroidRuntime: 	at libunity.0x2b8d32(Native Method)
04-29 11:22:58.137  3521  3554 E AndroidRuntime: 	at libunity.0x2b9b34(Native Method)
04-29 11:22:58.137  3521  3554 E AndroidRuntime: 	at libunity.0x2d22bb(Native Method)
04-29 11:22:58.137  3521  3554 E AndroidRuntime: 	at base.0x6298(Native Method)

For now the test has been disabled to unblock the PR, because it is not deemed to be caused by the changes in the PR but to be an existing issue, because that PR doesn't change anything about the actual package, just the test execution.

Note: I've also tried to update the CI so that it doesn't do the first build without sentry, to make sure the error isn't caused by the second build and it isn't - that app still crashes even with a single build, with unity included from the beginning.

@vaind vaind moved this to Needs Discussion in Mobile & Cross Platform SDK Apr 29, 2022
@vaind vaind moved this from Needs Discussion to Needs Investigation in Mobile & Cross Platform SDK Apr 29, 2022
@bruno-garcia bruno-garcia assigned vaind and lucas-zimerman and unassigned vaind May 17, 2022
@vaind
Copy link
Collaborator Author

vaind commented May 17, 2022

I've tried if the app crashes with just plain build, without Sentry package included and indeed it does, so this has nothing to do with Sentry: https://github.com/getsentry/sentry-unity/runs/6475554309?check_suite_focus=true

@vaind
Copy link
Collaborator Author

vaind commented Jun 10, 2022

Unity 2020 Android API 30 build is rather flaky recently too: https://github.com/getsentry/sentry-unity/runs/6817497012?check_suite_focus=true

@lucas-zimerman
Copy link
Collaborator

Before anything I think it's a good start to make those logs more readable. Logcat has a limit of text that can be output per line, so the event is getting cut on the log

2022-06-09T17:14:04.0102000Z 06-09 17:13:48.910  2516  2642 I Unity   : Sentry: SMOKE TEST: Intercepted HTTP Request #2 = {"sdk":{"name":"sentry.dotnet","version":"3.17.0"},"event_id":"b4da983c56dd4ba680c8e089a650ebb2"}
2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910  2516  2642 I Unity   : {"type":"event","length":5560}
2022-06-09T17:14:04.0104400Z 06-09 17:13:48.910  2516  2642 I Unity   : {"modules":{"mscorlib":"4.0.0.0","System.Configuration":"4.0.0.0","Mono.Security":"4.0.0.0","System.Xml":"4.0.0.0","System":"4.0.0.0","Sentry.System.Buffers":"4.0.3.0","Sentry.System.Numerics.Vectors":"4.1.4.0","Sentry.System.Runtime.CompilerServices.Unsafe":"5.0.0.0","System.Core":"4.0.0.0","UnityEngine.SharedInternalsModule":"0.0.0.0","Sentry.System.Memory":"4.0.1.1","Sentry.System.Threading.Tasks.Extensions":"4.2.0.1","UnityEngine.CoreModule":"0.0.0.0","Sentry.Microsoft.Bcl.AsyncInterfaces":"5.0.0.0","Sentry.System.Collections.Immutable":"5.0.0.0","Sentry.System.Text.Encodings.Web":"5.0.0.1","UnityEngine.GridModule":"0.0.0.0","UnityEngine.InputLegacyModule":"0.0.0.0","UnityEngine.Physics2DModule":"0.0.0.0","UnityEngine.TextRenderingModule":"0.0.0.0","Sentry.System.Reflection.Metadata":"5.0.0.0","Sentry.System.Text.Json":"5.0.0.0"

I propose a solution for this case by formatting the json and splitting each line of it into a ne log, examle:

2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910  2516  2642 I Unity   :  {
2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910  2516  2642 I Unity   :     "modules":{
2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910  2516  2642 I Unity   :        "mscorlib":"4.0.0.0",
2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910  2516  2642 I Unity   :        "System.Configuration":"4.0.0.0",
2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910  2516  2642 I Unity   :        "Mono.Security":"4.0.0.0",
2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910  2516  2642 I Unity   :        "System.Xml":"4.0.0.0",
2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910  2516  2642 I Unity   :        "System":"4.0.0.0",
2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910  2516  2642 I Unity   :        "Sentry.System.Buffers":"4.0.3.0",
2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910  2516  2642 I Unity   :        "Sentry.System.Numerics.Vectors":"4.1.4.0",
2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910  2516  2642 I Unity   :        "Sentry.System.Runtime.CompilerServices.Unsafe":"5.0.0.0",
2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910  2516  2642 I Unity   :        "System.Core":"4.0.0.0",
2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910  2516  2642 I Unity   :        "UnityEngine.SharedInternalsModule":"0.0.0.0",
2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910  2516  2642 I Unity   :        "Sentry.System.Memory":"4.0.1.1",
2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910  2516  2642 I Unity   :        "Sentry.System.Threading.Tasks.Extensions":"4.2.0.1",
2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910  2516  2642 I Unity   :        "UnityEngine.CoreModule":"0.0.0.0",
2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910  2516  2642 I Unity   :        "Sentry.Microsoft.Bcl.AsyncInterfaces":"5.0.0.0",
2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910  2516  2642 I Unity   :        "Sentry.System.Collections.Immutable":"5.0.0.0",
2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910  2516  2642 I Unity   :        "Sentry.System.Text.Encodings.Web":"5.0.0.1",
2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910  2516  2642 I Unity   :        "UnityEngine.GridModule":"0.0.0.0",
2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910  2516  2642 I Unity   :        "UnityEngine.InputLegacyModule":"0.0.0.0",
2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910  2516  2642 I Unity   :        "UnityEngine.Physics2DModule":"0.0.0.0",
2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910  2516  2642 I Unity   :        "UnityEngine.TextRenderingModule":"0.0.0.0",
2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910  2516  2642 I Unity   :        "Sentry.System.Reflection.Metadata":"5.0.0.0",
2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910  2516  2642 I Unity   :        "Sentry.System.Text.Json":"5.0.0.0"
2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910  2516  2642 I Unity   :  	}
2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910  2516  2642 I Unity   :  }

What do you thinks think?

@bitsandfoxes
Copy link
Contributor

bitsandfoxes commented Jun 22, 2022

That would apply to logs like when we're printing the whole event?
Works for me. If we're already splitting the log, can we get rid or at least truncate 2022-06-09T17:14:04.0102480Z 06-09 17:13:48.910 2516 2642 I Unity : as well?

@vaind
Copy link
Collaborator Author

vaind commented Oct 24, 2022

I've recently tried enabling this and it still fails. I think, considering I've previously tried running the same app without Sentry included at all, we can assume it's a Unity issue and close this. I'll leave a comment in the code pointing to this issue for explanation and if we want to pursue this further at some time down the road.

Latest run in CI: https://github.com/getsentry/sentry-unity/actions/runs/3302480440/jobs/5449627380
logs - Run Android 30 Unity 2022 Smoke Test.zip

error
  10-22 08:34:42.848  2325  2349 E CRASH   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
  10-22 08:34:42.849  2325  2349 E CRASH   : Version '2022.1.20f1 (01d83b40d570)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'x86_64'
  10-22 08:34:42.849  2325  2349 E CRASH   : Build fingerprint: 'Android/sdk_phone_x86_64/generic_x86_64:11/RSR1.210722.012/7758210:userdebug/test-keys'
  10-22 08:34:42.849  2325  2349 E CRASH   : Revision: '0'
  10-22 08:34:42.849  2325  2349 E CRASH   : ABI: 'x86_64'
  10-22 08:34:42.849  2325  2349 E CRASH   : Timestamp: 2022-10-22 08:34:42+0000
  10-22 08:34:42.849  2325  2349 E CRASH   : pid: 2325, tid: 2349, name: UnityMain  >>> com.DefaultCompany.IntegrationTest <<<
  10-22 08:34:42.849  2325  2349 E CRASH   : uid: 10130
  10-22 08:34:42.849  2325  2349 E CRASH   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x880000
  10-22 08:34:42.849  2325  2349 E CRASH   :     rax 0000000000880000  rbx 00007053f0b3ad90  rcx 0000000000000000  rdx 0000000000010000
  10-22 08:34:42.849  2325  2349 E CRASH   :     r8  00007053f0000000  r9  0000000000000006  r10 00000000004c5158  r11 00000000000000e3
  10-22 08:34:42.850  2325  2349 E CRASH   :     r12 00007053f0a71188  r13 000070547f5f0fc6  r14 0000000000000000  r15 0000000000010000
  10-22 08:34:42.850  2325  2349 E CRASH   :     rdi 0000000000880000  rsi 0000000000000000
  10-22 08:34:42.850  2325  2349 E CRASH   :     rbp 00007053f0b3ac10  rsp 000070547c11a878  rip 00007057698d567a
  10-22 08:34:42.850  2325  2349 E CRASH   : backtrace:
  10-22 08:34:42.850  2325  2349 E CRASH   :       #00 pc 000000000005067a  /apex/com.android.runtime/lib64/bionic/libc.so (gwp_asan::compression::pack(unsigned long const*, unsigned long, unsigned char*, unsigned long)+122) (BuildId: 3707c39fc397eeaa328142d90b50a973)
  10-22 08:34:42.850  2325  2349 E CRASH   :       #01 pc 0000000000098b27  [anon:.bss]
  10-22 08:34:42.850  2382  2382 W app_process: Unexpected CPU variant for X86 using defaults: x86_64

@vaind vaind closed this as completed Oct 25, 2022
Repository owner moved this from Needs Investigation to Done in Mobile & Cross Platform SDK Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants