GrapheneOS / os-issue-tracker

Issue tracker for GrapheneOS Android Open Source Project hardening work. Standalone projects like Auditor, AttestationServer and hardened_malloc have their own dedicated trackers.
https://grapheneos.org/
353 stars 19 forks source link

Unity Game Engine Segfault #586

Closed Algebro7 closed 3 years ago

Algebro7 commented 3 years ago

I'm not sure if this is an issue with the apps or something that could be fixed on the Graphene side, so feel free to close this if it's not a potential Graphene bug. I'm trying to run Pokemon Home and getting a crash as soon as the app launches. I assumed it was just a missing google play services issue and couldn't be helped but I noticed the following crash in pidcat related to Unity trying to reference invalid addresses:

                  Unity  E  Using memoryadresses from more that 16GB of memory
                         E  (Filename:  Line: 120)
                  CRASH  E  signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0000000000003615
                         E  *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
                         E  Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
                         E  Build fingerprint: 'Android/aosp_blueline/blueline:11/RQ3A.210605.005/2021.06.20.20:user/release-keys'
                         E  Revision: 'MP1.0'
                         E  pid: 17834, tid: 17934, name: UnityMain  >>> jp.pokemon.pokemonhome <<<
                         E      x0   0000000000000000  x1   0000000000000000  x2   0000000000000003  x3   0000000000000003
                         E      x4   0000005df29e8dd0  x5   0000000000000048  x6   fefeff0909282f31  x7   7f7f7f7f7f7f7f7f
                         E      x8   000000000000351d  x9   6e0598f6509a5d00  x10  0000000000000001  x11  0000000000000000
                         E      x12  0000005df29e8ef0  x13  000000000000004e  x14  000011bc8919095a  x15  0001be0f58e64c3c
                         E      x16  0000005df3a251b8  x17  0000006092b12ef8  x18  0000005df2a5d970  x19  0000005df3aa02c0
                         E      x20  0000002e3f3c05c0  x21  000000000000001f  x22  0000005df3aa0300  x23  0000005df3aa0360
                         E      x24  00000000000000a1  x25  0000000000000038  x26  0000005df2a26040  x27  00000000726b3650
                         E      x28  00000000726af358  x29  0000000013180570  x30  0000005df32b5a18
                         E      sp   0000005df29ea9d0  pc   0000005df32b5a54  pstate 0000000060000000

Got a similar unity error (but no segfault) in MTG Arena (which also immediately closes when trying to open it):

                  Unity  E  Using memoryadresses from more than 16GB of memory
                         E  (Filename:  Line: 120)
                         E  Using memoryadresses from more than 16GB of memory
                         E  (Filename:  Line: 120)

Eve Portal uses Unity as well and I get the same errors in pidcat about the 16GB of memory.

Does this look like some bug in Unity or is there something in Graphene that could be changed to work around it?

thestinger commented 3 years ago

This is a Unity memory corruption bug and needs to be addressed upstream.

thestinger commented 3 years ago

We're aware of this but have had no luck getting them to fix it at this point.

thestinger commented 3 years ago

https://unity3d.com/unity/whats-new/unity-5.4.1

Linux: Removed 16GB total memory limit.

Perhaps they also need to do this for Android. Please contact them about it and provide clear details + refer to the change for Linux. Do not mention GrapheneOS. Say you're using the stock OS. You need to get them to resolve it. There's nothing we can do and if users don't help report issues to app/library developers, they'll never be resolved. In this case, it needs to be fixed by Unity and then app developers need to upgrade it.

Algebro7 commented 3 years ago

Thanks for the guidance--doing that now!

thestinger commented 3 years ago

It's detecting that more than 16GB of address space is in use and aborting arbitrarily. It's incorrect and they need to fix it.

thestinger commented 3 years ago

No clue why they would do something so stupid. If they only removed it for non-Android Linux and not Android, then they need to do that. If they've already fixed it in Unity, every app using it will need to update...

Algebro7 commented 3 years ago

I've submitted a bug report with all the details (without mentioning graphene) and a reference to the Linux change. I'll let you know if I hear back

thestinger commented 3 years ago

It's possible that they did fix it for Android but apps are still using the old engine. I have a feeling that they haven't fixed it though.