{"action":"created","issue":{"url":"https://api.github.com/repos/ThePhD/sol2/issues/281","repository_url":"https://api.github.com/repos/ThePhD/sol2","labels_url":"https://api.github.com/repos/ThePhD/sol2/issues/281/labels{/name}","comments_url":"https://api.github.com/repos/ThePhD/sol2/issues/281/comments","events_url":"https://api.github.com/repos/ThePhD/sol2/issues/281/events","html_url":"https://github.com/ThePhD/sol2/issues/281","id":190257739,"number":281,"title":"Crash when call protected_function","user":{"login":"IronsDu","id":5152119,"avatar_url":"https://avatars.githubusercontent.com/u/5152119?v=3","gravatar_id":"","url":"https://api.github.com/users/IronsDu","html_url":"https://github.com/IronsDu","followers_url":"https://api.github.com/users/IronsDu/followers","following_url":"https://api.github.com/users/IronsDu/following{/other_user}","gists_url":"https://api.github.com/users/IronsDu/gists{/gist_id}","starred_url":"https://api.github.com/users/IronsDu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IronsDu/subscriptions","organizations_url":"https://api.github.com/users/IronsDu/orgs","repos_url":"https://api.github.com/users/IronsDu/repos","events_url":"https://api.github.com/users/IronsDu/events{/privacy}","received_events_url":"https://api.github.com/users/IronsDu/received_events","type":"User","site_admin":false},"labels":[{"id":434900193,"url":"https://api.github.com/repos/ThePhD/sol2/labels/Help.Desk","name":"Help.Desk","color":"006b75","default":false}],"state":"open","locked":false,"assignee":{"login":"ThePhD","id":2886436,"avatar_url":"https://avatars.githubusercontent.com/u/2886436?v=3","gravatar_id":"","url":"https://api.github.com/users/ThePhD","html_url":"https://github.com/ThePhD","followers_url":"https://api.github.com/users/ThePhD/followers","following_url":"https://api.github.com/users/ThePhD/following{/other_user}","gists_url":"https://api.github.com/users/ThePhD/gists{/gist_id}","starred_url":"https://api.github.com/users/ThePhD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThePhD/subscriptions","organizations_url":"https://api.github.com/users/ThePhD/orgs","repos_url":"https://api.github.com/users/ThePhD/repos","events_url":"https://api.github.com/users/ThePhD/events{/privacy}","received_events_url":"https://api.github.com/users/ThePhD/received_events","type":"User","site_admin":false},"assignees":[{"login":"ThePhD","id":2886436,"avatar_url":"https://avatars.githubusercontent.com/u/2886436?v=3","gravatar_id":"","url":"https://api.github.com/users/ThePhD","html_url":"https://github.com/ThePhD","followers_url":"https://api.github.com/users/ThePhD/followers","following_url":"https://api.github.com/users/ThePhD/following{/other_user}","gists_url":"https://api.github.com/users/ThePhD/gists{/gist_id}","starred_url":"https://api.github.com/users/ThePhD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThePhD/subscriptions","organizations_url":"https://api.github.com/users/ThePhD/orgs","repos_url":"https://api.github.com/users/ThePhD/repos","events_url":"https://api.github.com/users/ThePhD/events{/privacy}","received_events_url":"https://api.github.com/users/ThePhD/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/ThePhD/sol2/milestones/9","html_url":"https://github.com/ThePhD/sol2/milestones/Helpdesk","labels_url":"https://api.github.com/repos/ThePhD/sol2/milestones/9/labels","id":1938255,"number":9,"title":"Helpdesk","description":"Welcome! How may I assist you...","creator":{"login":"ThePhD","id":2886436,"avatar_url":"https://avatars.githubusercontent.com/u/2886436?v=3","gravatar_id":"","url":"https://api.github.com/users/ThePhD","html_url":"https://github.com/ThePhD","followers_url":"https://api.github.com/users/ThePhD/followers","following_url":"https://api.github.com/users/ThePhD/following{/other_user}","gists_url":"https://api.github.com/users/ThePhD/gists{/gist_id}","starred_url":"https://api.github.com/users/ThePhD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThePhD/subscriptions","organizations_url":"https://api.github.com/users/ThePhD/orgs","repos_url":"https://api.github.com/users/ThePhD/repos","events_url":"https://api.github.com/users/ThePhD/events{/privacy}","received_events_url":"https://api.github.com/users/ThePhD/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":25,"state":"open","created_at":"2016-08-12T03:44:55Z","updated_at":"2016-11-23T20:31:18Z","due_on":null,"closed_at":null},"comments":8,"created_at":"2016-11-18T07:58:56Z","updated_at":"2016-11-24T00:46:22Z","closed_at":null,"body":"In my PingPong test, will crash, when C++ call protected_function on timer timeout.\r\n\r\n- \r\n[irons@localhost Joynet]$ valgrind lua examples/PingpongClient-PB.lua\r\n==6034== Memcheck, a memory error detector\r\n==6034== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.\r\n==6034== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info\r\n==6034== Command: lua examples/PingpongClient-PB.lua\r\n==6034==\r\n==6034== Invalid read of size 8\r\n==6034==    at 0x404C52: index2addr (in /usr/local/bin/lua)\r\n==6034==    by 0x405BCE: lua_rawgeti (in /usr/local/bin/lua)\r\n==6034==    by 0x5F98588: std::_Function_handler<void (), std::_Bind<CoreDD::startLuaTimer(int, sol::basic_protected_function<sol::reference>)::{lambda()#1} ()> >::_M_invoke(std::_Any_data const&) (in /home/irons/Joynet/Joynet.so)\r\n==6034==    by 0x5FB9C8A: TimerMgr::Schedule() (in /home/irons/Joynet/Joynet.so)\r\n==6034==    by 0x5F9E4D0: int sol::detail::static_trampoline<&(int sol::usertype_metatable<CoreDD, std::integer_sequence<unsigned long, 0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul, 8ul, 9ul, 10ul, 11ul, 12ul, 13ul, 14ul>, char const (&) [13], void (CoreDD::*)(), char const (&) [15], long (CoreDD::*)(), char const (&) [5], void (CoreDD::*)(), char const (&) [17], int (CoreDD::*)(), char const (&) [7], void (CoreDD::*)(int, char const*, int), char const (&) [11], long (CoreDD::*)(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&), char const (&) [14], long (CoreDD::*)(int, sol::basic_protected_function<sol::reference>), char const (&) [12], void (CoreDD::*)(long), char const (&) [19], void (CoreDD::*)(int, long), char const (&) [16], void (CoreDD::*)(int, long), char const (&) [17], void (CoreDD::*)(int, long, char const*, int), char const (&) [20], bool (CoreDD::*)(int, int, long, bool), char const (&) [13], long (CoreDD::*)(char const*, int, int), char const (&) [4], sol::constructor_list<sol::types<> >&, char const (&) [5], sol::destructor_wrapper<void> const&>::real_call<5ul, true, false>(lua_State*))>(lua_State*) (in /home/irons/Joynet/Joynet.so)\r\n==6034==    by 0x4085CE: luaD_precall (in /usr/local/bin/lua)\r\n==6034==    by 0x413384: luaV_execute (in /usr/local/bin/lua)\r\n==6034==    by 0x4089AE: luaD_call (in /usr/local/bin/lua)\r\n==6034==    by 0x408A00: luaD_callnoyield (in /usr/local/bin/lua)\r\n==6034==    by 0x407E1B: luaD_rawrunprotected (in /usr/local/bin/lua)\r\n==6034==    by 0x408C4C: luaD_pcall (in /usr/local/bin/lua)\r\n==6034==    by 0x40630B: lua_pcallk (in /usr/local/bin/lua)\r\n==6034==  Address 0x5c81a18 is 40 bytes inside a block of size 216 free'd\r\n==6034==    at 0x4C2AD17: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)\r\n==6034==    by 0x4155B8: l_alloc (in /usr/local/bin/lua)\r\n==6034==    by 0x40B5FD: luaM_realloc_ (in /usr/local/bin/lua)\r\n==6034==    by 0x40AC22: sweeplist (in /usr/local/bin/lua)\r\n==6034==    by 0x40AD39: sweepstep (in /usr/local/bin/lua)\r\n==6034==    by 0x40B43D: luaC_step (in /usr/local/bin/lua)\r\n==6034==    by 0x405726: lua_pushlstring (in /usr/local/bin/lua)\r\n==6034==    by 0x4213D3: str_sub (in /usr/local/bin/lua)\r\n==6034==    by 0x4085CE: luaD_precall (in /usr/local/bin/lua)\r\n==6034==    by 0x413384: luaV_execute (in /usr/local/bin/lua)\r\n==6034==    by 0x40885F: unroll (in /usr/local/bin/lua)\r\n==6034==    by 0x407E1B: luaD_rawrunprotected (in /usr/local/bin/lua)\r\n==6034==\r\n==6034== Invalid read of size 8\r\n==6034==    at 0x404CD0: index2addr (in /usr/local/bin/lua)\r\n==6034==    by 0x405BCE: lua_rawgeti (in /usr/local/bin/lua)\r\n==6034==    by 0x5F98588: std::_Function_handler<void (), std::_Bind<CoreDD::startLuaTimer(int, sol::basic_protected_function<sol::reference>)::{lambda()#1} ()> >::_M_invoke(std::_Any_data const&) (in /home/irons/Joynet/Joynet.so)\r\n==6034==    by 0x5FB9C8A: TimerMgr::Schedule() (in /home/irons/Joynet/Joynet.so)\r\n==6034==    by 0x5F9E4D0: int sol::detail::static_trampoline<&(int sol::usertype_metatable<CoreDD, std::integer_sequence<unsigned long, 0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul, 8ul, 9ul, 10ul, 11ul, 12ul, 13ul, 14ul>, char const (&) [13], void (CoreDD::*)(), char const (&) [15], long (CoreDD::*)(), char const (&) [5], void (CoreDD::*)(), char const (&) [17], int (CoreDD::*)(), char const (&) [7], void (CoreDD::*)(int, char const*, int), char const (&) [11], long (CoreDD::*)(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&), char const (&) [14], long (CoreDD::*)(int, sol::basic_protected_function<sol::reference>), char const (&) [12], void (CoreDD::*)(long), char const (&) [19], void (CoreDD::*)(int, long), char const (&) [16], void (CoreDD::*)(int, long), char const (&) [17], void (CoreDD::*)(int, long, char const*, int), char const (&) [20], bool (CoreDD::*)(int, int, long, bool), char const (&) [13], long (CoreDD::*)(char const*, int, int), char const (&) [4], sol::constructor_list<sol::types<> >&, char const (&) [5], sol::destructor_wrapper<void> const&>::real_call<5ul, true, false>(lua_State*))>(lua_State*) (in /home/irons/Joynet/Joynet.so)\r\n==6034==    by 0x4085CE: luaD_precall (in /usr/local/bin/lua)\r\n==6034==    by 0x413384: luaV_execute (in /usr/local/bin/lua)\r\n==6034==    by 0x4089AE: luaD_call (in /usr/local/bin/lua)\r\n==6034==    by 0x408A00: luaD_callnoyield (in /usr/local/bin/lua)\r\n==6034==    by 0x407E1B: luaD_rawrunprotected (in /usr/local/bin/lua)\r\n==6034==    by 0x408C4C: luaD_pcall (in /usr/local/bin/lua)\r\n==6034==    by 0x40630B: lua_pcallk (in /usr/local/bin/lua)\r\n==6034==  Address 0x5c81a10 is 32 bytes inside a block of size 216 free'd\r\n==6034==    at 0x4C2AD17: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)\r\n==6034==    by 0x4155B8: l_alloc (in /usr/local/bin/lua)\r\n==6034==    by 0x40B5FD: luaM_realloc_ (in /usr/local/bin/lua)\r\n==6034==    by 0x40AC22: sweeplist (in /usr/local/bin/lua)\r\n==6034==    by 0x40AD39: sweepstep (in /usr/local/bin/lua)\r\n==6034==    by 0x40B43D: luaC_step (in /usr/local/bin/lua)\r\n==6034==    by 0x405726: lua_pushlstring (in /usr/local/bin/lua)\r\n==6034==    by 0x4213D3: str_sub (in /usr/local/bin/lua)\r\n==6034==    by 0x4085CE: luaD_precall (in /usr/local/bin/lua)\r\n==6034==    by 0x413384: luaV_execute (in /usr/local/bin/lua)\r\n==6034==    by 0x40885F: unroll (in /usr/local/bin/lua)\r\n==6034==    by 0x407E1B: luaD_rawrunprotected (in /usr/local/bin/lua)\r\n==6034==\r\n==6034== Invalid read of size 8\r\n==6034==    at 0x405BD5: lua_rawgeti (in /usr/local/bin/lua)\r\n==6034==    by 0x5F98588: std::_Function_handler<void (), std::_Bind<CoreDD::startLuaTimer(int, sol::basic_protected_function<sol::reference>)::{lambda()#1} ()> >::_M_invoke(std::_Any_data const&) (in /home/irons/Joynet/Joynet.so)\r\n==6034==    by 0x5FB9C8A: TimerMgr::Schedule() (in /home/irons/Joynet/Joynet.so)\r\n==6034==    by 0x5F9E4D0: int sol::detail::static_trampoline<&(int sol::usertype_metatable<CoreDD, std::integer_sequence<unsigned long, 0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul, 8ul, 9ul, 10ul, 11ul, 12ul, 13ul, 14ul>, char const (&) [13], void (CoreDD::*)(), char const (&) [15], long (CoreDD::*)(), char const (&) [5], void (CoreDD::*)(), char const (&) [17], int (CoreDD::*)(), char const (&) [7], void (CoreDD::*)(int, char const*, int), char const (&) [11], long (CoreDD::*)(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&), char const (&) [14], long (CoreDD::*)(int, sol::basic_protected_function<sol::reference>), char const (&) [12], void (CoreDD::*)(long), char const (&) [19], void (CoreDD::*)(int, long), char const (&) [16], void (CoreDD::*)(int, long), char const (&) [17], void (CoreDD::*)(int, long, char const*, int), char const (&) [20], bool (CoreDD::*)(int, int, long, bool), char const (&) [13], long (CoreDD::*)(char const*, int, int), char const (&) [4], sol::constructor_list<sol::types<> >&, char const (&) [5], sol::destructor_wrapper<void> const&>::real_call<5ul, true, false>(lua_State*))>(lua_State*) (in /home/irons/Joynet/Joynet.so)\r\n==6034==    by 0x4085CE: luaD_precall (in /usr/local/bin/lua)\r\n==6034==    by 0x413384: luaV_execute (in /usr/local/bin/lua)\r\n==6034==    by 0x4089AE: luaD_call (in /usr/local/bin/lua)\r\n==6034==    by 0x408A00: luaD_callnoyield (in /usr/local/bin/lua)\r\n==6034==    by 0x407E1B: luaD_rawrunprotected (in /usr/local/bin/lua)\r\n==6034==    by 0x408C4C: luaD_pcall (in /usr/local/bin/lua)\r\n==6034==    by 0x40630B: lua_pcallk (in /usr/local/bin/lua)\r\n==6034==    by 0x403FC6: docall (in /usr/local/bin/lua)\r\n==6034==  Address 0x5c81a08 is 24 bytes inside a block of size 216 free'd\r\n==6034==    at 0x4C2AD17: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)\r\n==6034==    by 0x4155B8: l_alloc (in /usr/local/bin/lua)\r\n==6034==    by 0x40B5FD: luaM_realloc_ (in /usr/local/bin/lua)\r\n==6034==    by 0x40AC22: sweeplist (in /usr/local/bin/lua)\r\n==6034==    by 0x40AD39: sweepstep (in /usr/local/bin/lua)\r\n==6034==    by 0x40B43D: luaC_step (in /usr/local/bin/lua)\r\n==6034==    by 0x405726: lua_pushlstring (in /usr/local/bin/lua)\r\n==6034==    by 0x4213D3: str_sub (in /usr/local/bin/lua)\r\n==6034==    by 0x4085CE: luaD_precall (in /usr/local/bin/lua)\r\n==6034==    by 0x413384: luaV_execute (in /usr/local/bin/lua)\r\n==6034==    by 0x40885F: unroll (in /usr/local/bin/lua)\r\n==6034==    by 0x407E1B: luaD_rawrunprotected (in /usr/local/bin/lua)\r\n==6034==\r\n==6034== Invalid write of size 8\r\n==6034==    at 0x405BE5: lua_rawgeti (in /usr/local/bin/lua)\r\n==6034==    by 0x5F98588: std::_Function_handler<void (), std::_Bind<CoreDD::startLuaTimer(int, sol::basic_protected_function<sol::reference>)::{lambda()#1} ()> >::_M_invoke(std::_Any_data const&) (in /home/irons/Joynet/Joynet.so)\r\n==6034==    by 0x5FB9C8A: TimerMgr::Schedule() (in /home/irons/Joynet/Joynet.so)\r\n==6034==    by 0x5F9E4D0: int sol::detail::static_trampoline<&(int sol::usertype_metatable<CoreDD, std::integer_sequence<unsigned long, 0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul, 8ul, 9ul, 10ul, 11ul, 12ul, 13ul, 14ul>, char const (&) [13], void (CoreDD::*)(), char const (&) [15], long (CoreDD::*)(), char const (&) [5], void (CoreDD::*)(), char const (&) [17], int (CoreDD::*)(), char const (&) [7], void (CoreDD::*)(int, char const*, int), char const (&) [11], long (CoreDD::*)(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&), char const (&) [14], long (CoreDD::*)(int, sol::basic_protected_function<sol::reference>), char const (&) [12], void (CoreDD::*)(long), char const (&) [19], void (CoreDD::*)(int, long), char const (&) [16], void (CoreDD::*)(int, long), char const (&) [17], void (CoreDD::*)(int, long, char const*, int), char const (&) [20], bool (CoreDD::*)(int, int, long, bool), char const (&) [13], long (CoreDD::*)(char const*, int, int), char const (&) [4], sol::constructor_list<sol::types<> >&, char const (&) [5], sol::destructor_wrapper<void> const&>::real_call<5ul, true, false>(lua_State*))>(lua_State*) (in /home/irons/Joynet/Joynet.so)\r\n==6034==    by 0x4085CE: luaD_precall (in /usr/local/bin/lua)\r\n==6034==    by 0x413384: luaV_execute (in /usr/local/bin/lua)\r\n==6034==    by 0x4089AE: luaD_call (in /usr/local/bin/lua)\r\n==6034==    by 0x408A00: luaD_callnoyield (in /usr/local/bin/lua)\r\n==6034==    by 0x407E1B: luaD_rawrunprotected (in /usr/local/bin/lua)\r\n==6034==    by 0x408C4C: luaD_pcall (in /usr/local/bin/lua)\r\n==6034==    by 0x40630B: lua_pcallk (in /usr/local/bin/lua)\r\n==6034==    by 0x403FC6: docall (in /usr/local/bin/lua)\r\n==6034==  Address 0x5c911d0 is 16 bytes inside a block of size 1,280 free'd\r\n==6034==    at 0x4C2AD17: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)\r\n==6034==    by 0x4155B8: l_alloc (in /usr/local/bin/lua)\r\n==6034==    by 0x40B5FD: luaM_realloc_ (in /usr/local/bin/lua)\r\n==6034==    by 0x40FC1F: luaE_freethread (in /usr/local/bin/lua)\r\n==6034==    by 0x40AC22: sweeplist (in /usr/local/bin/lua)\r\n==6034==    by 0x40AD39: sweepstep (in /usr/local/bin/lua)\r\n==6034==    by 0x40B43D: luaC_step (in /usr/local/bin/lua)\r\n==6034==    by 0x405726: lua_pushlstring (in /usr/local/bin/lua)\r\n==6034==    by 0x4213D3: str_sub (in /usr/local/bin/lua)\r\n==6034==    by 0x4085CE: luaD_precall (in /usr/local/bin/lua)\r\n==6034==    by 0x413384: luaV_execute (in /usr/local/bin/lua)\r\n==6034==    by 0x40885F: unroll (in /usr/local/bin/lua)\r\n\r\n- \r\n\r\nI use CentOS Linux release 7.2.1511 (Core) 64-bit  (Host in VMWare 12 of Win10), and Lua 5.3.\r\n\r\nBut when I only test timer https://github.com/IronsDu/Joynet/blob/dev/examples/TestLuaTimer.lua, none crash.\r\n\r\nIf you want test, you will compiler Joynet https://github.com/IronsDu/Joynet/tree/dev , and compiler  lua protobuf binding https://github.com/cloudwu/pbc/tree/master/binding/lua53. (I push my protobuf.so, maybe you can't use).\r\n\r\nFor test, enter Joynet dir, run:\r\n\r\n1: `lua examples/PingpongServer-PB.lua`\r\n2: `lua examples/PingpongClient-PB.lua`\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/ThePhD/sol2/issues/comments/262664387","html_url":"https://github.com/ThePhD/sol2/issues/281#issuecomment-262664387","issue_url":"https://api.github.com/repos/ThePhD/sol2/issues/281","id":262664387,"user":{"login":"IronsDu","id":5152119,"avatar_url":"https://avatars.githubusercontent.com/u/5152119?v=3","gravatar_id":"","url":"https://api.github.com/users/IronsDu","html_url":"https://github.com/IronsDu","followers_url":"https://api.github.com/users/IronsDu/followers","following_url":"https://api.github.com/users/IronsDu/following{/other_user}","gists_url":"https://api.github.com/users/IronsDu/gists{/gist_id}","starred_url":"https://api.github.com/users/IronsDu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IronsDu/subscriptions","organizations_url":"https://api.github.com/users/IronsDu/orgs","repos_url":"https://api.github.com/users/IronsDu/repos","events_url":"https://api.github.com/users/IronsDu/events{/privacy}","received_events_url":"https://api.github.com/users/IronsDu/received_events","type":"User","site_admin":false},"created_at":"2016-11-24T00:46:22Z","updated_at":"2016-11-24T00:46:22Z","body":"Hi, I guess you **Build GCC from source by hand.** But the build target : libstdc++.so.6 and outher **not copy to system lib path**.\r\n\r\nYou can look here : http://stackoverflow.com/questions/5216399/usr-lib-libstdc-so-6-version-glibcxx-3-4-15-not-found\r\n\r\nYou can find libstdc++.so in your build dir, then copy them to system lib path(eg. /lib64/ )"}}
{"actor":{"display_login":"IronsDu"}}