Android Release Export Segfault

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Bush2Tree

Hey all,

I’ve got this weird bug where I get a segfault when attempting to run on a real android device using a release build. No segfault occurs when running on an emulator or when using a debug build.

Using adb -d logcat turns up a standard SIGSEGV log, mentioning a GLThread 1200.

Does anyone know what could be going on here?

:bust_in_silhouette: Reply From: Bush2Tree

After some more research, I suspected that the infamous dangling variant bug was to blame. It turns out that I was right. Here’s how I got my release builds to work:

I downloaded the godot 3.2.3 source, and then modified the .cpp and .h files such that the dangling variant fix would apply to release builds too. Luckily, all of this can be done by simply removing preprocessor commands. Then, I rebuilt godot and the applicable build templates. It’s a lot of work, but it works.

On a side note, it’s a bit too late for this but I think the dangling variant fix should apply to release builds as well. I would imagine that the vast majority of godot users are like me, and would gladly take the performance hit in exchange for not having segfaults in release builds. For those who care enough about performance that they are willing to tiptoe around segfaults, a separate build/source should be provided. But that’s just my two cents…