Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Gideros crashes when using physics — Gideros Forum

Gideros crashes when using physics

smarushchenkosmarushchenko Member
edited September 2015 in Bugs and issues
Gideros crashes when trying Box2D examples nevertheless using giderosplayer or built apk. Here is a logcat excerption of Bridge apk:
F/libc    ( 9771): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=128), thread 9785 (Thread-3285)
I/DEBUG   (  133): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (  133): Build fingerprint: 'Lenovo/K900_ROW/K900_ROW:4.2.1/JOP40D/K900_ROW_1_S_2_009_0553_141125:user/release-keys'
I/DEBUG   (  133): Revision: '0'
I/DEBUG   (  133): pid: 9771, tid: 9785, name: Thread-3285  >>> com.giderosmobile.androidtemplate <<<
I/DEBUG   (  133): signal 11 (SIGSEGV), code 128 (?), fault addr 00000000
I/DEBUG   (  133):     eax 0000000e  ebx 5f25dac4  ecx 5f3672a0  edx 63d97374
I/DEBUG   (  133):     esi 63dc1170  edi 00000000
I/DEBUG   (  133):     xcs 00000073  xds 0000007b  xes 0000007b  xfs 00000000  xss 0000007b
I/DEBUG   (  133):     eip 5f0d64ef  ebp 63d972cc  esp 5f3671cc  flags 00010246
I/DEBUG   (  133): 
I/DEBUG   (  133): backtrace:
I/DEBUG   (  133):     #00  pc 001e04ef  /data/app-lib/com.giderosmobile.androidtemplate-1/libgideros.so
I/DEBUG   (  133):     #01  pc 001b7135  /dev/ashmem/dalvik-heap (deleted)
I/DEBUG   (  133): 
I/DEBUG   (  133): stack:
I/DEBUG   (  133):          5f36718c  00000000  
I/DEBUG   (  133):          5f367190  00000000  
I/DEBUG   (  133):          5f367194  00000000  
I/DEBUG   (  133):          5f367198  00000000  
I/DEBUG   (  133):          5f36719c  00000000  
I/DEBUG   (  133):          5f3671a0  00000000  
I/DEBUG   (  133):          5f3671a4  00000000  
I/DEBUG   (  133):          5f3671a8  00000000  
I/DEBUG   (  133):          5f3671ac  00000000  
I/DEBUG   (  133):          5f3671b0  00000000  
I/DEBUG   (  133):          5f3671b4  00000000  
I/DEBUG   (  133):          5f3671b8  00000000  
I/DEBUG   (  133):          5f3671bc  00000000  
I/DEBUG   (  133):          5f3671c0  00000000  
I/DEBUG   (  133):          5f3671c4  00000000  
I/DEBUG   (  133):          5f3671c8  00000000  
I/DEBUG   (  133):     #00  5f3671cc  00000000  
I/DEBUG   (  133):          5f3671d0  41bd39fe  /dev/ashmem/dalvik-heap (deleted)
I/DEBUG   (  133):          5f3671d4  401195f5  /system/lib/libm.so (static_func+5)
I/DEBUG   (  133):          5f3671d8  4011961f  /system/lib/libm.so (cosf+15)
I/DEBUG   (  133):          5f3671dc  3e0ba2e8  
I/DEBUG   (  133):          5f3671e0  bd80b7e0  
I/DEBUG   (  133):          5f3671e4  00000000  
I/DEBUG   (  133):          5f3671e8  3d68ba2e  
I/DEBUG   (  133):          5f3671ec  00000000  
I/DEBUG   (  133):          5f3671f0  00000008  
I/DEBUG   (  133):          5f3671f4  5f25dac4  /data/app-lib/com.giderosmobile.androidtemplate-1/libgideros.so
I/DEBUG   (  133):          5f3671f8  5f0c1ac9  /data/app-lib/com.giderosmobile.androidtemplate-1/libgideros.so
I/DEBUG   (  133):          5f3671fc  00000000  
I/DEBUG   (  133):          5f367200  5f1d2210  /data/app-lib/com.giderosmobile.androidtemplate-1/libgideros.so
I/DEBUG   (  133):          5f367204  00000000  
I/DEBUG   (  133):          5f367208  00000000  
I/DEBUG   (  133):          ........  ........
I/DEBUG   (  133):     #01  63d972d4  bd80b7e0  
I/DEBUG   (  133):          63d972d8  41d7fda8  /dev/ashmem/dalvik-heap (deleted)
I/DEBUG   (  133):          63d972dc  41c8e91c  /dev/ashmem/dalvik-heap (deleted)
I/DEBUG   (  133):          63d972e0  3c44b9a9  
I/DEBUG   (  133):          63d972e4  41c7f923  /dev/ashmem/dalvik-heap (deleted)
I/DEBUG   (  133):          63d972e8  41c900e3  /dev/ashmem/dalvik-heap (deleted)
I/DEBUG   (  133):          63d972ec  bcc2036f  
I/DEBUG   (  133):          63d972f0  41b7fa56  /dev/ashmem/dalvik-heap (deleted)
I/DEBUG   (  133):          63d972f4  41c9cc29  /dev/ashmem/dalvik-heap (deleted)
I/DEBUG   (  133):          63d972f8  bd9aa01e  
I/DEBUG   (  133):          63d972fc  41a80137  /dev/ashmem/dalvik-aux-structure (deleted)
I/DEBUG   (  133):          63d97300  41cb07b4  /dev/ashmem/dalvik-heap (deleted)
I/DEBUG   (  133):          63d97304  bda0965f  
I/DEBUG   (  133):          63d97308  41980227  /dev/ashmem/dalvik-card-table (deleted)
I/DEBUG   (  133):          63d9730c  41cbb792  /dev/ashmem/dalvik-heap (deleted)
I/DEBUG   (  133):          63d97310  bbf2dd00

Comments

  • ar2rsawseenar2rsawseen Maintainer
    Accepted Answer
    Unfortunately can't make anything of this stack trace.
    Any simple code to reproduce the issue?
  • It's just a standard sample named "Bridge" from Gideros package. It's location like "D:\Program Files (x86)\Gideros\Examples\Physics\Bridge\". Initially I thought that I have mistaken in my program but any standard sample game based on Box2D fails after few seconds of work. At least it happens with Gideros 2015 08-09. When I was playing with some 2014 version everything was fine. I have Intel based phone. Probably i can check on ARM based one.
  • unlyingunlying Guru
    Accepted Answer
    So it crashes on device only? On PC player it works fine for you? I'll try to reproduce this issue on my intel-based device.
  • Yes, only on device.
  • unlyingunlying Guru
    Accepted Answer
    Bridge example with Gideros 2015.09:
    player 2014.1 Arm-based device - works fine
    player 2015.9 Arm-based device - works fine
    player 2015.2 Intel-based device - crash on start.
    player 2015.9 Intel-based device - crash on start.

    Btw bird animation example works fine. So it look like it is physics problem as @smarushchenko says.
  • ar2rsawseenar2rsawseen Maintainer
    Accepted Answer
    Eh, thats the worst kind of bugs (cpu specific) :)
  • As of my opinion it becomes crashing when objects collide. It probably could be a bug of Box2D. May be it is possible to update Box2D library in future releases of Gideros?
  • ar2rsawseenar2rsawseen Maintainer
    Accepted Answer
    I think update is what caused this in the first place :)
    but checking with others about what they know
  • Ok, thanks for your attention to this thread! I would believe this issue will be resolved in future releases. And thank you for amazing product! It's minimalistic, but clear, obvious and has everything for creative programmers :) Also it would be nice to have high level collision API built without using heavy phisycs backend.
  • ar2rsawseenar2rsawseen Maintainer
    Accepted Answer
  • Yes, thank you for pointing me. But it seems it based on Box2D anyway, I meant a small c library for collision detection only for a circle, a rectangle (I've read about TNT but could not find polygons there) and a polygon, with a triangulation facilities so that developers can just use some method to get compound polygon shapes for a bitmap.
    This is just my thoughts, and unfortunately I can't do more just due to lack of appropriate knowledge.
  • john26john26 Maintainer
    edited September 2015 Accepted Answer
    Just looking through the stack trace there is a mention of "cosf" which is clearly a function to evaluate cosine. However, the standard function is "cos" going back to the early days of C, so I wonder if using cosf is causing a problem...? If it did I'd expect the error to occur at the link stage however. I do remember in the BlackBerry QNX version of Box2D they did replace the "cosf" with plain cos...

    Some discussion of cosf vs cos
    http://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html

    do any of the box2d examples work for you?
  • smarushchenkosmarushchenko Member
    edited September 2015
    Elastic Joints and Particles work fine. Everything else crashes.

    Initially I wrote a small program to "roll" a "ball" on the screen using using accelerometer and physics. Everything was fine, but the ball could roll out of the screen. I decided to add borders along the edges of the screen and Gideros start crashing since the ball and a border become contacting. Crash happens not straight after the contact but after a little time.

    Could this issue be related to Contact object?
  • My new game uses box2d so i'm trying to find last working gideros version.
    I'm on 2014.04.12 now and it's not working with x86
  • Khm. Sry, but i fail to find good version right now.
    Gideros 2014.1 with player 2014.1 works well.
    Gideros 2014.1 with player from version near 2014.04.12 doesn't work.

    So now i've to return to 2014.1 Gideros to export working project.
  • hgy29hgy29 Maintainer
    I can run Box2D stuff on an Acer Iconia One 7 (x86, atom processor) without issue with 2015.9.
    So maybe x86 is not the issue in itself, perhaps some specific x86 variant or specific code path ? I tried Bridge example.
  • 2014.10 with 2014.10 Player works with box2d physics.
    2015.2(that named Gideros 2015.04.18 on site) doesn't work with 2015.2 player.

    @hgy29 what version of player do you use? Applications crashes if it has collisions inside(bridge crashes for us too)
  • I've found some discussions regarding problems related to x86 Android and NDK. Could someone try to build libraries (especially Box2D) using disabled SSE instructions set? I've done some experiments with cocos2d-x using APP_CPPFLAGS=-U__SSE__ and this was the only case when simple example became working on my Intel based smartphone.
  • @ smarushchenko - Check out Hardon Collider and Bump. Both are Love2D libraries and can be made to work with Gideros, neither is a c library, just LUA though. Bump is used for AABB collision, and Hardon Collider can handle polygon/circle/point collision.
Sign In or Register to comment.