lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> I obtain a segfault with the following script :
> 
> local u = io.tmpfile()
> local t = {}
> local r = debug.setuservalue(u, t)
> assert(r == u)
> assert(debug.getuservalue(u) == t)
> print 'ok'
> -- segfault during the finalization of u

About the debug library (manual 6.10):

  This library provides the functionality of the debug interface to Lua
  programs.  You should exert care when using this library.  Several of
  these functions violate basic assumptions about Lua code (e.g., [...];
  that Lua programs do not crash) [...]

(In particular, you should not change the uservalue of a file handle.)

-- Roberto