Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-91048: Prevent optimizing away the asyncio debug offsets structure on Windows#132963
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…ucture on WindowsTo avoid having the debug sections being optimised away by the compilerwe use __attribute__((used)) on gcc and clang but in Windows this isnot supported by the Microsoft compiler and there is no equivalent flag.Unfortunately Windows offers almost no alternative other than exportingthe symbol in the dynamic table or using it somehow.
Sorry can't test this out right now, but does |
pablogsal commentedApr 25, 2025 • 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.
Check the commit message: we don't want to export the symbol in the dynamic table. This is basically the less intrusive option Windows offers. |
Uh oh!
There was an error while loading.Please reload this page.
Just for completeness, we also get an error if we try to add
we could have it as an option only for shared modules but then we need to deal with this other error:
|
I also tried doing this but doesn't work:
|
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
a5e628b
intopython:mainUh oh!
There was an error while loading.Please reload this page.
@@ -185,6 +185,10 @@ typedef struct { | |||
/* Counter for autogenerated Task names */ | |||
uint64_t task_name_counter; | |||
/* Pointer to the asyncio debug offset to avoid it to be optimized away | |||
by the compiler */ | |||
void *debug_offsets; |
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.
Then we'd even do not need the__attribute__((used))
any longer in theGENERATE_DEBUG_SECTION
macros.
But it doesn't hurt either - so let's keep it?
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.
Yeah I still prefer to keep it
Uh oh!
There was an error while loading.Please reload this page.
To avoid having the debug sections being optimised away by the compiler we useattribute((used)) on gcc and clang but in Windows this is not supported by the Microsoft compiler and there is no equivalent flag. Unfortunately Windows offers almost no alternative other than exporting the symbol in the dynamic table or using it somehow.