[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [Lua 5.3] io.lines can be called in a way to trigger an assertion
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 10 Jul 2015 11:12:09 -0300
> $ ./lua
> Lua 5.3.0 Copyright (C) 1994-2015 Lua.org, PUC-Rio
> > t ={}; for i = 1, 4096 do t[i] = i end; f=io.lines("/dev/null", table.unpack(t));
> lua: lapi.c:534: lua_pushcclosure: Assertion `(n <= (0x7f * 2 + 1)) &&
> "upvalue index too large"' failed.
> Aborted (core dumped)
>
>
> Assertions must be turned on to see this bug.
With some luck, we can see it without assertions:
> t ={}; for i = 1, 253 do t[i] = 1 end
> io.lines("lua.h", table.unpack(t))()
Segmentation fault (core dumped)
-- Roberto