A bit more digging: the file is not closed at the end of the 'do ... end' block. Tracing the system calls shows that the file is closed after the error message (probably by __gc).
If I look at the generated code it seems like the slot for variable 'file' gets reused by 'database'.
Gé
On Fri, May 22, 2020 at 11:34 AM Gé Weijers <ge@weijers.org> wrote:
BTW: platform: 64-bit x86 Debian 10 Linux.
I tested this with an unmodified Lua, built with the distributed Makefile to rule out any mistakes on my part.