Author Topic: Crash (native)  (Read 32614 times)

Offline AeroShark333

  • float
  • ****
  • Posts: 319
    • View Profile
Re: Crash (native)
« Reply #45 on: September 27, 2018, 01:37:29 pm »
Hmmm, that is weird...

I don't think it is a threading issue since I'm loading the objects and geometries in the GLThread...
Maybe it tries to render objects that aren't fully processed? => How can I know this?

Also, the crash also happens when only using drawWireFrame(...) instead of draw(...), I don't know if this can give you some clue but who knows

Offline jaco robier

  • byte
  • *
  • Posts: 14
    • View Profile
Re: Crash (native)
« Reply #46 on: September 27, 2018, 09:37:19 pm »
Me too, I sometimes had the crash error :
"GC_FOR_ALLOC freed 1030K, 10% free 38859K/42784K, paused 5ms, total 5ms
Fatal signal 11 (SIGSEGV) at 0x97319048 (code = 2), thread 1217 (otic.industrial)".
it was sometimes at the start of my app when I loaded a file "factory.SER".

Since then I used another 3D software to convert and generate "factory.obj" file and started serialization again. it fix this problem and i do not understand why my old "factory.obj" file was bad ? serialization issue ?  format Wavefront .obj incompatible ?
« Last Edit: September 27, 2018, 09:45:53 pm by jaco robier »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Crash (native)
« Reply #47 on: September 28, 2018, 08:25:23 am »
Since then I used another 3D software to convert and generate "factory.obj" file and started serialization again. it fix this problem and i do not understand why my old "factory.obj" file was bad ? serialization issue ?  format Wavefront .obj incompatible ?
Any problems with the format itself should never lead to a native crash. Looks more like some kind of memory issue to me...these things are very hard to track, because there are gazillions of different devices out there and I've seen all kinds of strange behaviour from some of them.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Crash (native)
« Reply #48 on: September 28, 2018, 08:28:05 am »
Also, the crash also happens when only using drawWireFrame(...) instead of draw(...), I don't know if this can give you some clue but who knows
I don't think so. It's basically using the same data in a different way. Lets take one step back to narrow it down, please:

  • On which devices (exact model number if possible) does this happen?
  • Which Android versions are affected?
  • Does it happen only sometimes or all of the time?
  • Can you provide a simple test case that has this problem?

Offline AeroShark333

  • float
  • ****
  • Posts: 319
    • View Profile
Re: Crash (native)
« Reply #49 on: September 30, 2018, 12:19:44 pm »
Which devices? => See post #25 in this thread for some of the devices affected
My 'device' (actually emulator) I use to reproduce the error: Nexus 5X API 28 x86 (Android 9, API 28) (This one should be downloadable from Android Studio)

Which Android versions? Any...

Sometimes or all the time? Depends, for low-polygon models it happens less often but for high-polygon models more often.

Test case: https://www.dropbox.com/s/rsoz0dhm1sds6wm/TestCase.zip?dl=1
(the code is a little messy but I mostly stripped code from the original application)

Stacktrace (working):
Code: [Select]
09-30 10:18:59.541 26730-26750/com.aeroshark333.testcase W/jPCT-AE: [ 1538302739541 ] - WARNING: OpenGL vendor:     Google (NVIDIA Corporation)
    [ 1538302739541 ] - WARNING: OpenGL renderer:   Android Emulator OpenGL ES Translator (GeForce GTX 950M/PCIe/SSE2)
    [ 1538302739541 ] - WARNING: OpenGL version:    OpenGL ES 2.0 (4.5.0 NVIDIA 398.11)
    [ 1538302739541 ] - WARNING: OpenGL renderer initialized (using 4/32 texture stages)
09-30 10:18:59.542 26730-26750/com.aeroshark333.testcase I/System.out: Sensor Detection Started!
09-30 10:18:59.548 26730-26730/com.aeroshark333.testcase I/System.out: Error.
09-30 10:18:59.549 26730-26730/com.aeroshark333.testcase I/chatty: uid=10084(com.aeroshark333.testcase) identical 2 lines
09-30 10:18:59.562 26730-26730/com.aeroshark333.testcase I/System.out: Error.
09-30 10:18:59.673 26730-26750/com.aeroshark333.testcase I/ArtOfEarthify: Loading blit shaders!
09-30 10:18:59.753 26730-26750/com.aeroshark333.testcase I/ArtOfEarthify: Loading earth object!
09-30 10:18:59.867 26730-26741/com.aeroshark333.testcase I/ark333.testcas: Background concurrent copying GC freed 10715(711KB) AllocSpace objects, 2(48KB) LOS objects, 46% free, 7MB/13MB, paused 5.656ms total 28.853ms
09-30 10:19:00.130 26730-26750/com.aeroshark333.testcase I/ArtOfEarthify: Loading background object!
09-30 10:19:00.249 26730-26750/com.aeroshark333.testcase I/ArtOfEarthify: Loading sun object!
09-30 10:19:00.397 26730-26750/com.aeroshark333.testcase I/ArtOfEarthify: Loading moon object!
09-30 10:19:00.412 26730-26750/com.aeroshark333.testcase I/ArtOfEarthify: Done moon object!
09-30 10:19:00.524 26730-26750/com.aeroshark333.testcase I/ArtOfEarthify: Done loading models
09-30 10:19:00.555 26730-26750/com.aeroshark333.testcase I/ark333.testcas: Explicit concurrent copying GC freed 25326(1094KB) AllocSpace objects, 29(2MB) LOS objects, 39% free, 9MB/15MB, paused 668us total 28.008ms
09-30 10:19:00.570 26730-26750/com.aeroshark333.testcase I/ark333.testcas: Explicit concurrent copying GC freed 153(52KB) AllocSpace objects, 0(0B) LOS objects, 39% free, 9MB/15MB, paused 590us total 13.971ms
09-30 10:19:00.758 26730-26750/com.aeroshark333.testcase I/System.out: beep0a
    beep0b
    beep0c
09-30 10:19:00.759 26730-26750/com.aeroshark333.testcase I/System.out: beep1a
    beep1b
09-30 10:19:00.763 26730-26750/com.aeroshark333.testcase I/System.out: beep1c
09-30 10:19:00.764 26730-26750/com.aeroshark333.testcase I/System.out: beep2
    beep3
09-30 10:19:00.765 26730-26750/com.aeroshark333.testcase I/System.out: beep4
    beep5
09-30 10:19:00.766 26730-26750/com.aeroshark333.testcase I/System.out: beep6
09-30 10:19:00.784 26730-26750/com.aeroshark333.testcase I/ark333.testcas: Explicit concurrent copying GC freed 346(74KB) AllocSpace objects, 15(2MB) LOS objects, 46% free, 7MB/13MB, paused 550us total 17.247ms
09-30 10:19:00.799 26730-26750/com.aeroshark333.testcase I/ark333.testcas: Explicit concurrent copying GC freed 13(48KB) AllocSpace objects, 0(0B) LOS objects, 46% free, 7MB/13MB, paused 439us total 14.073ms
09-30 10:19:00.975 26730-26750/com.aeroshark333.testcase W/jPCT-AE: [ 1538302740975 ] - WARNING: Your application uses default shaders, but they have been disabled in Config. Consider to enable them or performance will suffer!
09-30 10:19:00.990 26730-26750/com.aeroshark333.testcase E/emuglGLESv2_enc: a vertex attribute index out of boundary is detected. Skipping corresponding vertex attribute. buf=0xd72bcf20
    Out of bounds vertex attribute info: clientArray? 0 attribute 3 vbo 15 allocedBufferSize 2064 bufferDataSpecified? 1 wantedStart 0 wantedEnd 33784
09-30 10:19:00.991 26730-26750/com.aeroshark333.testcase E/emuglGLESv2_enc: a vertex attribute index out of boundary is detected. Skipping corresponding vertex attribute. buf=0xd72bcf50
    Out of bounds vertex attribute info: clientArray? 0 attribute 4 vbo 16 allocedBufferSize 2064 bufferDataSpecified? 1 wantedStart 0 wantedEnd 33784
    a vertex attribute index out of boundary is detected. Skipping corresponding vertex attribute. buf=0xd72bcf80

Stacktrace (not working):
Code: [Select]
09-30 10:16:31.090 26487-26518/com.aeroshark333.testcase W/jPCT-AE: [ 1538302591089 ] - WARNING: OpenGL vendor:     Google (NVIDIA Corporation)
    [ 1538302591090 ] - WARNING: OpenGL renderer:   Android Emulator OpenGL ES Translator (GeForce GTX 950M/PCIe/SSE2)
09-30 10:16:31.091 26487-26518/com.aeroshark333.testcase W/jPCT-AE: [ 1538302591091 ] - WARNING: OpenGL version:    OpenGL ES 2.0 (4.5.0 NVIDIA 398.11)
    [ 1538302591091 ] - WARNING: OpenGL renderer initialized (using 4/32 texture stages)
09-30 10:16:31.114 26487-26518/com.aeroshark333.testcase I/System.out: Sensor Detection Started!
09-30 10:16:31.189 26487-26487/com.aeroshark333.testcase I/System.out: Error.
09-30 10:16:31.189 26487-26487/com.aeroshark333.testcase I/chatty: uid=10084(com.aeroshark333.testcase) identical 3 lines
09-30 10:16:31.189 26487-26487/com.aeroshark333.testcase I/System.out: Error.
09-30 10:16:31.282 26487-26518/com.aeroshark333.testcase I/ArtOfEarthify: Loading blit shaders!
09-30 10:16:31.351 26487-26518/com.aeroshark333.testcase I/ArtOfEarthify: Loading earth object!
09-30 10:16:31.579 26487-26518/com.aeroshark333.testcase I/ArtOfEarthify: Loading background object!
09-30 10:16:31.746 26487-26518/com.aeroshark333.testcase I/ArtOfEarthify: Loading sun object!
09-30 10:16:31.879 26487-26518/com.aeroshark333.testcase I/ArtOfEarthify: Loading moon object!
09-30 10:16:31.894 26487-26518/com.aeroshark333.testcase I/ArtOfEarthify: Done moon object!
09-30 10:16:31.990 26487-26518/com.aeroshark333.testcase I/ArtOfEarthify: Done loading models
09-30 10:16:32.028 26487-26518/com.aeroshark333.testcase I/ark333.testcas: Explicit concurrent copying GC freed 26739(1115KB) AllocSpace objects, 29(2MB) LOS objects, 22% free, 20MB/26MB, paused 730us total 37.701ms
09-30 10:16:32.067 26487-26518/com.aeroshark333.testcase I/ark333.testcas: Explicit concurrent copying GC freed 209(52KB) AllocSpace objects, 0(0B) LOS objects, 22% free, 20MB/26MB, paused 1.073ms total 37.880ms
09-30 10:16:32.257 26487-26518/com.aeroshark333.testcase I/System.out: beep0a
    beep0b
09-30 10:16:32.258 26487-26518/com.aeroshark333.testcase I/System.out: beep0c
    beep1a
    beep1b
09-30 10:16:32.259 26487-26518/com.aeroshark333.testcase A/libc: Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0xf1cc2000 in tid 26518 (GLThread 2033), pid 26487 (ark333.testcase)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Crash (native)
« Reply #50 on: October 01, 2018, 10:25:32 pm »
Thanks. I'll go and try the test case on my devices (...when I'm back from holiday) to find one that crashes and start from there. I really don't trust emulators, so I prefer to find a non-working device instead.

Offline AeroShark333

  • float
  • ****
  • Posts: 319
    • View Profile
Re: Crash (native)
« Reply #51 on: October 07, 2018, 07:43:59 pm »
I don't know if you had time to look into this yet... but any results?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Crash (native)
« Reply #52 on: October 08, 2018, 09:53:19 am »
No, I just came back from holiday.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Crash (native)
« Reply #53 on: October 09, 2018, 08:08:18 pm »
After downloading half the internet to upgrade to AS 3.2, I now had the chance to try the test case. What exactly is it supposed to do? I can see some "loading" message followed by a white screen. Is that intentional or am I missing something?

If the emulator runs (in most cases, it just crashes (not the app in the emulator, but the whole emulator)), it also prints out these buffer size warnings. However, I've checked the code again...it's impossible that I reserve the wrong size for them, simply because I'm using the Android API to create them based on int[]-arrays. If the Android API reserves 2064 bytes for and int[]-array of 33292 bytes and then wonders why it doesn't fit, then I'm out of luck. But I don't think that's the case. I think the emulator messages are a red hering.

Offline AeroShark333

  • float
  • ****
  • Posts: 319
    • View Profile
Re: Crash (native)
« Reply #54 on: October 10, 2018, 03:33:54 pm »
It is supposed to get to that white screen yes.
However, some devices won't get to this white screen and crash in the world.draw() calls in the loading process or the actual 'first' world.draw() call when the actual 3D rendering happens (after the loading process)

The crash does not always happen but I do keep getting these SIGSEGV errors in Google Play Store developer console from actual devices. I was able to 'reproduce' (on my old (now broken) HTC Desire 820) this error. So now the only thing that can help me reproduce the error is the emulator with Nexus 5X API28 x86 Android 9.

But I am not able (or rarely able) to reproduce the error with much lower polygon models so is it possible to load higher polygon models as if they were lower polygon models somehow? No idea here... world.drawWireFrame() and world.draw() both produce the SIGZSEGV.

Sidenote: Config.useVBO = false only seems to make the crashrates worse for me on the emulator

Offline AeroShark333

  • float
  • ****
  • Posts: 319
    • View Profile
Re: Crash (native)
« Reply #55 on: October 13, 2018, 09:35:14 am »
Any clues? Or ideas left to how to solve this?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Crash (native)
« Reply #56 on: October 16, 2018, 10:46:34 am »
So far, I wasn't able to reproduce it. What's your actual crash rate in Google Play that can be attributed to such kind of native crashes?

Offline AeroShark333

  • float
  • ****
  • Posts: 319
    • View Profile
Re: Crash (native)
« Reply #57 on: October 17, 2018, 11:13:06 pm »
Hmmm weird...
Does Config.useVBO = false; also not help to reproduce the error?
For me, setting the Config.useVBO = false; would only increase the likelyhood of crashing.

The crashreports for different SIGSEGV's for the last 60 days from Google Play:
1 user(s), 49 crashes (code=2)
3 user(s), 10 crashes (code=1)
1 user(s), 03 crashes (code=1)
2 user(s), 03 crashes (code=1)
2 user(s), 02 crashes (code=1)
2 user(s), 02 crashes (code=2)
2 user(s), 02 crashes (code=2)
1 user(s), 02 crashes (code=0)
2 user(s), 02 crashes (abort)
1 user(s), 02 crashes (code=2)
1 user(s), 02 crashes (code=2)
1 user(s), 01 crashes (code=2)
1 user(s), 01 crashes (code=2)
1 user(s), 01 crashes (code=1)
1 user(s), 01 crashes (code=2)
1 user(s), 02 crashes (code=1)

code = 0: signal 11 (SIGSEGV), code 0 (SI_USER)
code = 1: signal 11 (SIGSEGV), code 1 (SIGV_MAPERR)
code = 2: signal 11 (SIGSEGV), code 2 (SIGV_ACCERR)
abort: no idea..? (probably also some kind of SIGSEGV)

Most of these reports show a backtrace to the graphics driver (some .so files)
And the reports are shows seperately (although they might have the same code=x) because of different graphics driver files I suppose

I also found this crashlog for 4 different devices which I found really weird:
Code: [Select]
java.lang.ExceptionInInitializerError:
  at com.threed.jpct.Object3DCompiler.compile (Object3DCompiler.java:150)
  at com.threed.jpct.World.compile (World.java:2109)
  at com.threed.jpct.World.renderScene (World.java:1067)
  at com.aeroshark333.artofearthify.lw.ArtOfEarthify$1.run (ArtOfEarthify.java:991)
  at com.aeroshark333.artofearthify.utils.WorkerThread$2.run (WorkerThread.java:46)
  at com.aeroshark333.artofearthify.lw.ArtOfEarthify.onDrawFrame (ArtOfEarthify.java:1753)
  at com.aeroshark333.artofearthify.lw.LiveWallpaperRenderer.onDrawFrame (LiveWallpaperRenderer.java:45)
  at android.opengl.GLSurfaceView$GLThread.guardedRun (GLSurfaceView.java:1548)
  at android.opengl.GLSurfaceView$GLThread.run (GLSurfaceView.java:1259)
Caused by: java.lang.NegativeArraySizeException:
  at com.threed.jpct.CompiledInstance.<clinit> (CompiledInstance.java:28)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Crash (native)
« Reply #58 on: October 18, 2018, 09:27:48 am »
I actually meant what the crash rate is. Because, if 99.5% of all runs are fine, then I would guess that it's a driver problem of some kind but if only 50% run fine, it might be a more serious issue.

The array crash is actually impossible. This is the code:

Code: [Select]
protected final static int BUFFER_SIZE = Config.vertexBufferSize;
protected final static int[] smallBufferOne = new int[BUFFER_SIZE];

Unless you've set Config.vertexBufferSize to a negative value, there's no way that this can happen other than a VM bug. I would ignore it for now. Android does really strange things sometimes, the VM definitely isn't bug free.

Offline AeroShark333

  • float
  • ****
  • Posts: 319
    • View Profile
Re: Crash (native)
« Reply #59 on: October 18, 2018, 11:57:11 am »
In the past 60 days there have been about 720 installs, where 24 of these devices would give a crash. (3.3%) It's not guaranteed that all devices do report their crashes so it's probably higher than 3.3%
But these crashes also happen on newer Android versions

I used to own a device which would get SIGSEGV's but the device broke...
I now own a device it never crashes on. (I can only reproduce the SIGSEGV on an emulator, but not all emulators crash just one of the many I have)

So there's a 3.3% chance your device could get SIGSEGV's
And then about 50% of the runs will crash with a SIGSEGV (because these crashes don't always happen) on these devices