lua-users home
lua-l archive

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


I've been toying around with Lua 5.4 and its new warnings mechanism.
Unfortunately, it seem to be unable to fulfill its main function of
reporting errors from __gc metamethod.

That's how problem can be reproduced (code grabbed from GitHub mirror,
hash f39e8c06d61078467b3f32499728ed4e9b7b06bc, tested on Ubuntu 19.04):
1. Run standalone Lua
2. Run `setmetatable({},{__gc = function() error('Oops') end})`
3. Just continue hitting enter until you get

Lua warning: error in __gc metamethod (stdin:1: Oops)
Segmentation fault (core dumped)

I originally got this in my (C++ bridge) library where results were
even more weird, including runtime errors (accusing me in calling
table), syntax errors, segfaults, double-frees and more.
-- 
Valeri Ochinski <v19930312@gmail.com>