K4os.Compression.LZ4: Segfault in Unity 2018.3.8 compiled on Android using IL2CPP

When running a Unity 2018.3.8 app on Android compiled with IL2CPP, I’m getting a SIGSEGV when calling LZ4Codec.Decode(). The encoded data is coming from a server running .Net Core 2.1 on Linux, encoded with LZ4Codec.Encode(). Everything works fine when running Unity in editor, I’m experience the segfault only on Android devices. Do you have any idea what could be going wrong in this build scenario?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 30 (11 by maintainers)

Most upvoted comments

Hey Mikos, Fowarded unity response related to the bug lz4 arm7 crash.

thanks

---------- Forwarded message --------- From: Unity QA bugs@unity3d.com Date: Thu, Jul 23, 2020, 3:17 PM Subject: Re: (Case 1251505) Armv7 vs Armv64 IL2CPP crashes on decompres/compress assetbundle using custom compression To: Josep Maria Calull Mercadé calullmercade@gmail.com

Josep,

Thanks for reporting this issue. It looks like the code here will do an unaligned memory access, which is not allowed on armv7, hence the crash. Mono works in this case because it generates code that is less efficient than IL2CPP, and does only aligned memory access.

With IL2CPP, we have chosen to convert the C# code as-is, so that the generated code will do unaligned access if the C# code does.

I would recommend following up with the library developer - although looking at the Github issue thread, that might already be the case.

Please let me know if you have any questions about this issue. Thanks again!

Josh Peterson Senior Software Developer

– Thank you for submitting your support request! In the meantime I would suggest checking out http://answers.unity3d.com/ and our Forums at http://forum.unity3d.com/ for additional help.

Track the status of your ticket here: https://fogbugz.unity3d.com/default.asp?1251505_l59gi75pmf7g5vch (Please do not share this url with anyone else. Doing so will give them access to all information you share with us. If you post this url on forums or blogs we cannot prevent others from viewing all your support cases and bug reports.)

-----Original Message----- From: “Josep Maria Calull Mercadé” calullmercade@gmail.com Reply-To: “Josep Maria Calull Mercadé” calullmercade@gmail.com Date: Wed, 3 Jun 2020 10:21:54 +0200 To: “Monika Pociute” bugs@unity3d.com Subject: Re: (Case 1251505) Armv7 vs Armv64 IL2CPP crashes on decompres/compress assetbundle using custom compression

Thank you for your response. samsung galaxy s5 it crashes(armv7) while armv64 device will not. i just build and apk+il2cpp and play.

mono not crashing.

On Wed, Jun 3, 2020, 9:48 AM Monika Pociute bugs@unity3d.com wrote:

Hi,

Thank you for contacting Unity about your issue.

Unfortunately, we are not able to reproduce it. Are you still experiencing this problem or was it a one time issue? If you’re still facing this problem, could you please provide us with more information - the exact steps needed to reproduce on our side?

Thanks, Monika Customer QA Team

Thanks. I’ll close the issue.