> local buf = ffi.new("char[?]", 0, "HELLO WORLD") does the trick This makes me wonder if it doesn't write out of allocated memory range? AFAIK FFI does not check for memory ranges, so it doesn't crash, but it may at any time, or I am missing sthing (!?). Anyway putting "Hello World" in your code instances a Lua string already, so I don't think putting it into local str variable makes any difference. Cheers, -- Adam Strzelecki | nanoant.com | twitter.com/nanoant