ThePhD / sol2

Sol3 (sol2 v3.0) - a C++ <-> Lua API wrapper with advanced features and top notch performance - is here, and it's great! Documentation:
http://sol2.rtfd.io/
MIT License
4.16k stars 504 forks source link

SIGSEGV when getting protected function from `sol::state` #1393

Open skywalkerytx opened 2 years ago

skywalkerytx commented 2 years ago

build system

ubuntu 20.04

clang-12 with c++20

using Clion 2022.2.1

lua related

sol-3.2.2with luajit-2.1

what I did

sol::protected_function foo = lua_state["bar"];
lua_state = std::move(new_state);
foo = lua_state["bar"]; //SIGSEGV here

expected behavior

no segfault

full script to reproduce

https://gist.github.com/skywalkerytx/87e46500fc2ceb2fa58eef99e203f4af

helmesjo commented 1 year ago

Any update here? Experiencing the same in (3.2.3).