cqueues icon indicating copy to clipboard operation
cqueues copied to clipboard

error thrown from sleep: attempt to call a userdata value

Open pspacek opened this issue 5 years ago • 3 comments

Occasionally I receive mystical errors from cqueues:

error: attempt to call a userdata value stack traceback:
	[C]: in function 'poll'
	/usr/share/lua/5.1/cqueues.lua:62: in function 'sleep'
	/usr/lib/knot-resolver/kres_modules/prometheus.lua:91: in function </usr/lib/knot-resolver/kres_modules/prometheus.lua:39>

This happens asynchronously and I cannot see any explanation in my code, it just calls sleep.

The only wild idea that came to my mind is a problem with premature termination of syscalls but I do not have sufficient knowledge of cqueues and coroutines to dig deeper.

Any ideas what it might be and how to fix that?

pspacek avatar Feb 24 '20 13:02 pspacek

I'd probably start by printing off the stack just before the lua_pcall?

daurnimator avatar Feb 24 '20 14:02 daurnimator

Hmm, I do not undestand what you mean. My code is calling .sleep(1) ... do you mean adding a pcall to someplace in cqueues?

pspacek avatar Feb 25 '20 07:02 pspacek

do you mean adding a pcall to someplace in cqueues?

https://github.com/wahern/cqueues/blob/813664c99c393acbcb007023b195b241a6b90a20/src/cqueues.c#L1638

daurnimator avatar Feb 25 '20 11:02 daurnimator