Search code examples
c++android-ndksegmentation-faultg++cocos2d-x

ndk-stack.exe just show "Segmentation fault"


I program a game with cocos2d-x. In some case my game crashes. I use "ndk-stack" to find crash point, but the ndk-stack just show "Segmentation fault". How can I get more information about the cause of crash? enter image description here


Solution

  • I could't find any other solution for this problem when ndk-stack just show "segmentation fault". The only solution is you should save logcat data in a file, then manually find this pattern. "*** *** *** ..." From there,until the end of file, you can find some good information about classes and functions. here is my information. I found this line about 200 line later than above pattern.

    I/DEBUG   ( 8175):     #02  pc 007a0e40  /data/app-lib/com.Lotus.Footcardia-1/libcocos2dcpp.so (rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >::FindMember(char const*)+128)
    

    it say the problem is from the rapidjsonand I know where i use rapidjson.

    The bad news is that the size of log file increase rapidly.