-
-
Notifications
You must be signed in to change notification settings - Fork 56.4k
Fix race condition in InternalFFMpegRegister initialization. #25419
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
Conversation
| if(!threadSafe) | ||
| lock.lock(); | ||
| static InternalFFMpegRegister instance; | ||
| initLogger_(); // update logger setup unconditionally (GStreamer's libav plugin may override these settings) |
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.
I take a look on the comment.
It comes from this commit: 7baf2e8
which commit message says "repair FFmpeg logger settings on each .open() call"
@mshabunin Do you remember which reproducer we had for this case?
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.
@mshabunin Do you remember which reproducer we had for this case?
No, I don't 🙁
PR was #19661
|
FYI, the stack trace we have is (line numbers might be off by a few units; if needed I can get the exact code references): |
initLogger_ does not check if the logger has been initizalized before and it might initialize it several times from different threads, racing with other threads that are logging.
Fix race condition in InternalFFMpegRegister initialization. opencv#25419 initLogger_ does not check if the logger has been initizalized before and it might initialize it several times from different threads, racing with other threads that are logging. ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work
initLogger_ does not check if the logger has been initizalized before and it might initialize it several times from different threads, racing with other threads that are logging.
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request