Description
Calling Scene::FindActorByName from Lua causes OvEditor.exe to crash with an access violation in sol (stack_get_unqualified.hpp). Crash occurs when sol dereferences the internal userdata pointer (void* udata = *pudata), reading 0x00000000. The failure happens while resolving the bound Scene usertype when the Lua call is dispatched.
To Reproduce
Steps to reproduce the behavior:
- Launch OvEditor
- In Lua, execute: Debug.Log(tostring(Scene:FindActorByName("...")))
- The engine attempts to call the bound Scene member function.
- OvEditor.exe crashes with an access violation inside sol at Dependencies/sol/include/sol/stack_get_unqualified.hpp (dereference of userdata pointer).
Expected behavior
A stable call that returns either a valid Actor userdata or nil/string result; no native crash. If the Lua call is invalid (nil self or wrong call syntax), sol should return a clear error rather than dereferencing a null pointer.
Screenshots
N/A
Additional useful details (to include in the GitHub issue):
• Exception: 0xC0000005 (Access violation reading location 0x00000000)
• Fault site: solstackunqualified_getter<...>::get_no_lua_nil — line where void* udata = *pudata; is executed.
• Likely triggers: lua_touserdata(L, index) returned null (light userdata, nil, or wrong stack index); member call invoked without a valid 'self' userdata; mismatch between new_usertype registration and bound member functions; or userdata lifetime corruption.
• Immediate diagnostic steps: inspect Lua stack at the call (type_of(L,1), lua_touserdata(L,1)); confirm Lua callsite uses ':'; enable SOL_SAFE_USERTYPE to get safer error messages.
Description
Calling Scene::FindActorByName from Lua causes OvEditor.exe to crash with an access violation in sol (stack_get_unqualified.hpp). Crash occurs when sol dereferences the internal userdata pointer (void* udata = *pudata), reading 0x00000000. The failure happens while resolving the bound Scene usertype when the Lua call is dispatched.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A stable call that returns either a valid Actor userdata or nil/string result; no native crash. If the Lua call is invalid (nil self or wrong call syntax), sol should return a clear error rather than dereferencing a null pointer.
Screenshots
N/A
Additional useful details (to include in the GitHub issue):
• Exception: 0xC0000005 (Access violation reading location 0x00000000)
• Fault site: solstackunqualified_getter<...>::get_no_lua_nil — line where void* udata = *pudata; is executed.
• Likely triggers: lua_touserdata(L, index) returned null (light userdata, nil, or wrong stack index); member call invoked without a valid 'self' userdata; mismatch between new_usertype registration and bound member functions; or userdata lifetime corruption.
• Immediate diagnostic steps: inspect Lua stack at the call (type_of(L,1), lua_touserdata(L,1)); confirm Lua callsite uses ':'; enable SOL_SAFE_USERTYPE to get safer error messages.