lua-users home
lua-l archive

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


> So, I guess that the best solution for this would be for the Lua API to
> receive an external random seed as argument to lua_newstate, and let the
> embedder decide whether to provide an actual random data or not. And of
> course, the standard interpreter would have to have an option to expose
> this if so desired.

We have considered that. However, fixing the seed does not eliminate the
problem, only ameliorate it. "Non-conventional" keys (such as tables
and functions) use the object address as the key, so ASLR makes those
keys non deterministic, independently of any seed. (In particular,
this problem was already present in Lua well before 5.2.) The fact
that, without random seeds, traversals for tables with no object keys
are deterministic should be seen as an implementation detail. The
clean approach is not to count on it. (You may sort your data, as Alex
suggested.)


-- Roberto