Le jeu. 21 mai 2026 à 12:14, 'Martin Eden' via lua-l
<
lu...@googlegroups.com> 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?