Strange Signal 11 SIGSEGV


#1

I’m having trouble getting my game to launch on Android.
Using ndk-r9 and cocos2dx-2.1.4, eclipse project created using output from the generate project script.
I had to build with -Wno-error=format-security to get it to shut up about some stuff.

Stack trace:
Build fingerprint: 'tmous/htc_ruby/ruby:4.0.3/IML74K/449991.30:user/release-keys' pid: 18728, tid: 18728 >>> MY_GAME <<< signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000 Stack frame #00 pc 0017dda8 /data/data/MY_GAME/lib/libgame.so: Routine GetEnv in /Users/Justin/Desktop/tools/android-ndk-r9/platforms/android-8/arch-arm/usr/include/jni.h:1077 Stack frame #01 pc 0017df3c /data/data/MY_GAME/lib/libgame.so (_ZN7cocos2d9JniHelper14jstring2stringEP8_jstring): Routine jstring2string_ in /Users/Justin/desktop/GAME/GAME/proj.android/../libs/cocos2dx/platform/android/jni/JniHelper.cpp:169 Stack frame #02 pc 0017d3ca /data/data/MY_GAME/lib/libgame.so (Java_org_cocos2dx_lib_Cocos2dxHelper_nativeSetApkPath): Routine Java_org_cocos2dx_lib_Cocos2dxHelper_nativeSetApkPath in /Users/Justin/Desktop/tools/android-ndk-r9/sources/cxx-stl/gnu-libstdc++/4.6/include/bits/basic_string.h:542 Stack frame #03 pc 0001fff0 /system/lib/libdvm.so (dvmPlatformInvoke) Stack frame #04 pc 0005b134 /system/lib/libdvm.so (_Z16dvmCallJNIMethodPKjP6JValuePK6MethodP6Thread)

Any idea what’s happening here?


#2

I can not find what’s error from the log.
Is it reproductive?


#3

I seem to have isolated the problem.

my Android.mk

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
>
LOCAL_MODULE := game_shared
LOCAL_MODULE_FILENAME := libgame
>
cppfiles := $ -name ".cpp" -printf “P \n")*
*LOCAL_SRC_FILES := $(cppfiles)*

*folders := $(shell find $(LOCAL_PATH) -type d -printf "P ”)*
*LOCAL_C_INCLUDES := $(folders)*
>
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static cocos_extension_static
>
include $(BUILD_SHARED_LIBRARY)
>
$(call import-module,CocosDenshion/android) > $(call import-module,cocos2dx) > $(call import-module,extensions)

I think it’s the part in bold. Can be reproduced on vanilla project.
I originally added that part instead of hard-coding the sources so it would be easier to manage folder hierarchy, but I guess it breaks stuff.


#4

Things are working better using the solution here .


#5

Hi, I am having the same issue:
`LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := cocos2dcpp_shared

LOCAL_MODULE_FILENAME := libcocos2dcpp

LOCAL_CPPFLAGS += -std=gnu++11

LOCAL_SRC_FILES := hellocpp/main.cpp
…/…/Classes/AppDelegate.cpp
…/…/Classes/MainScene.cpp
…/…/Classes/GameScene.cpp
…/…/Classes/sound.cpp
…/…/Classes/TGScoreLabel.cpp
…/…/Classes/TraceBall.cpp
…/…/Classes/FloatBall.cpp
…/…/Classes/Board.cpp
…/…/Classes/sk_game_services/sk_game_services.cpp
…/…/Classes/CCLocalizedString/CCLocalizedString.cpp
…/…/Classes/PRKit/PRFilledPolygon.cpp
…/…/Classes/PRKit/PRRatcliffTriangulator.cpp
…/…/Classes/PRKit/triangulate.cpp
…/…/Classes/Geometry.cpp
…/…/Classes/GameConfig.cpp
…/…/Classes/Edge.cpp
…/…/Classes/Block.cpp
…/…/Classes/Shape.cpp
…/…/Classes/AssistantSwipeRecognizer.cpp
…/…/Classes/cJSON/cJSON.c
…/…/Classes/ExampleEventHandler.cpp
…/…/Classes/Map.cpp
…/…/Classes/BoxItAssets.cpp
…/…/Classes/TutorialOverlay.cpp \

LOCAL_C_INCLUDES := $(LOCAL_PATH)/…/…/Classes
LOCAL_C_INCLUDES += $(LOCAL_PATH)/…/…/Classes/cJSON
LOCAL_C_INCLUDES += $(LOCAL_PATH)/…/…/Classes/sk_game_services
LOCAL_C_INCLUDES += $(LOCAL_PATH)/…/…/Classes/CCLocalizedString
LOCAL_C_INCLUDES += $(LOCAL_PATH)/…/…/Classes/PRKit
LOCAL_C_INCLUDES += $(LOCAL_PATH)/…/…/CPPExtensions/jansson
LOCAL_C_INCLUDES += $(LOCAL_PATH)/…/…/CPPExtensions/SoomlaHighway/Soomla
LOCAL_C_INCLUDES += $(LOCAL_PATH)/…/…/CPPExtensions/SoomlaHighway/Soomla/data
LOCAL_C_INCLUDES += $(LOCAL_PATH)/…/…/CPPExtensions/SoomlaHighway/Soomla/domain
LOCAL_C_INCLUDES += $(LOCAL_PATH)/…/…/CPPExtensions/SoomlaHighway/Soomla/domain/virtualCurrencies
LOCAL_C_INCLUDES += $(LOCAL_PATH)/…/…/CPPExtensions/SoomlaHighway/Soomla/domain/virtualGoods
LOCAL_C_INCLUDES += $(LOCAL_PATH)/…/…/CPPExtensions/SoomlaHighway/Soomla/domain/virtualCurrencies
LOCAL_C_INCLUDES += $(LOCAL_PATH)/…/…/CPPExtensions/SoomlaHighway/Soomla/PurchaseTypes
LOCAL_C_INCLUDES += $(LOCAL_PATH)/…/…/CPPExtensions/SoomlaHighway/Soomla/Storefront

LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static
LOCAL_WHOLE_STATIC_LIBRARIES += box2d_static
LOCAL_WHOLE_STATIC_LIBRARIES += chipmunk_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static
LOCAL_WHOLE_STATIC_LIBRARIES += SoomlaHighway_static

include $(BUILD_SHARED_LIBRARY)

$(call import-module,cocos2dx)
$(call import-module,cocos2dx/platform/third_party/android/prebuilt/libcurl)
$(call import-module,CocosDenshion/android)
$(call import-module,external/Box2D)
$(call import-module,external/chipmunk)
$(call import-module,extensions)
$(call import-module,extensions/SoomlaHighway/android/jni)`

Any tips?


#6

@Enea Gjoka
What’s your problem.