lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Sat, 2019-08-17 at 11:26 +0300, Egor Skriptunoff wrote:
> function segfault()
>    for k = 1, 1/0 do
>       x = debug.getinfo(k) or x.func()
>    end
> end

To make it a bit more clear:

for k = 1, math.maxinteger or math.huge do
    x = debug.getinfo(k) or x.func()
end

So this calls lowest function from Lua stack. Kinda interesting.

> Vanilla Lua crashes (why?)

I guess you're simply not supposed to access it normally. I would
actually like to see "Dumb ways to die" but with how to ruin Lua with
`debug` library :-). This one would make a decent contribution.

-- 
v <v19930312@gmail.com>