Crashing on Android 4.4 links with gpu memory and the Internet Connection

Crashing on Android 4.4 links with gpu memory and the Internet Connection
0.0 0

#1

Hello.
Our game sometimes chashes if a player tries to login to Facebook or executes some graphic effects or just on the spot only on Android 4.4.
If a player isn’t connected to the Internet this bug appears much less than with the Internet.
We have understood by logcat that the game crashes after these errors:

W/Adreno-GSL(11826): <sharedmem_gpumem_alloc_id:1489>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory
E/Adreno-GSL(11826): <ioctl_kgsl_sharedmem_alloc:1590>: ioctl_kgsl_sharedmem_alloc: FATAL ERROR : (null)

And some logs from GP:

#00 pc 0008f0cc /system/lib/libskia.so
#01 pc 000eafe9 /system/lib/libskia.so
#02 pc 000eb4f1 /system/lib/libskia.so (SkLinearGradient::shadeSpan(int, int, unsigned int*, int)+208)
#03 pc 0009cdef /system/lib/libskia.so (SkARGB32_Shader_Blitter::blitRect(int, int, int, int)+294)
#04 pc 000c8af9 /system/lib/libskia.so
#05 pc 000c8b7f /system/lib/libskia.so
#06 pc 000c938d /system/lib/libskia.so (SkScan::AntiFillRect(SkRect const&, SkRegion const*, SkBlitter*)+192)
#07 pc 000c93a7 /system/lib/libskia.so (SkScan::AntiFillRect(SkRect const&, SkRasterClip const&, SkBlitter*)+14)
#08 pc 000a8905 /system/lib/libskia.so (SkDraw::drawRect(SkRect const&, SkPaint const&) const+214)
#09 pc 000a1083 /system/lib/libskia.so (SkCanvas::drawRect(SkRect const&, SkPaint const&)+102)
#10 pc 0007b7b7 /system/lib/libandroid_runtime.so
#11 pc 00020d0c /system/lib/libdvm.so (dvmPlatformInvoke+112)
#12 pc 000519af /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+398)
#13 pc 0002a1a0 /system/lib/libdvm.so
#14 pc 00031650 /system/lib/libdvm.so (dvmMterpStd(Thread*)+76)
#15 pc 0002ece8 /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
#16 pc 000640f9 /system/lib/libdvm.so (dvmInvokeMethod(Object*, Method const*, ArrayObject*, ArrayObject*, ClassObject*, bool)+392)
#17 pc 0006c05f /system/lib/libdvm.so
#18 pc 0002a1a0 /system/lib/libdvm.so
#19 pc 00031650 /system/lib/libdvm.so (dvmMterpStd(Thread*)+76)
#20 pc 0002ece8 /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
#21 pc 00063e15 /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+336)
#22 pc 0004d597 /system/lib/libdvm.so
#23 pc 000520df /system/lib/libandroid_runtime.so
#24 pc 00053673 /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, char const*)+354)
#25 pc 0000105b /system/bin/app_process
#26 pc 0000e513 /system/lib/libc.so (__libc_init+50)
#27 pc 00000d7c /system/bin/app_process

#00  pc 000222e0  /system/lib/libc.so (memset+24)
#01  pc 000a6333  /system/lib/libskia.so (SkDraw::drawPaint(SkPaint const&) const+286)
#02  pc 0009fc8b  /system/lib/libskia.so (SkCanvas::internalDrawPaint(SkPaint const&)+66)
#03  pc 0009eb7d  /system/lib/libskia.so (SkCanvas::drawColor(unsigned int, SkXfermode::Mode)+44)
#04  pc 0002034c  /system/lib/libdvm.so (dvmPlatformInvoke+112)
#05  pc 00050fcf  /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+398)
#06  pc 000297e0  /system/lib/libdvm.so
#07  pc 00030c6c  /system/lib/libdvm.so (dvmMterpStd(Thread*)+76)
#08  pc 0002e304  /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
#09  pc 00063719  /system/lib/libdvm.so (dvmInvokeMethod(Object*, Method const*, ArrayObject*, ArrayObject*, ClassObject*, bool)+392)
#10  pc 0006b61f  /system/lib/libdvm.so
#11  pc 000297e0  /system/lib/libdvm.so
#12  pc 00030c6c  /system/lib/libdvm.so (dvmMterpStd(Thread*)+76)
#13  pc 0002e304  /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
#14  pc 00063435  /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+336)
#15  pc 0004cbb7  /system/lib/libdvm.so
#16  pc 0004d397  /system/lib/libandroid_runtime.so
#17  pc 0004e0bb  /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, char const*)+354)
#18  pc 00001427  /system/bin/app_process
#19  pc 0000e49b  /system/lib/libc.so (__libc_init+50)
#20  pc 00000f54  /system/bin/app_process


#00  pc 00bb9212  /system/lib/libwebviewchromium.so
#01  pc 00bc0703  /system/lib/libwebviewchromium.so
#02  pc 00bc36af  /system/lib/libwebviewchromium.so
#03  pc 00bc3d8f  /system/lib/libwebviewchromium.so
#04  pc 00c983b7  /system/lib/libwebviewchromium.so
#05  pc 00c05449  /system/lib/libwebviewchromium.so
#06  pc 00c98703  /system/lib/libwebviewchromium.so
#07  pc 00b5bc09  /system/lib/libwebviewchromium.so
#08  pc 003ba98b  /system/lib/libwebviewchromium.so
#09  pc 009e39bb  /system/lib/libwebviewchromium.so
#10  pc 009e1959  /system/lib/libwebviewchromium.so
#11  pc 009e3257  /system/lib/libwebviewchromium.so
#12  pc 009c061d  /system/lib/libwebviewchromium.so
#13  pc 001eca19  /system/lib/libwebviewchromium.so
#14  pc 001ec7f1  /system/lib/libwebviewchromium.so
#15  pc 001cf24f  /system/lib/libwebviewchromium.so
#16  pc 001cfd51  /system/lib/libwebviewchromium.so
#17  pc 001cfeaf  /system/lib/libwebviewchromium.so
#18  pc 001cffbd  /system/lib/libwebviewchromium.so
#19  pc 001cf575  /system/lib/libwebviewchromium.so
#20  pc 001d403f  /system/lib/libwebviewchromium.so
#21  pc 001cedaf  /system/lib/libwebviewchromium.so
#22  pc 001dc42d  /system/lib/libwebviewchromium.so
#23  pc 001da25b  /system/lib/libwebviewchromium.so
#24  pc 0000d220  /system/lib/libc.so (__thread_entry+72)
#25  pc 0000d3b8  /system/lib/libc.so (pthread_create+240)

That’s why we came to the conclusion that our game has problems with gpu, rendering some textures, drawing.
But on the other side, if a device is offline, the game is more stable and it’s very difficult to achieve some crashes.
And it’s strange. If it’s online and player executes some graphic effects - game always crashes. But the game has never crashed after starting these effects if it doesn’t have the Internet connection. And executing these graphic effects doesn’t create some request to the Internet and doesn’t deal with it.
And these crashes’re produced only on Android 4.4.

For preparing textures we use TexturePacker.

We tried to fix it by some solutions, but nothing helped:

  1. Using older verions of Facebook SDK (because the majority of crashes happenes when player is online and tries to login to Facebook)
  2. Disabled hardwareAccelerated
  3. Enabled using largeHeap
  4. Enabled method Power of 2 for preparing texture atlases in the TexturePacker
  5. Created some extra objects, widgets and sprites in the game
  6. Compiled special for arm-v7
  7. We checked formats of all textures. And nothing doesn’t have RGB555\RGB556. All is RGBA8888\RGBA4444

What’s the problem? How can the Internet connection links with these errors? How can we fix it?
Thank you for helping.


#2

So, Do anyone have some ideas about the bug?
It’s awful, because 4.4 - is one of the most popular version of Android in the world.


#3

The best way is to create an issue on the github.
If you can also provide the code to reproduce the problem, then I believe that the engineers will be more grateful to you.
Regards.