Re: An heap-use-after-free is triggered in the insertkey()

Julien Cugnière <[email protected]> Thu, 21 May 2026 13:23:38 +0200
Newsgroups gmane.comp.lang.lua.general
Message-ID <CAPY4yo7Ue--gj98y+hhMD1_yTJ8f3sTYgAP4yhDaDmuQPm5uWw@mail.gmail.com>
Le jeu. 21 mai 2026 à 12:14, 'Martin Eden' via lua-l
<[email protected]> a écrit :
> On 2026-05-21 11:54, Sergey Bronnikov wrote:
> > Hello,
> >
> > an heap-use-after-free is triggered on execution of a Lua chunk below:
>
> I expect that using "debug" module voids warranty.

This disclaimer is well known, but Sergey's example got me thinking:
does it still apply to "read-only" uses of the debug library?

Of course when using functions such as
debug.setlocal/setupvalue/setmetatable all bets are off. But in this
example, only debug.getinfo and debug.sethook are used. Theoretically
getinfo is a read-only operation (unless it needs to mutate some
internal state to gather the information?). Setting a hook can be
considered a modification of the state, but the hook itself is not
doing anything obviously dangerous. So it feels like such a use of the
debug library shouldn't be able to crash Lua?

-- 
You received this message because you are subscribed to the Google Groups "lua-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/lua-l/CAPY4yo7Ue--gj98y%2BhhMD1_yTJ8f3sTYgAP4yhDaDmuQPm5uWw%40mail.gmail.com.