* ivan starkov: > local any_struct_ffi = ffi.new("some_struct[?]", 10) > > for i=0, 10 do > sorted[i] = 10-i > any_struct_ffi[i].value = i > end This looks like an out-of-bounds. You allocate 10 elements, (any_struct_ffi[0] to any_struct_ffi[9]), but you write to any_struct_ffi[10] as well.