joyent / libuv

Go to
https://github.com/libuv/libuv
3.27k stars 654 forks source link

proper (?) uv_close()ing one-shot timers #364

Closed dvv closed 11 years ago

dvv commented 12 years ago

Hi!

My app is aborting with the following stacktrace when trying to do the subj.

#0  __GI_raise(sig = 6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  __GI_abort() at abort.c:92
#2  ev_unref(loop = 0x636980) at src/unix/ev/ev.c:2557
#3  ev_stop(loop = 0x636980, w = 0x63b4f8) at src/unix/ev/ev.c:2658
#4  ev_timer_stop(loop = 0x636980, w = 0x63b4f8) at src/unix/ev/ev.c:2756
#5  timers_reify(loop = 0x636980) at src/unix/ev/ev.c:2206
#6  ev_run(loop = 0x636980, flags = 0) at src/unix/ev/ev.c:2509
#7  uv_run(loop = 0x636640) at src/unix/core.c:208
#8  main() at src/test.c:91

To replicate the issue, build https://github.com/dvv/luv with simple make, run ./luv and run https://github.com/luvit/luvit/blob/master/examples/http-bench.lua in another terminal. Hit CTRL+C to abort the client, and server should get aborted with the above trace.

What ever calls timers_reify() (unix/ev/ev.c:2756)? There, a logic exists which stops non-repeating timers and i believe they are attempted to be stopped already being stopped by me (manual uv_close() does that)

TIA, --Vladimir

bnoordhuis commented 12 years ago

@dvv: With what commit of libuv are you seeing this?

dvv commented 12 years ago

with https://github.com/joyent/libuv/commit/2b3ba91eb91143b20741b62a7164e529032bb7ae 64bit linux

dvv commented 12 years ago

and now with the current master -- https://github.com/joyent/libuv/commit/6e0ca3aa8f92e398f4bbbe872d56af7ec3af6212 -- on 32bit linux as well

saghul commented 12 years ago

Hi @dvv,

I've written Python bindings for libuv and I've never seen this, do you have a synthetic test showing this behavior?

dvv commented 12 years ago

thank you for heads up. it's in my dvv/luv. i'll soon be writing a test case for libuv. but i believe you can replicate it with uv_close()ing a previously stopped one-shot timer.

saghul commented 12 years ago

Ok, I'll wait for your test then, I couldn't find a way to reproduce this myself.

saghul commented 11 years ago

No follow up, closing.