About Store Forum Documentation Contact
Donations:
179$/mo



Post Reply 
[Android] Crash on world update?
Author Message
kulesz Offline
Member

Post: #1
[Android] Crash on world update?
Hi,

I've just tested Android SDK and it crashes with simple program. It's generally the base project code with world loading added.
When I comment "Game::World.update(Cam.at);" eveything works (except there's no world). PC version works OK.

Here's the code:
Code:
#include "../../Installation/EsenthelEngine/EsenthelEngine.h"
#include "_enums.h"
#include "Player.h"

Mesh mesh;
Matrix matrix(1);

Game::ObjMemx<Game::Static> Statics; // container for static    objects
Game::ObjMemx<Game::Item> Items; // container for item      objects
Game::ObjMemx<Game::Chr> Chrs; // container for character objects
Game::ObjMemx<Player> Players; // container for character objects

void InitPre()
{
    App.flag = APP_AUTO_FREE_OPEN_GL_ES_DATA
            | APP_AUTO_FREE_PHYS_BODY_HELPER_DATA
            | APP_AUTO_PARTICLES_CONVERT_BLEND;

    Paks.add("engine.pak.jet");
    Paks.add("Data.pak.jet");

    Cam.dist =4;
    Cam.yaw  =-PI_4;
    Cam.pitch=-0.5f;
    Cam.at.set(16,0,16);
}
/******************************************************************************/
Bool Init()
{
Physics.create(CSS_NONE, true);

    Sky.atmospheric();
    mesh.create(1).parts[0].base.create(Ball(1), VTX_TEX0 | VTX_NRM | VTX_TAN);
    mesh.setMaterial(Materials.ptrRequire("mtrl/brick/0.mtrl")).setRender().setBox();

    Game::World.init();

    Game::World.setObjType(Statics, OBJ_STATIC)
    .setObjType(Items, OBJ_ITEM)
    .setObjType(Players, OBJ_PLAYER);

    Game::World.New("World/area1.world");

    D.ambientPower(0.6);

    return true;
}

Bool Update()
{
    if (Kb.bp(KB_ESC))
        return false;

    REPA(Touches)
    {
        Cam.yaw -= Touches[i].d().x;
        Cam.pitch += Touches[i].d().y;
    }
    CamHandle(1.5, 10, CAMH_ZOOM | CAMH_ROT);
    Game::World.update(Cam.at);

    return true;
}

void Render()
{
    Game::World.draw();

    switch (Renderer())
    {
    case RM_PREPARE:
    {
        if (Frustum(mesh.box, matrix))
            mesh.draw(matrix);

        LightDir(Vec(0, 0, 1)).add();
    }
        break;
    }
}
void Draw()
{
    Renderer(Render);
}

void Shut()
{
}

Log:

Code:
11-19 19:26:09.309: I/DEBUG(12290): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
11-19 19:26:09.309: I/DEBUG(12290): Build fingerprint: 'samsung/GT-S5830/GT-S5830:2.3.3/GINGERBREAD/XWKPF:user/release-keys'
11-19 19:26:09.319: I/DEBUG(12290): pid: 15410, tid: 15419  >>> com.esenthel.Project <<<
11-19 19:26:09.319: I/DEBUG(12290): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 30edefb0
11-19 19:26:09.319: I/DEBUG(12290):  r0 04000800  r1 00ed8fac  r2 04000801  r3 30edefac
11-19 19:26:09.319: I/DEBUG(12290):  r4 00000000  r5 00ed9278  r6 486e5080  r7 00000000
11-19 19:26:09.319: I/DEBUG(12290):  r8 46dca8a4  r9 00000090  10 00000004  fp 00edd2cc
11-19 19:26:09.319: I/DEBUG(12290):  ip 00000000  sp 46dca868  lr 8148203c  pc 81421178  cpsr 00000030
11-19 19:26:09.319: I/DEBUG(12290):  d0  414000003f800000  d1  3ff0000042c80000
11-19 19:26:09.319: I/DEBUG(12290):  d2  bfd3441350baf6de  d3  c1493000c1323800
11-19 19:26:09.319: I/DEBUG(12290):  d4  4900000040dcb000  d5  000000000006e580
11-19 19:26:09.319: I/DEBUG(12290):  d6  4515a00000000800  d7  40800000c48ee000
11-19 19:26:09.319: I/DEBUG(12290):  d8  0000000000000000  d9  0000000000000000
11-19 19:26:09.319: I/DEBUG(12290):  d10 0000000000000000  d11 0000000000000000
11-19 19:26:09.329: I/DEBUG(12290):  d12 0000000000000000  d13 0000000000000000
11-19 19:26:09.329: I/DEBUG(12290):  d14 0000000000000000  d15 0000000000000000
11-19 19:26:09.329: I/DEBUG(12290):  scr 60000012
11-19 19:26:09.399: I/DEBUG(12290):          #00  pc 00421178  /data/data/com.esenthel.Project/lib/libProject.so
11-19 19:26:09.399: I/DEBUG(12290):          #01  pc 004214a2  /data/data/com.esenthel.Project/lib/libProject.so
11-19 19:26:09.399: I/DEBUG(12290):          #02  pc 00362098  /data/data/com.esenthel.Project/lib/libProject.so
11-19 19:26:09.399: I/DEBUG(12290):          #03  pc 003620be  /data/data/com.esenthel.Project/lib/libProject.so
11-19 19:26:09.399: I/DEBUG(12290): code around pc:
11-19 19:26:09.399: I/DEBUG(12290): 81421158 68014658 60026059 d1292f00 92036872
11-19 19:26:09.399: I/DEBUG(12290): 81421168 d0aa3201 69719803 181b0043 18cb009b
11-19 19:26:09.399: I/DEBUG(12290): 81421178 20016859 9a076071 9a066d11 1c014088
11-19 19:26:09.399: I/DEBUG(12290): 81421188 68f03901 04094011 9a0b0ac9 8ba81841
11-19 19:26:09.399: I/DEBUG(12290): 81421198 60184310 7800a809 7218aa09 20007812
11-19 19:26:09.399: I/DEBUG(12290): code around lr:
11-19 19:26:09.399: I/DEBUG(12290): 8148201c e49d0004 e12fff1e e1a0c000 e1a00001
11-19 19:26:09.409: I/DEBUG(12290): 8148202c e1a0100c eaffffff e92d400f ebffffe0
11-19 19:26:09.409: I/DEBUG(12290): 8148203c e3500000 43700000 e8bd800f e52de008
11-19 19:26:09.409: I/DEBUG(12290): 8148204c ebfffff8 03a00001 13a00000 e49df008
11-19 19:26:09.409: I/DEBUG(12290): 8148205c e52de008 ebfffff3 33a00001 23a00000
11-19 19:26:09.409: I/DEBUG(12290): stack:
11-19 19:26:09.409: I/DEBUG(12290):     46dca828  005e0002  
11-19 19:26:09.409: I/DEBUG(12290):     46dca82c  3ea8f5c3  
11-19 19:26:09.409: I/DEBUG(12290):     46dca830  00000000  
11-19 19:26:09.409: I/DEBUG(12290):     46dca834  005e0002  
11-19 19:26:09.409: I/DEBUG(12290):     46dca838  bea8f5c3  
11-19 19:26:09.409: I/DEBUG(12290):     46dca83c  00000000  
11-19 19:26:09.409: I/DEBUG(12290):     46dca840  00eda590  
11-19 19:26:09.409: I/DEBUG(12290):     46dca844  46dca8a4  
11-19 19:26:09.409: I/DEBUG(12290):     46dca848  00000001  
11-19 19:26:09.409: I/DEBUG(12290):     46dca84c  00000000  
11-19 19:26:09.409: I/DEBUG(12290):     46dca850  00000000  
11-19 19:26:09.409: I/DEBUG(12290):     46dca854  00000000  
11-19 19:26:09.409: I/DEBUG(12290):     46dca858  00000000  
11-19 19:26:09.409: I/DEBUG(12290):     46dca85c  814820a0  /data/data/com.esenthel.Project/lib/libProject.so
11-19 19:26:09.409: I/DEBUG(12290):     46dca860  df002777  
11-19 19:26:09.409: I/DEBUG(12290):     46dca864  e3a070ad  
11-19 19:26:09.409: I/DEBUG(12290): #00 46dca868  46dca898  
11-19 19:26:09.409: I/DEBUG(12290):     46dca86c  8122a201  /data/data/com.esenthel.Project/lib/libProject.so
11-19 19:26:09.409: I/DEBUG(12290):     46dca870  46dcac08  
11-19 19:26:09.409: I/DEBUG(12290):     46dca874  04000800  
11-19 19:26:09.409: I/DEBUG(12290):     46dca878  00ed9278  
11-19 19:26:09.409: I/DEBUG(12290):     46dca87c  46dca898  
11-19 19:26:09.409: I/DEBUG(12290):     46dca880  04000800  
11-19 19:26:09.409: I/DEBUG(12290):     46dca884  00dcf1a8  
11-19 19:26:09.409: I/DEBUG(12290):     46dca888  00000008  
11-19 19:26:09.409: I/DEBUG(12290):     46dca88c  ffffffff  
11-19 19:26:09.409: I/DEBUG(12290):     46dca890  00000008  
11-19 19:26:09.419: I/DEBUG(12290):     46dca894  04000800  
11-19 19:26:09.419: I/DEBUG(12290):     46dca898  00000008  
11-19 19:26:09.419: I/DEBUG(12290):     46dca89c  000022f4  
11-19 19:26:09.419: I/DEBUG(12290):     46dca8a0  00000008  
11-19 19:26:09.419: I/DEBUG(12290):     46dca8a4  00000000  
11-19 19:26:09.419: I/DEBUG(12290):     46dca8a8  3ea8f5c3  
11-19 19:26:09.419: I/DEBUG(12290):     46dca8ac  00000000  
11-19 19:26:09.419: I/DEBUG(12290):     46dca8b0  00000000  
11-19 19:26:09.419: I/DEBUG(12290):     46dca8b4  00000000  
11-19 19:26:09.419: I/DEBUG(12290):     46dca8b8  00000078  
11-19 19:26:09.419: I/DEBUG(12290):     46dca8bc  00000000  
11-19 19:26:09.419: I/DEBUG(12290):     46dca8c0  0000003c  
11-19 19:26:09.419: I/DEBUG(12290):     46dca8c4  0000038c  
11-19 19:26:09.419: I/DEBUG(12290):     46dca8c8  00dcf1a8  
11-19 19:26:09.419: I/DEBUG(12290):     46dca8cc  486e5080  
11-19 19:26:09.419: I/DEBUG(12290):     46dca8d0  00ed8f08  
11-19 19:26:09.419: I/DEBUG(12290):     46dca8d4  814214a7  /data/data/com.esenthel.Project/lib/libProject.so
11-19 19:26:09.419: I/DEBUG(12290): #01 46dca8d8  00e5a4e0  
11-19 19:26:09.419: I/DEBUG(12290):     46dca8dc  00e5a624  
11-19 19:26:09.419: I/DEBUG(12290):     46dca8e0  00000000  
11-19 19:26:09.419: I/DEBUG(12290):     46dca8e4  00000001  
11-19 19:26:09.419: I/DEBUG(12290):     46dca8e8  46dca938  
11-19 19:26:09.419: I/DEBUG(12290):     46dca8ec  815ca340  
11-19 19:26:09.419: I/DEBUG(12290):     46dca8f0  00eda1b8  
11-19 19:26:09.419: I/DEBUG(12290):     46dca8f4  3ea8f5c3  
11-19 19:26:09.419: I/DEBUG(12290):     46dca8f8  00000005  
11-19 19:26:09.419: I/DEBUG(12290):     46dca8fc  46dca950  
11-19 19:26:09.419: I/DEBUG(12290):     46dca900  ffffffff  
11-19 19:26:09.429: I/DEBUG(12290):     46dca904  81361ef7  /data/data/com.esenthel.Project/lib/libProject.so
11-19 19:26:09.429: I/DEBUG(12290):     46dca908  46dca950  
11-19 19:26:09.429: I/DEBUG(12290):     46dca90c  815ca310  
11-19 19:26:09.429: I/DEBUG(12290):     46dca910  46dca950  
11-19 19:26:09.429: I/DEBUG(12290):     46dca914  812f7531  /data/data/com.esenthel.Project/lib/libProject.so
11-19 19:26:09.429: I/DEBUG(12290):     46dca918  ffffffff  
11-19 19:26:09.429: I/DEBUG(12290):     46dca91c  81361fb3  /data/data/com.esenthel.Project/lib/libProject.so
11-19 19:26:09.429: I/DEBUG(12290):     46dca920  00000000  
11-19 19:26:09.429: I/DEBUG(12290):     46dca924  00000000  
11-19 19:26:09.429: I/DEBUG(12290):     46dca928  00000000  
11-19 19:26:09.429: I/DEBUG(12290):     46dca92c  812f6f9d  /data/data/com.esenthel.Project/lib/libProject.so
11-19 19:26:09.429: I/DEBUG(12290):     46dca930  00dd9370  
11-19 19:26:09.429: I/DEBUG(12290):     46dca934  8122a201  /data/data/com.esenthel.Project/lib/libProject.so
11-19 19:26:09.429: I/DEBUG(12290):     46dca938  3f333333  
11-19 19:26:09.429: I/DEBUG(12290):     46dca93c  00000000  
11-19 19:26:09.429: I/DEBUG(12290):     46dca940  00000000  
11-19 19:26:09.429: I/DEBUG(12290):     46dca944  c1ffffff  
11-19 19:26:09.429: I/DEBUG(12290):     46dca948  41ffffff  
11-19 19:26:09.429: I/DEBUG(12290):     46dca94c  40000000  
11-19 19:26:09.429: I/DEBUG(12290):     46dca950  00000000  
11-19 19:26:09.429: I/DEBUG(12290):     46dca954  0000017c  
11-19 19:26:09.429: I/DEBUG(12290):     46dca958  00000000  
11-19 19:26:09.429: I/DEBUG(12290):     46dca95c  00000000  
11-19 19:26:09.429: I/DEBUG(12290):     46dca960  811c44dd  /data/data/com.esenthel.Project/lib/libProject.so
11-19 19:26:09.429: I/DEBUG(12290):     46dca964  811c44e9  /data/data/com.esenthel.Project/lib/libProject.so
11-19 19:26:09.429: I/DEBUG(12290):     46dca968  00000000  
11-19 19:26:09.429: I/DEBUG(12290):     46dca96c  00000001  
11-19 19:26:09.429: I/DEBUG(12290):     46dca970  00e5a4e0  
11-19 19:26:09.439: I/DEBUG(12290):     46dca974  00dd9348  
11-19 19:26:09.439: I/DEBUG(12290):     46dca978  ffffffff  
11-19 19:26:09.439: I/DEBUG(12290):     46dca97c  815ca310  
11-19 19:26:09.439: I/DEBUG(12290):     46dca980  00eda1b8  
11-19 19:26:09.439: I/DEBUG(12290):     46dca984  46dcaa78  
11-19 19:26:09.439: I/DEBUG(12290):     46dca988  00dcf1a8  
11-19 19:26:09.439: I/DEBUG(12290):     46dca98c  8136209d  /data/data/com.esenthel.Project/lib/libProject.so
11-19 19:26:09.489: W/FastDormancy(229):  before ======= ENTER DORMANCY =======
11-19 19:26:10.139: I/BootReceiver(162): Copying /data/tombstones/tombstone_03 to DropBox (SYSTEM_TOMBSTONE)
11-19 19:26:10.149: I/DEBUG(12290): dumpstate /data/log/dumpstate_app_native.txt
11-19 19:26:14.419: D/BatteryService(162): update start
11-19 19:26:14.419: D/BatteryService(162): update start
11-19 19:26:14.419: D/BatteryService(162): update start
11-19 19:26:14.499: W/FastDormancy(229):  before ======= ENTER DORMANCY =======
11-19 19:26:15.639: D/VoldCmdListener(87): asec list
11-19 19:26:15.649: D/VoldCmdListener(87): CommandListener::AsecCmd::runCommand -> com.jb.gosms-2
11-19 19:26:15.649: D/VoldCmdListener(87): CommandListener::AsecCmd::runCommand -> com.nrsmagic.bubble-1
11-19 19:26:15.649: D/VoldCmdListener(87): CommandListener::AsecCmd::runCommand -> com.keramidas.TitaniumBackup-2
11-19 19:26:15.649: D/VoldCmdListener(87): CommandListener::AsecCmd::runCommand -> com.mictale.gpsessentials-2
11-19 19:26:15.649: D/VoldCmdListener(87): CommandListener::AsecCmd::runCommand -> net.zedge.android-2
11-19 19:26:15.649: D/VoldCmdListener(87): CommandListener::AsecCmd::runCommand -> com.adobe.reader-1
11-19 19:26:15.649: D/VoldCmdListener(87): CommandListener::AsecCmd::runCommand -> com.farproc.wifi.analyzer-1
11-19 19:26:15.649: D/VoldCmdListener(87): CommandListener::AsecCmd::runCommand -> com.skype.raider-2
11-19 19:26:15.659: D/VoldCmdListener(87): CommandListener::AsecCmd::runCommand -> com.opera.browser-2
11-19 19:26:15.659: D/VoldCmdListener(87): CommandListener::AsecCmd::runCommand -> com.dropbox.android-1
11-19 19:26:15.659: D/VoldCmdListener(87): CommandListener::AsecCmd::runCommand -> pl.pawelbialecki.jedilightsaber-1
11-19 19:26:15.659: D/VoldCmdListener(87): CommandListener::AsecCmd::runCommand -> com.a0soft.gphone.app2sd-1
11-19 19:26:15.659: D/VoldCmdListener(87): CommandListener::AsecCmd::runCommand -> com.citynav.jakdojade.pl.android-2
11-19 19:26:15.659: D/VoldCmdListener(87): CommandListener::AsecCmd::runCommand -> com.gamestar.pianoperfect-1
11-19 19:26:15.659: D/VoldCmdListener(87): CommandListener::AsecCmd::runCommand -> com.sportstracklive.stopwatch-1
11-19 19:26:15.659: D/VoldCmdListener(87): CommandListener::AsecCmd::runCommand -> com.foncannoninc.airhorn-1
11-19 19:26:15.659: D/VoldCmdListener(87): CommandListener::AsecCmd::runCommand -> com.codingcaveman.SoloTrial-1
11-19 19:26:15.659: D/VoldCmdListener(87): CommandListener::AsecCmd::runCommand -> com.melodis.midomiMusicIdentifier.freemium-2
11-19 19:26:15.659: D/VoldCmdListener(87): CommandListener::AsecCmd::runCommand -> com.droidstudio.game.devil2-2
11-19 19:26:15.659: D/VoldCmdListener(87): CommandListener::AsecCmd::runCommand -> com.agilesoftresource-2
11-19 19:26:15.659: D/VoldCmdListener(87): CommandListener::AsecCmd::runCommand -> jackpal.androidterm-2
11-19 19:26:15.669: D/VoldCmdListener(87): CommandListener::AsecCmd::runCommand -> la.droid.qr-1
11-19 19:26:15.669: D/VoldCmdListener(87): CommandListener::AsecCmd::runCommand -> com.devuni.compass-1
11-19 19:26:16.899: I/ActivityManager(162): Process com.esenthel.Project (pid 15410) has died.
11-19 19:26:16.909: E/InputDispatcher(162): channel '407de4c0 com.esenthel.Project/android.app.NativeActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x8
11-19 19:26:16.909: E/InputDispatcher(162): channel '407de4c0 com.esenthel.Project/android.app.NativeActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
11-19 19:26:16.919: I/WindowManager(162): WIN DEATH: Window{407de4c0 com.esenthel.Project/android.app.NativeActivity paused=false}
11-19 19:26:16.929: I/OrientationDebug(162): [pwm] in updateOrientationListenerLp()
11-19 19:26:16.929: V/OrientationDebug(162): in updateOrientationListenerLp(), Screen status=true, current orientation=2, SensorEnabled=true
11-19 19:26:16.929: I/OrientationDebug(162): [pwm] needSensorRunningLp(), return false #3
11-19 19:26:16.929: I/OrientationDebug(162): [pwm] in updateOrientationListenerLp(), now call mOrientationListener.disable(), and mOrientationSensorEnabled = false #2
11-19 19:26:16.929: I/OrientationDebug(162): [WindowOrientationListener] in disable(), now call SensorManager.unregisterListener()
11-19 19:26:16.929: E/SensorManager(162): unregisterListener:: all sensors,  listener = android.view.WindowOrientationListener$SensorEventListenerImpl@40767a18
11-19-2011 07:28 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: [Android] Crash on world update?
was there any other messages in the log before:
Quote:11-19 19:26:09.309: I/DEBUG(12290): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
11-19 19:26:09.309: I/DEBUG(12290): Build fingerprint: 'samsung/GT-S5830/GT-
?

the kind of output means invalid operation/memory access/exception/out of memory

did you include the new data in the data.pak? (world and objects files)
can you try to minimize the possible problem?
use smaller worlds, view range, fewer objects, etc.
perhaps you run out of memory? how much RAM does your device have?
remember it is crucial to use very little memory.

it would help if the crash would generate some callstack visible (like in Visual Studio), without it, I don't have idea what could go wrong.

So you need to do step by step simplification of your world and data files, or find a way to Eclipse show call stack in debugging smile
11-19-2011 08:28 PM
Find all posts by this user Quote this message in a reply
kulesz Offline
Member

Post: #3
RE: [Android] Crash on world update?
Actually there were no earlier messages connected with application.

World is a simple, plain area with one texture and no objects - test only. Everything takes a little more memory, that sample code. So it's strange. World file exists, data.pak is updated (if it wouldn't be there, app would have crashed when loading world).
I can't simplify the program more, it's crashing on this single line - when I comment it, it's fine.
11-19-2011 08:34 PM
Find all posts by this user Quote this message in a reply
Mardok Offline
Member

Post: #4
RE: [Android] Crash on world update?
My own world with one static mesh was loaded without any problems. All works perfectly.

Where is located your "_enums.h" ?

Try remove all containers, remove line #include _enums.h, remove #include Player.h and try load only empty heightmap. And do like Esenthel say - step by step.
(This post was last modified: 11-19-2011 10:12 PM by Mardok.)
11-19-2011 09:39 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #5
RE: [Android] Crash on world update?
few days ago I've released this change:
Quote:-IMPORTANT: worlds that used new recast pathfinding paths need to be rebuilt (because of bug found - different struct alignment for members on different compilers, paths did not work on Android platform, you will receive a crash when attempting to play worlds with old path data when using new engine version, rebuilding worlds prevents crashing and allows loading them on all platforms)
is it possible you're trying to load world generated using previous engine tools?
and that's what causing the crash?

if not, then if you:
uncomment: Game::World.update(Cam.at);
but comment: Game::World.draw();
so world is updated but not displayed
do you still have crash?
11-20-2011 02:27 PM
Find all posts by this user Quote this message in a reply
kulesz Offline
Member

Post: #6
RE: [Android] Crash on world update?
Ohhhhhhhhhhhhhhhh... What a silly mistake. You're right, Esenthel... I was using a new mobile SDK, but forgot to update tools :-/
11-20-2011 09:27 PM
Find all posts by this user Quote this message in a reply
Post Reply