lua-users home
lua-l archive

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

(This is on Lua 5.1, work 2, on OSX, gcc 3.3)

What is the expected behavior of lua_getinfo(L, "n", &ar) if the name information has been stripped from the lua code via the "luac -s" command line compiler?

I had been hoping to merely receive useless or empty strings, but instead my program is crashing in lua_getinfo() as auxgetinfo() passes NULL as the address of the buffer for getfuncname to write into.

If I don't use the "-s" param, everything is OK. Obviously, I can't retrieve lua source for the individual stack frames, but I do get good names for the functions, locals, and upvalues for each stack frame.

Does lua_getinfo() have formally undefined behavior in this case (in which case, crashing is "acceptable"), or does it have a defined behavior (return empty strings for myLua_Debug->name, etc.)

I have screenshots of gdb showing the crash, C Stack, and C locals, but I don't know if posting binaries is accepted for this mail list, so I'm not attaching them yet.

Tim Gogolin