You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a profile mode where we pass a custom allocator that uses lua_getinfo(L, frame, "snl", &in) to get callstacks for where we're generating the most garbage.
Under normal operation this works great however if you enable lua_singlestep and start getting luau_callhook calls it can sometimes crash.
The problem occurs when luaD_checkstack needs to reallocate before L->ci->savedpc has been incremented: the allocator tries to call lua_getinfo which then runs into the LUAU_ASSERT in luaG_getline because pc == -1.
We fixed luau_callhook locally by simply moving the luaD_checkstack down below where savedpc is updated, like this:
// note: the pc expectations of the hook are matching the general "pc points to next instruction"
// however, for the hook to be able to continue execution from the same point, this is called with savedpc at the *current* instruction
if (L->ci->savedpc)
L->ci->savedpc++;
luaD_checkstack(L, LUA_MINSTACK); // ensure minimum stack size
L->ci->top = L->top + LUA_MINSTACK;
LUAU_ASSERT(L->ci->top <= L->stack_last);
It's a simple fix and hopefully it helps someone else doing similar tricks.
The text was updated successfully, but these errors were encountered:
* Fix#817
* Fix#850
* Optimize math.floor/ceil/round with SSE4.1
* Results in a ~7-9% speedup on the math-cordic benchmark.
* Optimized table.sort.
* table.sort is now ~4.1x faster (when not using a predicate) and ~2.1x
faster when using a simple predicate. Performance may improve further in
the future.
* Reorganize the memory ownership of builtin type definitions.
* This is a small initial step toward affording parallel typechecking.
The new type solver is coming along nicely. We are working on fixing
crashes and bugs.
A few major changes to native codegen landed this week:
* Fixed lowering of Luau IR mod instruction when first argument is a
constant
* Added VM register data-flow/capture analysis
* Fixed issues with optimizations in unreachable blocks
---------
Co-authored-by: Arseny Kapoulkine <[email protected]>
Co-authored-by: Vyacheslav Egorov <[email protected]>
We have a profile mode where we pass a custom allocator that uses lua_getinfo(L, frame, "snl", &in) to get callstacks for where we're generating the most garbage.
Under normal operation this works great however if you enable lua_singlestep and start getting luau_callhook calls it can sometimes crash.
The problem occurs when luaD_checkstack needs to reallocate before L->ci->savedpc has been incremented: the allocator tries to call lua_getinfo which then runs into the LUAU_ASSERT in luaG_getline because pc == -1.
We fixed luau_callhook locally by simply moving the luaD_checkstack down below where savedpc is updated, like this:
It's a simple fix and hopefully it helps someone else doing similar tricks.
The text was updated successfully, but these errors were encountered: