Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
Fix for #2237: intermittent Lua data stack overflow.
|
|
|
|
Otherwise, an exception raised in the block containing a LuaStackDelta
instance -- that might be caught -- would result in an LL_ERRS() crash. We
can't expect a block exited via exception to keep its contract wrt the Lua
data stack.
|
|
|
|
Specifically, defend against a callback that runs so long it suspends at a
point after the next timer tick.
|
|
Use a static unordered_map to allow a function receiving (lua_State* L) to
look up the LuaState instance managing that lua_State. We've thought about
this from time to time already. LuaState's constructor creates the map entry;
its destructor removes it; the new static getParent(lua_State* L) method
performs the lookup.
Migrate lluau::set_interrupts_counter() and check_interrupts_counter() into
LuaState member functions. Add a new mInterrupts counter for them.
Importantly, LuaState::check_interrupts_counter(), which is indirectly called
by a lua_callbacks().interrupt function, no longer performs any Lua stack
operations. Empirically, it seems the Lua engine is capable of interrupting
itself at a moment when re-entry confuses it.
Change previous lluau::set_interrupts_counter(L, 0) calls to
LuaState::getParent(L).set_interrupts_counter(0).
Also add LuaStackDelta class, and a lua_checkdelta() helper macro, to verify
that the Lua data stack depth on exit from a block differs from the depth on
entry by exactly the expected amount. Sprinkle lua_checkdelta() macros in
likely places.
|
|
In fact we set mOldValue from mVar, and restore mVar from mOldValue, so the
VAR type makes the most sense. The previous way, you'd get actual errors if
you tried to use TempSet(pointervar, nullptr): that declared mOldValue to be
nullptr_t, which you can't initialize from mVar.
|
|
|
|
|
|
|
|
|
|
luaL_checkstack() accepts a third parameter which is included in the stack
overflow error message. We've been passing nullptr, leading to messages of the
form "stack overflow ((null))". lluau_checkstack() implicitly passes
__FUNCTION__, so we can distinguish which underlying luaL_checkstack() call
encountered the stack overflow condition.
Also, when calling each atexit() function, pass Luau's debug.traceback()
function as the lua_pcall() error handler. This should help diagnose errors in
atexit() functions.
|
|
Update Luau to v0.638-r2 (2024-08-12 build)
|
|
|
|
Lua api for sending group messages
|
|
|
|
Add Throttle and LogThrottle classes to manage throttled APIs.
|
|
|
|
|
|
|
|
Introduce a custom coroutine/fiber scheduler to prioritize UI.
With approval from Maxim and Atlas, merging to project trunk.
|
|
|
|
|
|
|
|
|
|
Add test_flycam.lua to exercise the smaller intervals.
|
|
Thanks, Maxim.
|
|
|
|
Fix omission in login.savedLogins().
|
|
Also add Region.lua.
|
|
|
|
Rename 'UI' 'getParents' op to 'getTopMenus', add UI.lua function.
|
|
|
|
Also update the 'UI' help text to reflect its more general nature.
Mention 0-relative rank in the xxToolbarBtn operation help text.
|
|
|
|
Lua UI visibility api
|
|
|
|
The viewer's main thread's main fiber is responsible for coordinating just
about everything. With the default round_robin fiber scheduling algorithm,
launching too many additional fibers could starve the main fiber, resulting in
visible lag.
This custom scheduler tracks when it switches to and from the main fiber, and
at each context switch, how long it's been since the last time the main fiber
ran. If that exceeds a certain timeslice, it jumps the main fiber to the head
of the queue and resumes that instead of any other ready fiber.
|
|
|
|
|
|
Add 'LLPanelLogin' 'login', 'savedLogins' operations.
|
|
|
|
Convert plain grid (e.g. "agni") to domain form (e.g. "util.agni.lindenlab.com").
Fix a typo in `savedLogins()`: "login_list", not "login.list".
login.lua now returns a table with two functions: `login.login()` and
`login.savedLogins()`.
Defend Lua caller against trying to engage login features too late in startup
sequence: in addition to waiting for "STATE_LOGIN_WAIT", produce an error if
`startup.state()` is beyond that state. Since by then `LLPanelLogin` is
destroyed, `leap.request("LLPanelLogin", ...)` would get no response, causing
the calling Lua script to hang until viewer shutdown.
|
|
'login' accepts optional 'username', 'slurl', 'grid'.
'savedLogins' returns the list of saved usernames in both display form and
internal form.
Make LLPanelLogin::getUserName() accept (const LLPointer<LLCredential>&).
There's a whole separate discussion pending as to whether const LLPointer<T>
should provide access to non-const T methods.
Similarly, make LLCredential::getIdentifier() a const method. These two
changes enable read-only access to credentials.
Make LLPanelLogin methods capture and reuse LLGridManager::instance() as
appropriate.
Add require/login.lua and test_login.lua.
|
|
|
|
|
|
|