Android Screen Rotation Crash

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
LunaRebirth
Posts: 386
Joined: Sun May 11, 2014 12:13 am

Android Screen Rotation Crash

Post by LunaRebirth »

Been digging into why my apk crashes whenever I rotate the screen. Looks like it works for a split second (I can see the screen rotate before crashing).
Was wondering if anyone else is having this issue, or if it is because of my own code.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Android Screen Rotation Crash

Post by CuteAlien »

Hm, Irrlicht example doesn't seem to support rotation. If I remember right that was some manifest setting. Can you post your manifest xml and maybe a callstack of the crash?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
LunaRebirth
Posts: 386
Joined: Sun May 11, 2014 12:13 am

Re: Android Screen Rotation Crash

Post by LunaRebirth »

I simply removed this line:

Code: Select all

android:screenOrientation="portrait"
from the manifest file to allow screen rotation.

The callstack looks like it is coming from my code, but if I continuously add returns everywhere, the crash location will change but still occur.
I'll still add it below anyways.

Code: Select all

--------- beginning of crash
09-07 20:12:35.652 31901 31901 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-07 20:12:35.652 31901 31901 F DEBUG   : Build fingerprint: 'motorola/kinzie_verizon/kinzie:7.0/NCK25.118-10.2/2:user/release-keys'
09-07 20:12:35.652 31901 31901 F DEBUG   : Revision: 'p301'
09-07 20:12:35.652 31901 31901 F DEBUG   : ABI: 'arm'
09-07 20:12:35.652 31901 31901 F DEBUG   : pid: 31526, tid: 31900, name: Thread-7  >>> com.Proj<<<
09-07 20:12:35.652 31901 31901 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x20
09-07 20:12:35.652 31901 31901 F DEBUG   :     r0 cf64b400  r1 aaaaaaab  r2 00000000  r3 00000000
09-07 20:12:35.652 31901 31901 F DEBUG   :     r4 00000001  r5 cf9118e4  r6 cf911800  r7 00000000
09-07 20:12:35.652 31901 31901 F DEBUG   :     r8 dfee8d30  r9 dfee8ce0  sl cfd9fc6d  fp 00000058
09-07 20:12:35.652 31901 31901 F DEBUG   :     ip 00000076  sp e7c4e088  lr cfc3d3cd  pc cfc3d418  cpsr a0070030
09-07 20:12:35.656 31901 31901 F DEBUG   :
09-07 20:12:35.656 31901 31901 F DEBUG   : backtrace:
09-07 20:12:35.656 31901 31901 F DEBUG   :     #00 pc 0015a418  /data/app/com.Proj-1/lib/arm/libProj.so (_ZN10LuaElement6removeEP9lua_State+119)
09-07 20:12:35.657 31901 31901 F DEBUG   :     #01 pc 00151edb  /data/app/com.Proj-1/lib/arm/libProj.so (_ZN4LuaC5clearEb+118)
09-07 20:12:35.657 31901 31901 F DEBUG   :     #02 pc 001553db  /data/app/com.Proj-1/lib/arm/libProj.so (_Z10clearWorldSs+166)
09-07 20:12:35.657 31901 31901 F DEBUG   :     #03 pc 00155fd5  /data/app/com.Proj-1/lib/arm/libProj.so (_ZN6Client15setRequestWorldESs+48)
09-07 20:12:35.657 31901 31901 F DEBUG   :     #04 pc 0014c3e7  /data/app/com.Proj-1/lib/arm/libProj.so (main+262)
09-07 20:12:35.657 31901 31901 F DEBUG   :     #05 pc 0014c7dd  /data/app/com.Proj-1/lib/arm/libProj.so (android_main+340)
09-07 20:12:35.657 31901 31901 F DEBUG   :     #06 pc 002bcce3  /data/app/com.Proj-1/lib/arm/libProj.so
09-07 20:12:35.657 31901 31901 F DEBUG   :     #07 pc 00046eb3  /system/lib/libc.so (_ZL15__pthread_startPv+22)
09-07 20:12:35.657 31901 31901 F DEBUG   :     #08 pc 00019acd  /system/lib/libc.so (__start_thread+6)
When I rotate the screen, android_main() is called again.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Android Screen Rotation Crash

Post by CuteAlien »

Example not crashing, but results still somewhat interesting. As it also doesn't seem to realize in Irrlicht anything changed (still drawing with old resolution and xy-coordinates of events are now wrong). Which might also get me closer to the bug with the soft-keyboard (which I had given up on already).

So - can't help you with the crash. But you might have helped me at least gettings some more ideas.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
LunaRebirth
Posts: 386
Joined: Sun May 11, 2014 12:13 am

Re: Android Screen Rotation Crash

Post by LunaRebirth »

Okay thanks for checking that for me. Must be something on my end that's causing the crash.
MartinVee
Posts: 139
Joined: Tue Aug 02, 2016 3:38 pm
Location: Québec, Canada

Re: Android Screen Rotation Crash

Post by MartinVee »

Just a quick hint, but SEGV_MAPERR means that you tried to access memory that's not mapped to your program's address space. That's usually because :
- You dereference a null pointer ;
- You try to free the same memory twice ;
- A pointer was corrupted ;
- There's a buffer overflow in your program.
Post Reply