[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Bug with unchecked stack overflow with coroutines
- From: Matthew Paul Del Buono <delbu9c1@...>
- Date: Mon, 11 Feb 2008 10:55:04 -0500 (EST)
FWIW, I can NOT reproduce this bug on Windows compiled with Visual Studio 2008. However there could be a few reasons for this:
- I'm using the code from Lua 5.1.3rc5. Are there any relevant changes between RC5 and release that could have introduced this bug?
- I modified the Lua code slightly, though the only changes are in the string library and the GC. I don't expect either of these changes to have resolved/hidden the bug, but in theory it's possible.
I HAVE been able to duplicate this problem on Linux/Gentoo with the current release of 5.1.3; I have not had a chance to test 5.1.3 release on Windows.
-- Matthew P. Del Buono
---- Original message ----
>Date: Mon, 11 Feb 2008 02:08:17 -0700
>From: "Patrick Donnelly" <batrick.donnelly@gmail.com>
>Subject: Bug with unchecked stack overflow with coroutines
>To: "Lua list" <lua@bazar2.conectiva.com.br>
>
>Lua 5.1.3 Copyright (C) 1994-2008 Lua.org, PUC-Rio
>> j = 1e4
>> co = coroutine.create(function() t = {} for i = 1, j do t[i] = i end return unpack(t) end)
>> print(coroutine.resume(co))
>Segmentation fault
>
>this appears to only happen in Lua 5.1.3, 5.1.2 correctly catches this:
>
>Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio
>> j = 1e4
>> co = coroutine.create(function() t = {} for i = 1, j do t[i] = i end return unpack(t) end)
>> print(coroutine.resume(co))
>false stdin:1: stack overflow (table too big to unpack)
>
>You may need to play with values for 'j'.
>
>--
>-Patrick Donnelly
>
>"One of the lessons of history is that nothing is often a good thing
>to do and always a clever thing to say."
>
>-Will Durant