Skip to content

Crash on application close(Mac) #18110

@newnon

Description

@newnon
  • cocos2d-x version:3.15.1
  • devices test on:mac
  • developing environments
    • NDK version:
    • Xcode version:
    • VS version:
    • browser type and version:

Steps to Reproduce:

  1. open websocket
  2. close application
    you will get crash(SIGPIPE)

callstack
#0 0x00007fffc4522bf2 in __psynch_cvwait ()
#1 0x000000010304fab1 in _pthread_cond_wait ()
#2 0x00007fffc2f8d4cd in std::__1::condition_variable::wait(std::__1::unique_lockstd::__1::mutex&) ()
#3 0x00000001014784cf in cocos2d::network::WebSocket::close() at /cocos2d/cocos/network/WebSocket.cpp:725
#4 0x0000000101483dcd in cocos2d::network::WebSocket::WebSocket()::$_0::operator()(cocos2d::EventCustom*) const at /cocos2d/cocos/network/WebSocket.cpp:539
#5 0x0000000101483d10 in std::__1::__invoke<cocos2d::network::WebSocket::WebSocket()::$_0&, cocos2d::EventCustom*>(decltype(std::__1::forwardcocos2d::network::WebSocket::WebSocket()::$_0&(fp)(std::__1::forwardcocos2d::EventCustom*(fp0))), cocos2d::network::WebSocket::WebSocket()::$_0&&&, cocos2d::EventCustom*&&) [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base:416
#6 0x0000000101483cf0 in _ZNSt3__128__invoke_void_return_wrapperIvE6__callIJRZN7cocos2d7network9WebSocketC1EvE3$0PNS3_11EventCustomEEEEvDpOT at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base:468
#7 0x0000000101483a29 in std::__1::__function::__func<cocos2d::network::WebSocket::WebSocket()::$_0, std::__1::allocatorcocos2d::network::WebSocket::WebSocket()::$_0, void (cocos2d::EventCustom*)>::operator()(cocos2d::EventCustom*&&) at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1437
#8 0x0000000100e2d07c in std::__1::function<void (cocos2d::EventCustom*)>::operator()(cocos2d::EventCustom*) const at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1817
#9 0x0000000100e2cfd1 in cocos2d::EventListenerCustom::init(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::function<void (cocos2d::EventCustom*)> const&)::$_0::operator()(cocos2d::Event*) const at /cocos2d/cocos/base/CCEventListenerCustom.cpp:58
#10 0x0000000100e2cf60 in decltype(std::__1::forward<cocos2d::EventListenerCustom::init(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::function<void (cocos2d::EventCustom*)> const&)::$_0&>(fp)(std::__1::forwardcocos2d::Event*(fp0))) std::__1::__invoke<cocos2d::EventListenerCustom::init(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::function<void (cocos2d::EventCustom*)> const&)::$_0&, cocos2d::Event*>(cocos2d::EventListenerCustom::init(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::function<void (cocos2d::EventCustom*)> const&)::$_0&&&, cocos2d::Event*&&) [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base:416
#11 0x0000000100e2cf40 in void std::__1::__invoke_void_return_wrapper::__call<cocos2d::EventListenerCustom::init(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::function<void (cocos2d::EventCustom*)> const&)::$_0&, cocos2d::Event*>(cocos2d::EventListenerCustom::init(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::function<void (cocos2d::EventCustom*)> const&)::$_0&&&, cocos2d::Event*&&) at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base:468
#12 0x0000000100e2ce59 in std::__1::__function::__func<cocos2d::EventListenerCustom::init(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::function<void (cocos2d::EventCustom*)> const&)::$_0, std::__1::allocator<cocos2d::EventListenerCustom::init(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::function<void (cocos2d::EventCustom*)> const&)::$_0>, void (cocos2d::Event*)>::operator()(cocos2d::Event*&&) at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1437
#13 0x00000001012f175c in std::__1::function<void (cocos2d::Event*)>::operator()(cocos2d::Event*) const at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1817
#14 0x00000001012f1684 in cocos2d::EventDispatcher::dispatchEvent(cocos2d::Event*)::$_2::operator()(cocos2d::EventListener*) const at /cocos2d/cocos/base/CCEventDispatcher.cpp:931
#15 0x00000001012f1620 in decltype(std::__1::forwardcocos2d::EventDispatcher::dispatchEvent(cocos2d::Event*)::$_2&(fp)(std::__1::forwardcocos2d::EventListener*(fp0))) std::__1::__invoke<cocos2d::EventDispatcher::dispatchEvent(cocos2d::Event*)::$_2&, cocos2d::EventListener*>(cocos2d::EventDispatcher::dispatchEvent(cocos2d::Event*)::$_2&&&, cocos2d::EventListener*&&) [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base:416
#16 0x00000001012f1600 in bool std::__1::__invoke_void_return_wrapper::__call<cocos2d::EventDispatcher::dispatchEvent(cocos2d::Event*)::$_2&, cocos2d::EventListener*>(cocos2d::EventDispatcher::dispatchEvent(cocos2d::Event*)::$_2&&&, cocos2d::EventListener*&&) at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base:437
#17 0x00000001012f14b9 in std::__1::__function::__func<cocos2d::EventDispatcher::dispatchEvent(cocos2d::Event*)::$_2, std::__1::allocatorcocos2d::EventDispatcher::dispatchEvent(cocos2d::Event*)::$_2, bool (cocos2d::EventListener*)>::operator()(cocos2d::EventListener*&&) at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1437
#18 0x00000001012d111c in std::__1::function<bool (cocos2d::EventListener*)>::operator()(cocos2d::EventListener*) const at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1817
#19 0x00000001012d0f74 in cocos2d::EventDispatcher::dispatchEventToListeners(cocos2d::EventDispatcher::EventListenerVector*, std::__1::function<bool (cocos2d::EventListener*)> const&) at /cocos2d/cocos/base/CCEventDispatcher.cpp:793
#20 0x00000001012d25ff in cocos2d::EventDispatcher::dispatchEvent(cocos2d::Event*) at /cocos2d/cocos/base/CCEventDispatcher.cpp:935
#21 0x0000000101000cb9 in cocos2d::Director::reset() at /cocos2d/cocos/base/CCDirector.cpp:1064
#22 0x0000000101001209 in cocos2d::Director::purgeDirector() at /cocos2d/cocos/base/CCDirector.cpp:1147
#23 0x00000001010027be in cocos2d::Director::mainLoop() at /cocos2d/cocos/base/CCDirector.cpp:1499
#24 0x000000010146d435 in cocos2d::Application::run() at /cocos2d/cocos/platform/mac/CCApplication-mac.mm:103
#25 0x0000000100499012 in main at /Users/sergey/Documents/Sources/SkillGames/proj.ios_mac/mac/main.cpp:43
#26 0x00007fffc43f4235 in start ()
#27 0x00007fffc43f4235 in start ()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions