Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34k
[tracemalloc] initialize gil_state in functions to stop -Wmaybe-uninitialized warnings#144341
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
python-cla-botbot commentedJan 30, 2026 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Initialize PyGILState_STATE gil_state to PyGILState_UNLOCKED inPyTraceMalloc_Track, tracemalloc_alloc, tracemalloc_realloc tostop -Wmaybe-uninitialized warnings on GCC. Behavior is unchanged
9710396 todaeb949CompareMost changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
vstinner commentedJan 30, 2026
How did you build Python? What is your operating system name and version? What is your GCC version? |
vstinner left a comment
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.
initialize gil_state in functions to stop -Wmaybe-uninitialized warnings
Sadly, GCC is wrong here,gil_state is always initialized and it's used. GCC is confused byif (need_gil).
| PyTraceMalloc_Track(unsigned int domain, uintptr_t ptr, | ||
| size_t size) | ||
| { | ||
| PyGILState_STATE gil_state = PyGILState_UNLOCKED; |
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.
This change is not needed.
Initialize PyGILState_STATE gil_state to PyGILState_UNLOCKED in PyTraceMalloc_Track, tracemalloc_alloc, tracemalloc_realloc to stop -Wmaybe-uninitialized warnings on GCC. Behavior is unchanged