-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
COMMON_FIELDS macro in funcobject.h leaks to user code #118207
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
Labels
Comments
FWIW: I have a script almost ready to detect other stray definitions without the |
encukou
pushed a commit
that referenced
this issue
Apr 25, 2024
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Apr 25, 2024
…ndef it after use (pythonGH-118208) (cherry picked from commit 796b3fb) Co-authored-by: Itamar Oren <itamarost@gmail.com>
thanks @encukou ! waiting for the backport to land and then we can close this issue :) |
JelleZijlstra
pushed a commit
that referenced
this issue
Apr 26, 2024
facebook-github-bot
pushed a commit
to facebookincubator/cinder
that referenced
this issue
Apr 26, 2024
…nd undef it after use Summary: supersedes D56454529 by backporting the upstream version instead of an internal patch upstream issue: python/cpython#118207 upstream PR: python/cpython#118269 still undef'ing the macro, but also renaming it to have `_Py` prefix, for consistency, and to avoid conflicts if the same name is already defined before including `Python.h` Reviewed By: aleivag Differential Revision: D56579827 fbshipit-source-id: c8260818f5901bc9c3eb582999575af9c64f189f
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug description:
the
COMMON_FIELDS
macro is defined here, and can end up being included in user code (viaPython.h
)."COMMON_FIELDS" is not a unique enough identifier, and can conflict with other use of the same name in user C/C++ code (has happened to us at Meta).
this macro is used only twice within the same header as it is defined, so it should be straight forward to undef it after it is used to prevent it from leaking (PR coming up).
CPython versions tested on:
3.10, 3.12, 3.13
Operating systems tested on:
Linux, macOS
Linked PRs
The text was updated successfully, but these errors were encountered: