-
Notifications
You must be signed in to change notification settings - Fork 188
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
move luv_work_cleanup into loop gc #742
Conversation
Are the submodule changes intentional? |
No they most certainly are not, I thought I fixed that |
atexit may be called after luv is unloaded and will segfault.
5de5726
to
2168f2c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Next necro-post (sorry!) This seems to have introduced an ASAN failure in Neovim tests: Relevant log output:
(Not very useful; will need to spend more time tracking this down.) |
The relevant ASAN failures in that log are e.g. here: https://github.com/neovim/neovim/actions/runs/12945549440/job/36109345313?pr=32174#step:10:4618. (Search for sanitizer) |
I'm not really sure I understand the test-flow of neovim, but there being many different ASAN logs from what appears to be the same test file, is neovim closing the primary Lua state and reinitializing from scratch between each test? If this is actually a bug in Luv and not neovim just not calling |
Yes, the test setup is a bit involved; basically there are two Neovim instances: The one handling the tests (think of this as a lua interpreter with a custom stdlib) and the one that is executing the actual test case ("system under test") which is being started and observed by the test handler; the system under test is where the logs are coming from, and there's indeed a fresh instance for every test (hence many logs). This is definitely a regression in v1.50.0; if there's a breaking change where something needs to be changed on Neovim's side, I would appreciate more detailed pointers. |
The only thing this change does is move the work vm cleanup from an atexit hook (which causes problems in environments where atexit is called after unloading dynamic libraries) to the Therefore if previously neovim was relying on the atexit hook to clean up the work vms and not calling If that doesn't solve the problem then this or something else introduced an actual problem and a real issue should be opened. |
Neovim is calling
So from what I can tell, Nvim is always calling |
Debugged this a little further. I believe the issue is due to Nvim calling /* do cleanup in main thread */
lua_getglobal(L, "_THREAD");
if (lua_isnil(L, -1))
luv_work_cleanup();
lua_pop(L, 1); isn't accessible. Either the above snippet needs to be wrapped into a function and exposed as API, or |
Can you open an issue for discussing this? |
👍 I've opened #754 |
atexit may be called after luv is unloaded and will segfault.
Associated #712