Signal 11 (SIGSEGV), code 1 (SEGV_MAPERR) crashes

Hello Fellow Devs,

Below is the crash reports I got from Google Play Console.
Can anyone guide me how do I read/understand these crash reports and how to handle these crashes?

signal 11 (SIGSEGV), code 1 (SEGV_MAPERR):
#00 pc 0000000000134536 /data/app/com.my.game-2/lib/arm/libMyGame.so (_ZN5Piece6getPidEv+3)
#01 pc 000000000012d555 /data/app/com.my.game-2/lib/arm/libMyGame.so (_ZN9GameScene15findMaxPriorityEv+1388)
#02 pc 0000000000131bc9 /data/app/com.my.game-2/lib/arm/libMyGame.so (_ZN9GameScene8makeMoveEv+104)
#03 pc 0000000000132467 /data/app/com.my.game-2/lib/arm/libMyGame.so (_ZN9GameScene12onDiceChangeEi+1130)
#04 pc 000000000013263b /data/app/com.my.game-2/lib/arm/libMyGame.so
#05 pc 0000000000235ecc /data/app/com.my.game-2/lib/arm/libMyGame.so
#06 pc 0000000000236094 /data/app/com.my.game-2/lib/arm/libMyGame.so (_ZN7cocos2d15EventDispatcher24dispatchEventToListenersEPNS0_19EventListenerVectorERKSt8functionIFbPNS_13EventListenerEEE+432)
#07 pc 000000000023f398 /data/app/com.my.game-2/lib/arm/libMyGame.so (_ZN7cocos2d15EventDispatcher13dispatchEventEPNS_5EventE+252)
#08 pc 000000000012a9bd /data/app/com.my.game-2/lib/arm/libMyGame.so (_ZN4Dice14onAnimCompleteEv+108)
#09 pc 000000000012c2b9 /data/app/com.my.game-2/lib/arm/libMyGame.so (_ZN4Dice6updateEf+1104)
#10 pc 0000000000247d74 /data/app/com.my.game-2/lib/arm/libMyGame.so (_ZN7cocos2d9Scheduler6updateEf+220)

are you using SDKBOX?

Yes, I used SDKBOX for Admob.

@yinjimmy can help us.

There is no evidence that the problem is caused by SDKBox.

Plz check Piece::getPid .
Thanks,

Piece::getPid is working fine while I tested. It simply returns an integer value from 0-3.
Can you please explain what does it mean Ev+number at the end?

I do not know the EV+number, but you can follow this link to get more information about the crash :

I also see most crashes for my game is signal 11 (SIGSEGV), code 1 (SEGV_MAPERR).
149 crashes for last 60 days.
I can’t reproduce it.
cocos2d-js 3.17


pid: 0, tid: 0 >>> xxxx <<<

backtrace:
#00 pc 00000000007bdc0c /data/app/xxxx/lib/arm/libcocos2djs.so

My game is built only for armeabi-v7a and x86.

whats the crash log ?

This is crash log from google console:

pid: 0, tid: 0 >>> xxxx <<<

backtrace:
#00 pc 00000000007bdc0c /data/app/xxxx/lib/arm/libcocos2djs.so

any more detail ?

What do you need to know?

more crash log.

I don’t have more.

Hi, I’ve a similar error.
It’s occurs only in Android and it’s very unusual to happen, but it happens sometimes, and i don’t know why it’s occurs, is in random times. The game crashes.
This is the error log with ndk-stack:

********** Crash dump: **********
Build fingerprint: 'motorola/surnia_retla/surnia_umts:6.0/MPI24.65-39-4/3:user/release-keys'
pid: 11041, tid: 11083, name: GLThread 593  >>> net.company.gametest <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x100
Stack frame #00 pc 000182c8  /system/lib/libc.so (memcmp+232)
Stack frame #01 pc 0039f675  /data/app/net.company.gametest-2/lib/arm/libMyGame.so (_ZNSt6__ndk111char_traitsIcE7compareEPKcS3_j+28): Routine cocos2d::Vec2::Vec2(float, float) at /Users/tranthor/Desktop/MyGames/gametest/gametest/cocos2d/cocos/./math/Vec2.inl:31
Stack frame #02 pc 004346b5  /data/app/net.company.gametest-2/lib/arm/libMyGame.so (_ZN11GameManager10updateGameEf+6956): Routine std::__ndk1::__function::__func<std::__ndk1::__bind<void (cocos2d::Physics3DDebugDrawer::*)(cocos2d::Mat4 const&, unsigned int), cocos2d::Physics3DDebugDrawer*, cocos2d::Mat4 const&, int>, std::__ndk1::allocator<std::__ndk1::__bind<void (cocos2d::Physics3DDebugDrawer::*)(cocos2d::Mat4 const&, unsigned int), cocos2d::Physics3DDebugDrawer*, cocos2d::Mat4 const&, int> >, void ()>::target(std::type_info const&) const at /Users/tranthor/Desktop/MyGames/_NDK/android-ndk-r16b/sources/cxx-stl/llvm-libc++/include/functional:1571
Stack frame #03 pc 008816dc  /data/app/net.company.gametest-2/lib/arm/libMyGame.so (_ZN7cocos2d19TimerTargetSelector7triggerEf+180): Routine ??
??:0
Stack frame #04 pc 008813a8  /data/app/net.company.gametest-2/lib/arm/libMyGame.so (_ZN7cocos2d5Timer6updateEf+380): Routine ??
??:0
Stack frame #05 pc 0088f074  /data/app/net.company.gametest-2/lib/arm/libMyGame.so (_ZN7cocos2d9Scheduler6updateEf+848): Routine ??
??:0
Stack frame #06 pc 0082ca60  /data/app/net.company.gametest-2/lib/arm/libMyGame.so (_ZN7cocos2d8Director9drawSceneEv+160): Routine ??
??:0
Stack frame #07 pc 00832b28  /data/app/net.company.gametest-2/lib/arm/libMyGame.so (_ZN7cocos2d8Director8mainLoopEv+124): Routine ??
??:0
Stack frame #08 pc 0053df15  /data/app/net.company.gametest-2/lib/arm/libMyGame.so (Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeRender+16): Routine DecodeImageData at emutls.c:?
Stack frame #09 pc 000ea989  /system/lib/libart.so (art_quick_generic_jni_trampoline+40)
Stack frame #10 pc 000e6291  /system/lib/libart.so (art_quick_invoke_stub_internal+64)
Stack frame #11 pc 003eba3d  /system/lib/libart.so (art_quick_invoke_static_stub+172)
Stack frame #12 pc 0010200c  [stack:11083]

I don’t understand why it mentions Physics3DDebugDrawer. My game is 2D, not 3D.
And here are some ‘red’ errors in logcat:

08-26 11:28:19.068 8558-8703/net.company.gametest A/libc: invalid address or address of corrupt block 0xb99ce508 passed to dlfree

08-26 11:28:28.291 2209-2223/? E/ActivityManager: ANR in net.company.gametest (net.company.gametest/org.cocos2dx.cpp.AppActivity)
    PID: 8558
    Reason: Input dispatching timed out (Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago.  Wait queue length: 1.  Wait queue head age: 5621.7ms.)
    Load: 4.81 / 4.87 / 3.03
    CPU usage from 529402ms to 0ms ago:
      13% 260/surfaceflinger: 6.8% user + 6.7% kernel / faults: 1487 minor 15 major
      4.7% 2209/system_server: 3.3% user + 1.4% kernel / faults: 61666 minor 947 major
      3.9% 287/mediaserver: 2.4% user + 1.4% kernel / faults: 9510 minor 494 major
      2.7% 4333/com.google.android.gms.persistent: 2.1% user + 0.6% kernel / faults: 61742 minor 757 major
      1.5% 3930/com.google.android.gms: 1.1% user + 0.3% kernel / faults: 107363 minor 1307 major
      1.4% 7557/mdss_fb0: 0% user + 1.4% kernel
      0.8% 468/adbd: 0.1% user + 0.7% kernel / faults: 468 minor 5 major
      1% 39/kworker/u8:3: 0% user + 1% kernel
      0.8% 7626/com.google.android.googlequicksearchbox:search: 0.6% user + 0.1% kernel / faults: 34183 minor 585 major
      0.6% 38/kworker/u8:2: 0% user + 0.6% kernel
      0.7% 210/logd: 0.5% user + 0.2% kernel / faults: 1208 minor 2 major
      0.6% 88/kswapd0: 0% user + 0.6% kernel
      0.6% 31/kworker/u8:1: 0% user + 0.6% kernel
      0.6% 169/mmcqd/0: 0% user + 0.6% kernel
      0.4% 3376/com.android.systemui: 0.3% user + 0.1% kernel / faults: 17572 minor 373 major
      0.2% 25/kworker/0:1: 0% user + 0.2% kernel
      0.3% 3542/com.estrongs.android.pop: 0.2% user + 0% kernel / faults: 34605 minor 1026 major
      0.3% 143/cfinteractive: 0% user + 0.3% kernel
      0.3% 4009/com.google.android.inputmethod.latin: 0.2% user + 0% kernel / faults: 20338 minor 730 major
      0.2% 4130/com.google.android.googlequicksearchbox: 0.1% user + 0% kernel / faults: 17191 minor 528 major
      0.2% 6248/com.motorola.motocare: 0.1% user + 0% kernel / faults: 8341 minor 208 major
      0.2% 178/kworker/0:2: 0% user + 0.2% kernel
      0.1% 26/kworker/1:1: 0% user + 0.1% kernel
      0.1% 5922/com.android.vending: 0% user + 0% kernel / faults: 21075 minor 664 major
      0.1% 6710/com.rsupport.mvagent: 0.1% user + 0% kernel / faults: 20493 minor 248 major
      0.1% 4267/com.google.process.gapps: 0% user + 0% kernel / faults: 7988 minor 5 major
      0.1% 3/ksoftirqd/0: 0% user + 0.1% kernel
      0% 5690/kworker/2:2: 0% user + 0% kernel
      0.1% 259/servicemanager: 0% user + 0% kernel / faults: 187 minor
      0.1% 8/rcu_preempt: 0% user + 0.1% kernel
      0.1% 32/kworker/u9:0: 0% user + 0.1% kernel
      0% 4112/com.android.phone: 0% user + 0% kernel / faults: 5177 minor 185 major
      0% 7560/irq/326-synapti: 0% user + 0% kernel
      0% 3310/VosRXThread: 0% user + 0% kernel
      0% 12/ksoftirqd/1: 0% user + 0% kernel
      0% 16/ksoftirqd/2: 0% user + 0% kernel
      0% 5321/com.motorola.ccc: 0% user + 0% kernel / faults: 5795 minor 100 major
      0% 4104/com.motorola.process.system: 0% user + 0% kernel / faults: 4036 minor 14 major
      0% 3309/VosTXThread: 0% user + 0% kernel
      0% 28/kworker/3:1: 0% user + 0% kernel
      0% 299/zygote: 0% user + 0% kernel / faults: 25001 minor
      0% 1//init: 0% user + 0% kernel / faults: 1339 minor
      0% 275/netd: 0% user + 0% kernel / faults: 1365 minor 13 major
      0% 258/lmkd: 0% user + 0% kernel / faults: 90 minor
      0% 114/hwrng: 0% user + 0% kernel
      0% 3308/VosMCThread: 0% user + 0% kernel
      0% 3312/wpa_supplicant: 0% user + 0% kernel / faults: 224 minor 2 major
      0% 20/ksoftirqd/3: 0% user + 0% kernel
      0% 3516/com.motorola.modemservice: 0% user + 0% kernel / faults: 1958 minor 19 major
      0% 3440/com.motorola.slpc: 0% user + 0% kernel / faults: 1136 minor 37 major
      0% 6/kworker/u8:0: 0% user + 0% kernel
      0% 52/kworker/0:1H: 0% user + 0% kernel
      0% 295/thermal-engine: 0% user + 0% kernel / faults: 162 minor 7 major
      0% 3416/android.process.media: 0% user + 0% kernel / faults: 4055 minor 35 major
      0% 285/rild: 0% user + 0% kernel / faults: 408 minor 17 major
      0% 288/installd: 0% user + 0% kernel / faults: 145 minor 12 major
      0% 379/qmuxd: 0% user + 0% kernel / faults: 170 minor 2 major
      0

08-26 11:28:33.557 2209-3275/? E/ConnectivityService: RemoteException caught trying to send a callback msg for NetworkRequest [ id=15, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]

I have no idea the reason.
Maybe an sdkbox plugin? Maybe cocos2dx bug? I’m using cocos2dx 3.17 c++ and NDK 16.
@zhangxm @drelaptop ?

what kinds of versions do you used to build your app, such as compile version, target version, mini version, NDK version? I think no more crash log means it failed when loading libcocos2djs.so you built.

I found CC_USE_3D_PHYSICS was enabled default, refer to the ccConfig.h

#ifndef CC_USE_3D_PHYSICS
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX /*|| CC_TARGET_PLATFORM == CC_PLATFORM_WINRT*/)
#define CC_USE_3D_PHYSICS 1
#endif
#endif

I think you can try to disable the 3D macro. another word if you build the native by CMake, you need disable USE_BULLET, the file is CocosSelectModule.cmake

1 Like

These crashes are still most frequent:

I have disabled CC_USE_3D_PHYSICS

cocos 3.17
ndk-r17
PROP_BUILD_TOOLS_VERSION=28.0.1
PROP_COMPILE_SDK_VERSION=26
PROP_MIN_SDK_VERSION=14
PROP_TARGET_SDK_VERSION=26
PROP_APP_PLATFORM=14

I don’t think it fails when loading libcocos2djs.so because the error is SEGV_MAPERR:

Put this line ‘SDKBox.init(this);’ on ‘Cocos2dxActivity.java’ under onCreate()

Does it solve the crash ?
It seems crash in cocos2d-x 3D Physics3DDebugDrawer .

Emm, if you guys just want cocos2d-x 2d, plz take a look here

Remove 3D features
Remove support for JS script
Remove deprecated classes and functions
Remove Camera
Remove Physics integration
Remove C++ implementations of Component
Remove C++ implementations of CocosBuilder parser
Remove AssetsManager, AssetsManagerEX
Remove support for WebP,S3TC,ATITC
Remove Menu

but not support JS.