-
Notifications
You must be signed in to change notification settings - Fork 393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hitting a crash in an assert after lua_equal is called. #259
Comments
Can you post the code that calls lua_equal? |
It's related to defining the __eq metamethod for a table, then invoking lua_compare on itself:
with lua_compare as in 5.3 / 5.4 or on falling back to this in 5.1 / 5.2:
|
I think we might be missing thread wakeup calls on external calls that can invoke Lua (lua_equal, lua_lessthan, maybe others? unsure)... If you want a quick fix, copying this code from lua_call to lua_equal probably works.
|
Yes it works ! Thanks a bunch 👍🏻 |
lua_getfield and other functions that can invoke metatables would have the same problem... maybe we should change the placement for wakeup. We'll take a look at how to best fix this so that these issues don't come up, thanks for the report! (we don't really use these functions at Roblox which is why we never noticed the issue) |
It seems this is the remaining blocker for having LuaBridge3 supporting Luau 🥂 |
A fix for this issue is ready and the PR will be available soon. |
- Fix some cases where type checking would overflow the native stack - Improve autocomplete behavior when assigning a partially written function call (not currently exposed through command line tools) - Improve autocomplete type inference feedback for some expressions where previously the type would not be known - Improve quantification performance during type checking for large types - Improve type checking for table literals when the expected type of the table is known because of a type annotation - Fix type checking errors in cases where required module has errors in the resulting type - Fix debug line information for multi-line chained call sequences (Add function name information for "attempt to call a nil value" #255) - lua_newuserdata now takes 2 arguments to match Lua/LuaJIT APIs better; lua_newuserdatatagged should be used if the third argument was non-0. - lua_ref can no longer be used with LUA_REGISTRYINDEX to prevent mistakes when migrating Lua FFI (Inconsistency with lua_ref #247) - Fix assertions and possible crashes when executing script code indirectly via metatable dispatch from lua_equal/lua_lessthan/lua_getfield/etc. (Hitting a crash in an assert after lua_equal is called. #259) - Fix flamegraph scripts to run under Python 2
This is now fixed, although you need to enable the fix with a flag like this:
The flag is going to be removed in the future and this won't be necessary. |
I don't understand where to apply the fix? I'm just including the VM and running bytecode (i don't have access to the Ast library). |
I see... the flag interaction with the OSS world for fixes like this is something we'll need to think about. I'll change the defaults here for now to have things just work. |
I have some code that executes a bunch of lua declarations of global variables, then i obtain those as references and then i compare those references (which will invoke
lua_equal
) and i'm getting an assert hit inside Luau whenlua_equal
is executed for some of the references.This is the callstack:
and this is the assert i'm getting:
It's interesting because all lua vms i'm testing against with this particular unit test (5.1, 5.2, 5.3, 5.4, Luajit2) they pass it nicely. Anything i should be looking for ? i've tried creating some stack space explicitly but i cannot seems to avoid the crash.
The text was updated successfully, but these errors were encountered: