Fix python3.12 on ubuntu x86-64#284
Conversation
|
Hey @gnurizen 👋 The commit I authored in DataDog@630fd97 unfortunately doesn't fully fix #251. I think we should consider the alternative described in:
So we better cover all the edge cases discussed in that issue (didn't get around to implementing this yet though). Additionally, as far as I can tell, the packaged python in ubuntu is compiled with |
|
Maybe it would still make sense to update this branch merge it until someone finds the time to look into the concerns raised by @Gandem above, turning them into an issue to be addressed later? The proposed patch certainly improves things already compared to present state on |
|
There's an open issue in #251 (comment) My understanding is that the issue fixed by this change only impacts python 3.12 when it's compiled without LTO and without optimizations (which is not the case for most distributions of python), and the fix should only work for that very specific edge case. @athre0z Do you have more information on how you were able to reproduce this? I'm definitely onboard with getting this merged independently of the longer term fix, especially if this is indeed impacting python 3.12 more generally. |
Upon further digging, the stock python 3.12 works fine, the code extracts the autoTLSKey from the first arg to PyThread_tss_is_created just fine. I'm not sure what I thought I was fixing with this patch, it might have been the python 3.12 docker images and not the ubuntu package. |
|
I've also confirmed that as @Gandem says in the bug the workaround fails for bundled python in the google-cloud-sdk so this isn't a complete solution. |
Fix from: DataDog@630fd97 This error occurs on stock python 3.12 on ubuntu x86-64.
There's a ton of variety in how these functions get compiled on amd64 with inlining and other optimizations. Fall back to what appear to be relatively stable hard coded offsets for the autoTLSkey on amd64.
|
I've submitted an alternative draft for proposal B described in the tracking issue, PTAL |
I'm not entirely sure, to be honest. I know that the patch has significantly reduced the number of errors about autoTLSkey not being found on my machine in the past, and I had a
Yeah, that much I can confirm -- had the same failure for the GCP SDK on my box even with this patch. |
Fix from: DataDog@630fd97
This error occurs on stock python 3.12 on ubuntu x86-64.
Fixes issue: #251