Segfault when using ffi in a loop/stderr

  • From: Chris <chris@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sun, 30 Nov 2014 19:04:36 -0500

I'm on 64-bit Linux using 32-bit compiled LuaJIT 2.1.0-alpha (current git).

To reproduce the issue requires a few files. I put everything in a zip here:
http://luadev.com/broken.zip

"make" will create the test.so then run "luajit test.lua"

On my machine it segfaults every time after a few hundred cycles of the loop.

If I put the FFI stuff (test2.lua) in the same file instead of "requiring" it or if I use "print" instead of "io.stderr:write" the segfault seems to go away.

--
Chris
http://luadev.com

Other related posts: