Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pc_client_cleanup() inside pc_client_poll() bug. #63

Open
xpol opened this issue Apr 6, 2016 · 1 comment
Open

pc_client_cleanup() inside pc_client_poll() bug. #63

xpol opened this issue Apr 6, 2016 · 1 comment

Comments

@xpol
Copy link
Contributor

xpol commented Apr 6, 2016

If pc_client_cleanup() called inside pc_client_poll() will trigger assertion faild:

#3  0x00007fff840ecdf8 in __assert_rtn ()
#4  0x0000000101879cd7 in pc_mutex_destroy at deps/libpomelo2/src/pc_mutex.h:82
#5  0x0000000101879c11 in pc_client_cleanup at deps/libpomelo2/src/pc_pomelo.c:291
#6  0x00000001018abb72 in Client_gc(lua_State*) at lua-pomelo.cpp:465
#7  0x00000001017e8f28 in lj_BC_FUNCC ()
#8  0x00000001017eb366 in gc_finalize ()
#9  0x00000001017eb8ed in gc_onestep ()
#10 0x00000001017ebd48 in lj_gc_fullgc ()
#11 0x00000001017f9635 in lua_gc ()
#12 0x0000000101840ec7 in lj_cf_collectgarbage ()
#13 0x00000001017e8f28 in lj_BC_FUNCC ()
#14 0x00000001017f91f4 in lua_pcall ()
#15 0x00000001018abfc3 in lua_request_cb(pc_request_s const*, int, char const*) at lua-pomelo.cpp:559
#16 0x000000010187c560 in pc__trans_resp at deps/libpomelo2/src/pc_trans.c:333
#17 0x0000000101879dbc in pc__handle_event at deps/libpomelo2/src/pc_pomelo.c:310
#18 0x0000000101879447 in pc_client_poll at deps/libpomelo2/src/pc_pomelo.c:374

the pc_client_poll locks the event_mutex and pc_client_cleanup tries to destroy it.

The library neither checking polling states in pc_client_cleanup nor provide way to delay destroy client.

@cynron
Copy link
Member

cynron commented Apr 25, 2016

we should ensure pc_client_cleanup() never be called in polling callbacks, so do async callbacks

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

No branches or pull requests

2 participants