Crash upon startup on certain devices

Create issue
Issue #19 resolved
Josef Frank created an issue

I have created a simple .apk using this code and tested it on six devices. On two of these devices (listed below), the game installs but once it is opened, the screen rotates into landscape mode and goes black for a couple seconds, then the game crashes.

The game crashes on these devices:

Device 1:

  • Model: LG Optimus 2X (P990)
  • OS: Cyanogenmod 10.1 (Android 4.2.2)

Device 2:

  • Model: Samsung Galaxy Ace (S5830)
  • OS: Cyanogenmod 10.1 (Android 4.2.2)

Similarities include relatively small screens and a specific Android / CM number.

The game runs properly on these devices:

Device 1:

  • Samsung Galaxy Note (GT-N7000)
  • Android 2.3.6

Device 2:

  • Samsung Galaxy S3 (GT-I9300)
  • Cyanogenmod 10.2 (Android 4.3.1)

Device 3:

  • Samsung Galaxy S4 (GT-I9300)
  • Android 4.3

Device 4:

  • LG Optimus 4X HD (LG P880)
  • Cyanogenmod 11 (Android 4.4.2)

Comments (29)

  1. Jairo Luiz

    Put the other devices too in the description.

    Maybe, comparing some hardware/software details helps to solve this issue.

  2. Josef Frank reporter

    I have been unable to find a log file. Can you give me a clue on where to look?

    It could be possible that the crash is due to processor types. The Samsung device is ARMv6.

  3. Josef Frank reporter

    In Android SDK's LogCat I get "Fatal signal 4 (SIGILL)". But yeah, I'd say it's the build settings.

    I think I'll mark this as resolved then, but for curiosity's sake, is there any way I could modify the build options to test this on an ARMv6 device?

  4. Jairo Luiz

    Try changing the config to APP_ABI := armeabi armeabi-v7a and build a new apk. Maybe work.

    The project build without problems, but I don't have any device with this processor type here.

  5. Josef Frank reporter

    Thanks for the build. Unfortunately, it crashes like usual. Oh well.

    Thank you for your help though, it has been very much appreciated.

  6. Josef Frank reporter

    Will test ARMv6 build on Ace soon. That link looks interesting. I'm on NDK r9c but I'll try a few options from that link soon.

  7. Jairo Luiz

    I tested with the stock Lua and works like a charm on my device.

    I'll post the apk. Wait a minute.

  8. Jairo Luiz

    The problem is: the libluajit.a in ./jni/LuaJIT-2.0.1/src/ is compiled only to armeabi-v7a.

    The solution is to build this library during the ndk-build process, for both architetures

  9. Martin Felis repo owner

    So you rebuilt everything for armv6 and then it runs on the Samsung Galaxy Tab 10.1 P7510? Nevertheless on that device it should also run using a armv7a build.

    Did you manage to build LuaJIT during the ndk-build process? I did not manage to do so, therefore I resorted to just ship a precompiled static library.

  10. Jairo Luiz

    You can compile for both, armv6 and armv7a. The package installer decide the better lib for the device.

  11. Martin Felis repo owner

    Yes, that would be possible.

    However what device were you able to get it run, the Samsung Galaxy Tab 10.1 P7510? Were you able to run it using a armv7 or only a armv6 build?

    The device should be able to run the armv7 build. Maybe adjusting the compiler flags in

    If a armv7 build using stock Lua works, then it could be that changing (and running) jni/LuaJIT-2.0.1/ to

    NDKF="--sysroot $NDK/platforms/android-$NDKABI/arch-arm"
    NDKARCH="-march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16"
    # NDKARCH="-march=armv7-a"

    (note the changed -mfpu=vfpv3-d16 flag) could make LuaJIT work on armv7, too!

    Can you try that for me?

  12. Martin Felis repo owner

    Can you first try to rebuild the static library using the of my previous post. I think it might work and should give you better performance on the P7510 as it actually uses a armv7a processor.

    How big is the resulting .apk (without any game in the assets/ folder)? It should be quite big as you end up with roughly twice the amount of binary code.

    I have commented your changes in your repository (but overall: cool!)

  13. Josef Frank reporter

    I can confirm that 'love-armv6-and-armv7.apk' runs without fail on my LG Optimus 2X. I haven't been able to test the Galaxy Ace yet, however.

    EDIT: Works perfectly on the Ace too.

  14. Log in to comment