Fatal signal while operationg with model

Started by mAlinka, November 26, 2015, 08:57:53 AM

Previous topic - Next topic

mAlinka

Hello for everybody!
I continue to learning jPCT engine and write a simple code for testing. It loads animated model from 3ds files (using key frames) and shows it to user. User can zoom-in and zoom-out using corresponding scale gesture and rotate the model around its x and y axes by pick it and drag. Everything works fine but on some devices app crashes with fatal signal while user rotates the object. Here is a part of log:
Quote11-26 09:29:44.293: I/KERNEL(8683): [  893.215881] ientiryug.tofar (8683): undefined instruction: pc=75671754
11-26 09:29:44.293: I/KERNEL(8683): [  893.216015] Code: db76 ee3a fb4d ec40 (fb18) ed85
11-26 09:29:44.293: A/libc(8683): Fatal signal 4 (SIGILL) at 0x75671754 (code=1), thread 8683 (ientiryug.tofar)
11-26 09:29:44.343: I/KERNEL(8683): [  893.266745] ientiryug.tofar (8683): undefined instruction: pc=75671754
11-26 09:29:44.343: I/KERNEL(8683): [  893.266897] Code: db76 ee3a fb4d ec40 (fb18) ed85
11-26 09:29:44.723: I/KERNEL(8683): [  893.651359] ientiryug.tofar (8683): undefined instruction: pc=75671754
11-26 09:29:44.723: I/KERNEL(8683): [  893.651495] Code: db76 ee3a fb4d ec40 (fb18) ed85
As I said it happens not on all devices. On Samsung S4 Mini I have no problem but on ZTE Grand S2 it occures very often.
Has anybody deal with similar cases?

EgonOlsen

Looks like a hard crash...maybe the driver is going mad. I don't think that you can do much about it. You might be able to track it down to some specific operation if you would have permanent access to such a device.
What is this .tofar thing, btw.?

mAlinka

TofAR is a name of our app where I should add 3D support.  It means Technology of Augmented Reality.
I have an access to that device and can debug on it. But dont know how to find the exact place where crash is happens. It occurs somewhere during drawing frames and applying an animation. I added detailed log and it always shows a different stage before fatal signal.

EgonOlsen

#3
Are you using some native code? That crash means that you are trying to execute some garbage data as actual machine code. This is pretty low level. It can be caused either the driver or some native part of the app...or something else. I don't see how it can be caused by the VM. I would try to strip down the OpenGL related parts as much possible to see if it's driver related. If that doesn't help, it's something else...

mAlinka

Yes, there is some part of native code but it has no relation to rendering and works properly in the rest time.

mAlinka

Also I'm not sure about my implementation of animation. Should Object3D.animate(...) be called in separate thread or in main thread where the whole scene renders?

EgonOlsen

In the main thread. Otherwise, you'll end up rendering inbetween states. You can run in another thread, if you synchronize it with the rendering properly, but I don't think that it's worth the trouble. animate() itself isn't that slow unless you are animating really large objects.
Anyway, animate() works on VM data structures only. It doesn't do any direct calls to GL, so I don't see why putting it in another thread should cause such issues.