Closed filiptibell closed 1 year ago
I reproduced the issue, thanks.
It's an edge case related to using wrong "self" (userdata) index after extracting arguments from the stack and invalidating relative indexes (works wrong only for Variadic/MultiValue types). The new mlua has many performance improvements and one of them is extracting function arguments directly from Lua stack without creating intermediate data structures and exchanging values between main thread and "reference" thread.
The SIGSEGV
you've seen it's a c++ assertion that checks correctness of Lua API usage.
Thank you for fixing this so quickly!
One of our tests is currently causing SIGSEGV using
mlua
version0.9.0
(full release) when usingVariadic<UserDataRef<T>>
, even though we are not usingunsafe
anywhere in our codebase:https://github.com/filiptibell/lune/blob/83db30496d729a70038501ffae7317e549ef31f8/tests/roblox/datatypes/CFrame.luau#L102-L112
This is the relevant piece of source code in our repo:
https://github.com/filiptibell/lune/blob/83db30496d729a70038501ffae7317e549ef31f8/src/roblox/datatypes/types/cframe.rs#L213-L225
And a minimal implementation of our userdata type, which is a wrapper around
glam::Mat4