[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua crashing on unrecognized strings
- From: Rob Kendrick <lua-l@...>
- Date: Mon, 24 Aug 2009 14:01:57 +0100
On Mon, 24 Aug 2009 05:52:39 -0700
"Stuart P.Bentley" <stuart@testtrack4.com> wrote:
> Using the lua.exe interpreter provided with Lua for Windows, passing
> any letter to (os.date("%"..letter)) other than a-d, j, m, p, w-z, A,
> B, H, I, M, S, U, or W-Z is causing to crash (as in "has encountered
> a problem and needs to close" crash). This also happens when calling
> io.open with any undefined format string.
I seem to recall that this is a (rare) underspecification problem in
C. Passing invalid format strings to some of the C functions that take
them has undefined effects. Under Linux, (which the Lua demo runs), it
results in something that lets the program continue. Under Windows, it
results in an explosion.
I believe there was some talk that the next Lua would check these
strings before passing them to the C library, which while safer means
you can't use extensions your C library provides from Lua.
B.