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

rb_mutex_synchronize should pass the return value as-is #3624

Closed
eregon opened this issue Jul 22, 2024 · 1 comment
Closed

rb_mutex_synchronize should pass the return value as-is #3624

eregon opened this issue Jul 22, 2024 · 1 comment

Comments

@eregon
Copy link
Member

eregon commented Jul 22, 2024

Found by @jeremyevans through:

So in this change, VALUE rb_mutex_synchronize(VALUE mutex, VALUE (*func)(VALUE arg), VALUE arg); is used.
But that function is poorly typed, every VALUE in there should be void* instead, except for VALUE mutex.
That is, both arg and the return value of func can be arbitrary things, not necessary Ruby values/handles.

We already pass arg as-is, but we unwrap+wrap the return value, which I highly suspect is the cause of that error in CI.
So we should remove the unwrap+wrap for rb_mutex_synchronize.

@andrykonchin
Copy link
Member

Fixed in 0654e66

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants