1 Jan 2005 02:07
Bug in Lua 5.0.2
Spencer Schumann <gauchopuro <at> gmail.com>
2005-01-01 01:07:24 GMT
2005-01-01 01:07:24 GMT
I've been experiencing some random crashes within the Lua interpreter
in code that makes heavy use of coroutines. I've distilled the
offending code down to the following:
-----------------------------------------------------------------
local thread_id = 0
local threads = {}
function fn(thread)
thread_id = thread_id + 1
threads[thread_id] = function()
thread = nil
end
coroutine.yield()
end
while true do
local thread = coroutine.create(fn)
coroutine.resume(thread, thread)
end
-----------------------------------------------------------------
I've run this code under Windows, using builds from several compilers,
and also under Solaris; the code produces a segfault in under a
second.
Enabling lua assertions shows several failed assertions. The exact
assertions are sensitive to small changes in the above code; however,
one consistent assertion failure happens at lgc.c, line 222.
(Continue reading)
If no-one complains I'll submit it shortly, it seems to function OK.
--
Wim
RSS Feed