-
Notifications
You must be signed in to change notification settings - Fork 318
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 multithreading bug about default_io in iiod-reader #1212
base: main
Are you sure you want to change the base?
Conversation
…erted twice into the readers list. This is only a temporary solution until the underlying issue is solved.
Hello. Can you please do a rebase/ clean up of the commits? It is a little unclear what's going on |
There is no definitve fix yet. You can follow our discussion in the issue. |
I think the fix will be in line with serializing accesses to the default IO. I did implemented a possible fix but then I was pulled to some other stuff. I just pushed it here: https://github.com/analogdevicesinc/libiio/tree/staging/multiple-default-io-users If you time to look at it and give it a test... But this is totally untested code and it's likely to fail so totally fair if you don't want to try it 😅 . It's based on Paul's approach but it goes a step beyond with respect to refcounting. I think we have a fundamental issue in the client side with iiod_responder_get_default_io(). That gives us a pointer to a refcounted object but we do not increase the count. Adding that we have async waiting, we're opening a door for use after free (theoretical but I think possible). I'm also using the refcount value to detect whether or not the IO has active waiters. |
PR Description
fixes #1211
PR Type
PR Checklist