Skip to content
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

fix #564, invalid thread argument causes crash. #566

Merged
merged 4 commits into from
Sep 19, 2021

Conversation

erw7
Copy link
Contributor

@erw7 erw7 commented Sep 17, 2021

This is an attempt to fix #564 with a different approach than #565.

Change luv_work_cb() to run in protected mode and throw an error in luv_thread_arg_set() if an argument of an impermissible type is passed. It's a little more complicated, but I've integrated it into neovim and it seems to be working.

@erw7 erw7 force-pushed the fix-luv-new-thread branch 2 times, most recently from c142d0a to c7950a6 Compare September 18, 2021 03:16
@erw7 erw7 force-pushed the fix-luv-new-thread branch from c7950a6 to bf07594 Compare September 18, 2021 03:43
@zhaozg
Copy link
Member

zhaozg commented Sep 18, 2021

Would you like to add some test about this?

@zhaozg zhaozg mentioned this pull request Sep 18, 2021
@erw7
Copy link
Contributor Author

erw7 commented Sep 18, 2021

Would you like to add some test about this?

Yes, I would like to add a test. If I link to neovim, it looks like the problem has been solved. However, luajit still crash SIGABRT (core dumped). I'll give it some more consideration.

Change luv_work_cb to run in protected mode and throw an error in
luv_thread_arg_set if an argument of an impermissible type is passed.
@erw7 erw7 force-pushed the fix-luv-new-thread branch from bf07594 to cac3c27 Compare September 18, 2021 09:16
src/work.c Show resolved Hide resolved
@zhaozg zhaozg merged commit 0e9d8d8 into luvit:master Sep 19, 2021
@zhaozg
Copy link
Member

zhaozg commented Sep 19, 2021

@erw7 Thank you very much.

@erw7 erw7 deleted the fix-luv-new-thread branch September 19, 2021 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash when passing a lua object as thread argument
2 participants