seninha has quit [Remote host closed the connection]
avocadoist has quit [Ping timeout: 256 seconds]
seninha has joined #picolisp
seninha has quit [Remote host closed the connection]
abu[7] has left #picolisp [#picolisp]
abu[7] has joined #picolisp
rob_w has joined #picolisp
isaneran has joined #picolisp
z4k4ri4_ has quit [Ping timeout: 255 seconds]
z4k4ri4_ has joined #picolisp
rob_w has quit [Ping timeout: 240 seconds]
rob_w has joined #picolisp
isaneran has quit [Ping timeout: 256 seconds]
avocadoist has joined #picolisp
seninha has joined #picolisp
rob_w has quit [Ping timeout: 264 seconds]
z4k4ri4_ has quit [Ping timeout: 256 seconds]
z4k4ri4_ has joined #picolisp
rob_w has joined #picolisp
rob_w has quit [Remote host closed the connection]
<
abu[7]>
Found a (gc) bug in coroutines :(
<
beneroth>
good you found it :)
<
beneroth>
how special are the circumstances to trigger it?
<
abu[7]>
The probability is very low
<
abu[7]>
I have a tight loop creating one hundred thousand coroutines
<
beneroth>
so it's a kind of small memory leak?
<
beneroth>
or gc bug when the stars align?
<
abu[7]>
It is a gc bug
<
abu[7]>
'co' calls 'put' in one place
<
abu[7]>
and this may trigger a gc
<
abu[7]>
and this (put + perhaps gc) happens before the coroutine is fully initialized
<
abu[7]>
The simple solution is to call this 'put' a few lines later after initialization is finished
<
beneroth>
ah, nice
<
beneroth>
so a race condition
<
abu[7]>
it is deterministic
<
abu[7]>
It is guaranteed to crash if gc runs here
<
abu[7]>
gc traverses also coroutines
<
abu[7]>
and if fields in the stack structure are missing, it crashes
<
beneroth>
makes sense
pablo_escoberg has joined #picolisp
<
fbytez_>
How long have coroutines been part of the language?
<
abu[7]>
I think around 2016
isaneran has joined #picolisp
<
beneroth>
the issue discussed today most like only affects the pil21 implementation of coroutines, not the older implementation in pil64
<
beneroth>
abu[7] ?
<
abu[7]>
This 'put' was rather recently, it is only a pointer cache for speedup
<
abu[7]>
but coroutines in pil64 are not really usable anyway
<
abu[7]>
Pil21 improved them in many aspects
pablo_escoberg has quit [Quit: Client closed]
<
tankf33der>
Tests passed
<
abu[7]>
Great, thanks!
isaneran has quit [Ping timeout: 240 seconds]
<
beneroth>
tankf33der, thanks for the testing!
<
beneroth>
abu[7], thanks for patching and the explanation
<
beneroth>
not that fbytez_ thinks this was bugged since the introduction of coroutines :)
<
beneroth>
it was a new recent bug from a recent optimization
<
abu[7]>
But coroutines had a lot of bugs and other changes over the last year(s)
<
beneroth>
also I guess one can say that coroutines is one of the most complex components within picolisp runtime, yes?
<
abu[7]>
It is the most complicated part of pil
<
beneroth>
database is very simple in comparison
<
beneroth>
pilog is complex but not prone to bugs
<
beneroth>
thanks for the fix :)
<
abu[7]>
Welcome :)
seninha has quit [Ping timeout: 260 seconds]
avocadoist has quit [Ping timeout: 255 seconds]
seninha has joined #picolisp
seninha has quit [Ping timeout: 255 seconds]
seninha has joined #picolisp
seninha has quit [Quit: Leaving]