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

base/thread.h: always safeguard the access to _logger() #5410

Open
nfeske opened this issue Jan 6, 2025 · 0 comments
Open

base/thread.h: always safeguard the access to _logger() #5410

nfeske opened this issue Jan 6, 2025 · 0 comments

Comments

@nfeske
Copy link
Member

nfeske commented Jan 6, 2025

The private Thread::_logger() class function returns a nullptr whenever tracing is (temporarily) inhibited. This inibit mechanism is used on Linux while setting up the tracing infrastructure. In any case, the Trace::trace accessors must not unconditionally de-reference the returned pointer.

Related to #4915

@nfeske nfeske added the bug label Jan 6, 2025
nfeske added a commit that referenced this issue Jan 6, 2025
The pointer returned by '_logger()' can be a nullptr, in particular
while tracing is (temporarily) inhibited. This patch ensures that
the 'Thread::trace' accessors never operate on a nullptr.

Fixes #5410
@nfeske nfeske added the fixed label Jan 6, 2025
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

1 participant