Skip to content
This repository has been archived by the owner on Apr 22, 2019. It is now read-only.

Crash Fatal Signal 11 on Android #2

Closed
man2 opened this issue Aug 27, 2014 · 7 comments
Closed

Crash Fatal Signal 11 on Android #2

man2 opened this issue Aug 27, 2014 · 7 comments

Comments

@man2
Copy link

man2 commented Aug 27, 2014

Hi, I tried running fayecpp on Android. Everything compiles smoothly but when I tried to connect to FayeCpp Client, I got this

Build fingerprint: 'htc_asia_wwe/htc_primou/primou:4.0.3/IML74K/92876.2:user/rel
ease-keys'
pid: 31352, tid: 31392 >>> com.company.mygame <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000064
Stack frame I/DEBUG (31316): #00 pc 00534d36 /data/data/com.slabgam
es.mygame/lib/libcocos2dcpp.so (ZN7FayeCpp9Transport11onConnectedEv): Routine
FayeCpp::Transport::onConnected() at D:\nodejs\FayeCpp\builds\android/jni/../../
../src/transport.cpp:86
Stack frame I/DEBUG (31316): #1 pc 00535a4a /data/data/com.slabgam
es.mygame/lib/libcocos2dcpp.so (ZN7FayeCpp9WebSocket21onCallbackEstablishedEv)
: Routine FayeCpp::WebSocket::onCallbackEstablished() at D:\nodejs\FayeCpp\build
s\android/jni/../../../src/websocket.cpp:117
Stack frame I/DEBUG (31316): #2 pc 00535b6a /data/data/com.slabgam
es.mygame/lib/libcocos2dcpp.so (ZN7FayeCpp9WebSocket12callbackEchoEP20libwebso
cket_contextP12libwebsocket29libwebsocket_callback_reasonsPvS6_j): Routine FayeC
pp::WebSocket::callbackEcho(libwebsocket_context
, libwebsocket
, libwebsocket_c
allback_reasons, void
, void_, unsigned int) at D:\nodejs\FayeCpp\builds\android
/jni/../../../src/websocket.cpp:95
Stack frame I/DEBUG (31316): #3 pc 001ffb08 /data/data/com.slabgam
es.mygame/lib/libcocos2dcpp.so: Routine lws_client_interpret_server_handshake a
t libgcc2.c:?
Stack frame I/DEBUG (31316): #4 pc 002002d8 /data/data/com.slabgam
es.mygame/lib/libcocos2dcpp.so: Routine lws_client_socket_service at libgcc2.c:
?
Stack frame I/DEBUG (31316): #5 pc 001fbfec /data/data/com.slabgam
es.mygame/lib/libcocos2dcpp.so (libwebsocket_service_fd): Routine libwebsocket_
service_fd at ??:?
Stack frame I/DEBUG (31316): #6 pc 001fc134 /data/data/com.slabgam
es.mygame/lib/libcocos2dcpp.so (libwebsocket_service): Routine libwebsocket_ser
vice at ??:?
Stack frame I/DEBUG (31316): #7 pc 00535944 /data/data/com.slabgam
es.mygame/lib/libcocos2dcpp.so (_ZN7FayeCpp9WebSocket10threadBodyEv): Routine F
ayeCpp::WebSocket::threadBody() at D:\nodejs\FayeCpp\builds\android/jni/../../..
/src/websocket.cpp:332 (discriminator 1)
Stack frame I/DEBUG (31316): #8 pc 005343d2 /data/data/com.slabgam
es.mygame/lib/libcocos2dcpp.so (ZN7FayeCpp8REThread16invokeThreadBodyEPS0): R
outine FayeCpp::REThread::invokeThreadBody(FayeCpp::REThread*) at D:\nodejs\Faye
Cpp\builds\android/jni/../../../src/REThread.cpp:425
Stack frame I/DEBUG (31316): #9 pc 00534100 /data/data/com.slabgam
es.mygame/lib/libcocos2dcpp.so (ZN7FayeCpp16REThreadInternal14threadFunctionEP
v): Routine FayeCpp::REThreadInternal::threadBody() at D:\nodejs\FayeCpp\builds
android/jni/../../../src/REThread.cpp:94
Stack frame I/DEBUG (31316): #10 pc 00013494 /system/lib/libc.so (

_thread_entry)
Stack frame I/DEBUG (31316): #11 pc 00012fcc /system/lib/libc.so (p
thread_create)

Everything runs good on Windows though.
Could you help me please? I have no idea what's wrong with it.

Thank you

@OlehKulykov
Copy link
Owner

Hello, I see the problem in REThread threadBody. You see, all logic works in separed thread(in REThread threadBody) - in this method(in separed thread). So, any crash in logic will logs in this method(thread).
Could you provide some part of the crashed code.
Also, I see some error in "libwebso
cket_contextP12libwebsocket29libwebsocket_callback_reasonsPvS6_j" on the 2nd place, maybe this is the reason.... try to switch to IPv4.

@man2
Copy link
Author

man2 commented Aug 28, 2014

Could you explain more detail on how to switch to IPv4?

This is the code that caused the crash

    _delegate = new FayeDelegate();
    // create & initialize client
_client = new FayeCpp::Client();
_client->setUrl("ws://url:8000/faye");
_client->setDelegate(_delegate);
_client->connect();

I call this in cocos2d-x thread, is that causing problem? Or should I call it from a new thread?

@man2
Copy link
Author

man2 commented Aug 28, 2014

I tried calling my codes above using std::thread with no success, still same error as my first post

@man2
Copy link
Author

man2 commented Aug 28, 2014

It seems like, I was using fayecpp v0.1.2

after upgrading to v0.1.4 and setting

_client->setUsingIPV6(false);

I get this on crash dump

********* Crash dump: **********
Build fingerprint: 'htc_asia_wwe/htc_primou/primou:4.0.3/IML74K/92876.2:user/rel
ease-keys'
pid: 29660, tid: 29680 >>> com.slabgames.mygame <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000064
Stack frame I/DEBUG (29585): #00 pc 00535266 /data/data/com.slabgam
es.mygame/lib/libcocos2dcpp.so (ZN7FayeCpp9Transport11onConnectedEv): Routine
FayeCpp::Transport::onConnected() at D:\cpplibs\FayeCpp\builds\android/jni/../..
/../src/transport.cpp:92
Stack frame I/DEBUG (29585): #1 pc 00536184 /data/data/com.slabgam
es.mygame/lib/libcocos2dcpp.so (ZN7FayeCpp9WebSocket21onCallbackEstablishedEv)
: Routine FayeCpp::WebSocket::onCallbackEstablished() at D:\cpplibs\FayeCpp\buil
ds\android/jni/../../../src/websocket.cpp:159
Stack frame I/DEBUG (29585): #2 pc 00536292 /data/data/com.slabgam
es.mygame/lib/libcocos2dcpp.so (ZN7FayeCpp9WebSocket12callbackEchoEP20libwebso
cket_contextP12libwebsocket29libwebsocket_callback_reasonsPvS6_j): Routine FayeC
pp::WebSocket::callbackEcho(libwebsocket_context
, libwebsocket
, libwebsocket_c
allback_reasons, void_, void_, unsigned int) at D:\cpplibs\FayeCpp\builds\androi
d/jni/../../../src/websocket.cpp:137
Stack frame I/DEBUG (29585): #3 pc 002000b0 /data/data/com.slabgam
es.mygame/lib/libcocos2dcpp.so: Routine lws_client_interpret_server_handshake a
t libgcc2.c:?
Stack frame I/DEBUG (29585): #4 pc 00200880 /data/data/com.slabgam
es.mygame/lib/libcocos2dcpp.so: Routine lws_client_socket_service at libgcc2.c:
?
Stack frame I/DEBUG (29585): #5 pc 001fc594 /data/data/com.slabgam
es.mygame/lib/libcocos2dcpp.so (libwebsocket_service_fd): Routine libwebsocket
service_fd at ??:?
Stack frame I/DEBUG (29585): #6 pc 001fc6dc /data/data/com.slabgam
es.mygame/lib/libcocos2dcpp.so (libwebsocket_service): Routine libwebsocket_ser
vice at ??:?
Stack frame I/DEBUG (29585): #7 pc 00535fd4 /data/data/com.slabgam
es.mygame/lib/libcocos2dcpp.so (ZN7FayeCpp9WebSocket10threadBodyEv): Routine F
ayeCpp::WebSocket::threadBody() at D:\cpplibs\FayeCpp\builds\android/jni/../../.
./src/websocket.cpp:384 (discriminator 1)
Stack frame I/DEBUG (29585): #8 pc 005348ca /data/data/com.slabgam
es.mygame/lib/libcocos2dcpp.so (_ZN7FayeCpp8REThread16invokeThreadBodyEPS0): R
outine FayeCpp::REThread::invokeThreadBody(FayeCpp::REThread
) at D:\cpplibs\Fay
eCpp\builds\android/jni/../../../src/REThread.cpp:425
Stack frame I/DEBUG (29585): #9 pc 005345f8 /data/data/com.slabgam
es.mygame/lib/libcocos2dcpp.so (ZN7FayeCpp16REThreadInternal14threadFunctionEP
v): Routine FayeCpp::REThreadInternal::threadBody() at D:\cpplibs\FayeCpp\builds
\android/jni/../../../src/REThread.cpp:94
Stack frame I/DEBUG (29585): #10 pc 00013494 /system/lib/libc.so (
_thread_entry)
Stack frame I/DEBUG (29585): #11 pc 00012fcc /system/lib/libc.so (p
thread_create)

I think there might be error on thread creation here..

@man2
Copy link
Author

man2 commented Aug 28, 2014

I saw your commit for ndk-r10, I tried it but still no improvement, still same error. I forgot to mention that I'm using NDK r9d. Is it a problem because I'm compiling to static library instead of shared library?

@OlehKulykov
Copy link
Owner

Hello, I'll try to make some test android app & find out.
For now I see crash on Transport::onConnected() method with SEGV_MAPERR.

@man2
Copy link
Author

man2 commented Aug 29, 2014

Hi, I'm glad to let you know that the problem has been solved. I need to link fayecpp to my project using LOCAL_WHOLE_STATIC_LIBRARIES instead of LOCAL_STATIC_LIBRARIES

Thank you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants