require "lfs"
f = assert(io.open("test","r"))
print(lfs.lock(f,"w"))
(lfs version = 1.3.0)
Hi. lfs needs to be linked to msvcrt. It's crashing because it tries to
operate on a file handle corresponding to another copy of the runtime.
Since you mention that version 1.2 of lfs was only 28kb, it seems that
the link settings have been changed by mistake.