Skip to content

gh-130317: Fix strict aliasing in PyFloat_Pack8() #133150

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

Merged
merged 2 commits into from
Apr 29, 2025

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Apr 29, 2025

  • Fix strict aliasing in PyFloat_Pack8() and PyFloat_Pack4()
  • Fix _testcapi.float_set_snan() on x86 (32-bit).

* Fix strict aliasing in PyFloat_Pack8() and PyFloat_Pack4()
* Fix _testcapi.float_set_snan() on x86 (32-bit).
@vstinner vstinner enabled auto-merge (squash) April 29, 2025 13:43
@skirpichev skirpichev self-requested a review April 29, 2025 13:58
@vstinner vstinner merged commit 02cd6d7 into python:main Apr 29, 2025
41 checks passed
@vstinner vstinner deleted the float_pack8 branch April 29, 2025 14:27
@vstinner
Copy link
Member Author

vstinner commented Apr 29, 2025

@skirpichev skirpichev self-requested a review

Sorry, I merged quickly my PR since I would like to fix the buildbots ASAP. Your (post-merge) review would still be welcomed :-)

@vstinner
Copy link
Member Author

Follow-up: #133155 to fix the test.

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot aarch64 Android 3.x (tier-3) has failed when building commit 02cd6d7.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1594/builds/2145) and take a look at the build logs.
  4. Check if the failure is related to this commit (02cd6d7) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1594/builds/2145

Summary of the results of the build (if available):

Click to see traceback logs
remote: Enumerating objects: 13, done.        
remote: Counting objects:   7% (1/13)        
remote: Counting objects:  15% (2/13)        
remote: Counting objects:  23% (3/13)        
remote: Counting objects:  30% (4/13)        
remote: Counting objects:  38% (5/13)        
remote: Counting objects:  46% (6/13)        
remote: Counting objects:  53% (7/13)        
remote: Counting objects:  61% (8/13)        
remote: Counting objects:  69% (9/13)        
remote: Counting objects:  76% (10/13)        
remote: Counting objects:  84% (11/13)        
remote: Counting objects:  92% (12/13)        
remote: Counting objects: 100% (13/13)        
remote: Counting objects: 100% (13/13), done.        
remote: Compressing objects:  14% (1/7)        
remote: Compressing objects:  28% (2/7)        
remote: Compressing objects:  42% (3/7)        
remote: Compressing objects:  57% (4/7)        
remote: Compressing objects:  71% (5/7)        
remote: Compressing objects:  85% (6/7)        
remote: Compressing objects: 100% (7/7)        
remote: Compressing objects: 100% (7/7), done.        
remote: Total 7 (delta 6), reused 0 (delta 0), pack-reused 0 (from 0)        
From https://github.com/python/cpython
 * branch                    main       -> FETCH_HEAD
Note: switching to '02cd6d709709e28c7a8fa62ce3620ea000b524d3'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 02cd6d70970 gh-130317: Fix strict aliasing in PyFloat_Pack8() (#133150)
Switched to and reset branch 'main'

configure: WARNING: no system libmpdecimal found; falling back to bundled libmpdecimal (deprecated and scheduled for removal in Python 3.15)
configure: WARNING: pkg-config is missing. Some dependencies may not be detected correctly.

In file included from ../../Python/ceval.c:1097:
../../Python/generated_cases.c.h:12162:13: warning: code will never be executed [-Wunreachable-code]
 12162 |             stack_pointer -= 3;
       |             ^~~~~~~~~~~~~
../../Python/generated_cases.c.h:12155:13: warning: code will never be executed [-Wunreachable-code]
 12155 |             stack_pointer -= 4;
       |             ^~~~~~~~~~~~~
../../Python/generated_cases.c.h:7467:13: warning: code will never be executed [-Wunreachable-code]
 7467 |             stack_pointer += -1;
      |             ^~~~~~~~~~~~~
3 warnings generated.
ld: warning: ignoring duplicate libraries: '-ldl'
ld: warning: ignoring duplicate libraries: '-ldl'
ld: warning: ignoring duplicate libraries: '-ldl'
ld: warning: ignoring duplicate libraries: '-ldl'
ld: warning: ignoring duplicate libraries: '-ldl'
ld: warning: ignoring duplicate libraries: '-ldl'

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

100  192k  100  192k    0     0  1121k      0 --:--:-- --:--:-- --:--:-- 1121k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

100 42455  100 42455    0     0   350k      0 --:--:-- --:--:-- --:--:--  350k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 5041k  100 5041k    0     0  27.8M      0 --:--:-- --:--:-- --:--:-- 61.5M
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

100 1252k  100 1252k    0     0  6304k      0 --:--:-- --:--:-- --:--:-- 6304k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

100  635k  100  635k    0     0  3838k      0 --:--:-- --:--:-- --:--:-- 3838k
../../configure: line 4061: pkg-config: command not found
configure: WARNING: no system libmpdecimal found; falling back to bundled libmpdecimal (deprecated and scheduled for removal in Python 3.15)
configure: WARNING: pkg-config is missing. Some dependencies may not be detected correctly.

In file included from ../../Python/ceval.c:1097:
../../Python/generated_cases.c.h:12162:13: warning: code will never be executed [-Wunreachable-code]
 12162 |             stack_pointer -= 3;
       |             ^~~~~~~~~~~~~
../../Python/generated_cases.c.h:12155:13: warning: code will never be executed [-Wunreachable-code]
 12155 |             stack_pointer -= 4;
       |             ^~~~~~~~~~~~~
../../Python/generated_cases.c.h:7467:13: warning: code will never be executed [-Wunreachable-code]
 7467 |             stack_pointer += -1;
      |             ^~~~~~~~~~~~~
../../Python/fileutils.c:460:1: warning: unused function 'decode_current_locale' [-Wunused-function]
  460 | decode_current_locale(const char* arg, wchar_t **wstr, size_t *wlen,
      | ^~~~~~~~~~~~~~~~~~~~~
../../Python/fileutils.c:679:1: warning: unused function 'encode_current_locale' [-Wunused-function]
  679 | encode_current_locale(const wchar_t *text, char **str,
      | ^~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
3 warnings generated.
../../Modules/_localemodule.c:148:1: warning: unused function 'is_all_ascii' [-Wunused-function]
  148 | is_all_ascii(const char *str)
      | ^~~~~~~~~~~~
1 warning generated.
../../Modules/_hacl/Lib_Memzero0.c:52:6: warning: "Your platform does not support any safe implementation of memzero -- consider a pull request!" [-W#warnings]
   52 |     #warning "Your platform does not support any safe implementation of memzero -- consider a pull request!"
      |      ^
../../Modules/_hacl/Lib_Memzero0.c:40:10: warning: unused variable 'len_' [-Wunused-variable]
   40 |   size_t len_ = (size_t) len;
      |          ^~~~
2 warnings generated.

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  8784  100  8784    0     0   123k      0 --:--:-- --:--:-- --:--:--  124k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  2894  100  2894    0     0   5824      0 --:--:-- --:--:-- --:--:--  5834
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (56) The requested URL returned error: 429

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants