不断报错: A/libc: Fatal signal 11 (SIGSEGV), code

siganl 11, 就是使用了  空引用,  一直找不到原因, 就在进入函数里不停的报错,  可是写的都没问题, 把函数体内容完全换了是正常的,  但是留着第一句的打印还是报错

LOGD("dfdf startserver %s  %s, %d, %s",__FILE__,__LINE__,__FUNCTION__);
看到了吧, 只是多加了 %s, 之前还找了半天, 打脸啪啪(piapia)的。

Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)

12-02

正在调试公司遗留项目,win32平台下弄些按钮点击会崩溃,貌似是某些参数没有初始化rnrn上面的问题暂时没理会,然后移植到Android平台,运行时出现标题中的错误,(cocos2dx3.2)rnrn其他日志如下rnrn[code=c]rn12-02 10:03:25.918: W/System.err(1392): at com.tencent.permissionfw.permission.a.a(SourceFile:272)rn12-02 10:03:25.918: W/System.err(1392): at tcs.awt$a.onTransact(SourceFile:127)rn12-02 10:03:25.918: W/System.err(1392): at android.os.Binder.execTransact(Binder.java:404)rn//---------------------------------------------------------------------rn12-02 10:03:25.918: A/libc(23705): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 23734 (Thread-458)rn12-02 10:03:25.918: W/System.err(1392): at dalvik.system.NativeStart.run(Native Method)rn12-02 10:03:25.928: E/Parcel(794): Reading a NULL string not supported here.rn12-02 10:03:25.978: D/dalvikvm(1339): GC_EXPLICIT freed 2001K, 13% free 16169K/18484K, paused 2ms+7ms, total 40msrn12-02 10:03:26.028: I/DEBUG(172): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***rn12-02 10:03:26.028: I/DEBUG(172): Build fingerprint: 'google/occam/mako:4.4.4/KTU84P/1227136:user/release-keys'rn12-02 10:03:26.028: I/DEBUG(172): Revision: '11'rn12-02 10:03:26.028: I/DEBUG(172): pid: 23705, tid: 23734, name: Thread-458 >>> com.any.iee <<rn12-02 10:03:26.138: I/DEBUG(172): #01 pc 004f36bf /data/app-lib/com.any.iee-2/libcocos2dcpp.so (Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit+234)rn12-02 10:03:26.138: I/DEBUG(172): #02 pc 0001dbcc /system/lib/libdvm.so (dvmPlatformInvoke+112)rn12-02 10:03:26.138: I/DEBUG(172): #03 pc 0004e123 /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+398)rn12-02 10:03:26.138: I/DEBUG(172): #04 pc 0004fb0d /system/lib/libdvm.so (dvmResolveNativeMethod(unsigned int const*, JValue*, Method const*, Thread*)+184)rn12-02 10:03:26.138: I/DEBUG(172): #05 pc 00026fe0 /system/lib/libdvm.sorn12-02 10:03:26.138: I/DEBUG(172): #06 pc 0002dfa0 /system/lib/libdvm.so (dvmMterpStd(Thread*)+76)rn12-02 10:03:26.138: I/DEBUG(172): #07 pc 0002b638 /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)rn12-02 10:03:26.138: I/DEBUG(172): #08 pc 0006057d /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+336)rn12-02 10:03:26.138: I/DEBUG(172): #09 pc 000605a1 /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20)rn12-02 10:03:26.138: I/DEBUG(172): #10 pc 00055287 /system/lib/libdvm.sorn12-02 10:03:26.138: I/DEBUG(172): #11 pc 0000d170 /system/lib/libc.so (__thread_entry+72)rn12-02 10:03:26.138: I/DEBUG(172): #12 pc 0000d308 /system/lib/libc.so (pthread_create+240)rn12-02 10:03:26.138: I/DEBUG(172): stack:rn12-02 10:03:26.138: I/DEBUG(172): 75a79a30 75a79a20 [stack:23734]rn12-02 10:03:26.138: I/DEBUG(172): 75a79a34 747981c5 /system/lib/egl/libGLESv2_adreno.so (glClearColor+30)rn12-02 10:03:26.138: I/DEBUG(172): 75a79a38 00000021 rn12-02 10:03:26.138: I/DEBUG(172): 75a79a3c 00000018 rnrn[/code]rnrn之后用ndk的ndk-stack工具定位错误位置rn结果是 工程目录下cocos2d\cocos\platform\android中的javaactivity.cpp中的67行错误,以下是javaactivity.cpprn[code=c]rn/****************************************************************************rnCopyright (c) 2013-2014 Chukong Technologies Inc.rnrnhttp://www.cocos2d-x.orgrnrnPermission is hereby granted, free of charge, to any person obtaining a copyrnof this software and associated documentation files (the "Software"), to dealrnin the Software without restriction, including without limitation the rightsrnto use, copy, modify, merge, publish, distribute, sublicense, and/or sellrncopies of the Software, and to permit persons to whom the Software isrnfurnished to do so, subject to the following conditions:rnrnThe above copyright notice and this permission notice shall be included inrnall copies or substantial portions of the Software.rnrnTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORrnIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,rnFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THErnAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERrnLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,rnOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INrnTHE SOFTWARE.rn****************************************************************************/rnrn#include "base/CCPlatformConfig.h"rn#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROIDrnrn#include "CCApplication.h"rn#include "base/CCDirector.h"rn#include "base/CCEventCustom.h"rn#include "base/CCEventType.h"rn#include "renderer/CCGLProgramCache.h"rn#include "renderer/CCTextureCache.h"rn#include "2d/CCDrawingPrimitives.h"rn#include "CCGLView.h"rn#include "platform/android/jni/JniHelper.h"rn#include rn#include rnrn#define LOG_TAG "main"rn#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)rnrnvoid cocos_android_app_init(JNIEnv* env, jobject thiz) __attribute__((weak));rnrnusing namespace cocos2d;rnrnextern "C"rnrnrnjint JNI_OnLoad(JavaVM *vm, void *reserved)rnrn JniHelper::setJavaVM(vm);rnrn return JNI_VERSION_1_4;rnrnrnvoid Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thiz, jint w, jint h)rnrn auto director = cocos2d::Director::getInstance();rn auto glview = director->getOpenGLView();rn if (!glview)rn rn glview = cocos2d::GLView::create("Android app");rn glview->setFrameSize(w, h);rn director->setOpenGLView(glview);rn rn cocos_android_app_init(env, thiz);//出错位置 rnrn cocos2d::Application::getInstance()->run();rn rn elsern rn cocos2d::GL::invalidateStateCache();rn cocos2d::GLProgramCache::getInstance()->reloadDefaultGLPrograms();rn cocos2d::DrawPrimitives::init();rn cocos2d::VolatileTextureMgr::reloadAllTextures();rnrn cocos2d::EventCustom recreatedEvent(EVENT_RENDERER_RECREATED);rn director->getEventDispatcher()->dispatchEvent(&recreatedEvent);rn director->setGLDefaultValues();rn rnrnrnrnvoid Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeOnSurfaceChanged(JNIEnv* env, jobject thiz, jint w, jint h)rnrn cocos2d::Application::getInstance()->applicationScreenSizeChanged(w, h);rnrnrnrnrn#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROIDrnrn[/code]rn错误的函数在obj.android/jni/hellocpp中的main.cpp中,以下是main.cpprn[code=c]rn#include "AppDelegate.h"rn#include "cocos2d.h"rn#include "platform/android/jni/JniHelper.h"rn#include rn#include rnrn#define LOG_TAG "main"rn#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)rnrnusing namespace cocos2d;rnrnvoid cocos_android_app_init (JNIEnv* env, jobject thiz) rn LOGD("cocos_android_app_init");rn AppDelegate *pAppDelegate = new AppDelegate();rnrn[/code]rn搞了一周了,没弄出来,快疯了。开始有人标题的错误是资源没找到,但是assets中的资源是eclipse运行时ndk自动复制过来的。还有人说是资源路径大小写没区分,我也检查了一部分,都区分了(量很大,所以只检查了最先调用的几个资源)rnrn求大神指点!!!!!!!!!!!!!!!!!!rn

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试