Skip to content

gh-151126: Fix crash on unset memory error in ctypes.get_errno#151382

Merged
sobolevn merged 1 commit into
python:mainfrom
sobolevn:issue-151126-ctypes
Jun 12, 2026
Merged

gh-151126: Fix crash on unset memory error in ctypes.get_errno#151382
sobolevn merged 1 commit into
python:mainfrom
sobolevn:issue-151126-ctypes

Conversation

@sobolevn

@sobolevn sobolevn commented Jun 11, 2026

Copy link
Copy Markdown
Member

@sobolevn sobolevn merged commit 6b217ea into python:main Jun 12, 2026
66 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Jun 12, 2026

Copy link
Copy Markdown

GH-151398 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jun 12, 2026
@bedevere-app

bedevere-app Bot commented Jun 12, 2026

Copy link
Copy Markdown

GH-151399 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jun 12, 2026
@bedevere-app

bedevere-app Bot commented Jun 12, 2026

Copy link
Copy Markdown

GH-151400 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Jun 12, 2026
sobolevn added a commit that referenced this pull request Jun 12, 2026
…o` (GH-151382) (#151400)

gh-151126: Fix crash on unset memory error in `ctypes.get_errno` (GH-151382)
(cherry picked from commit 6b217ea)

Co-authored-by: sobolevn <mail@sobolevn.me>
sobolevn added a commit that referenced this pull request Jun 12, 2026
…o` (GH-151382) (#151399)

gh-151126: Fix crash on unset memory error in `ctypes.get_errno` (GH-151382)
(cherry picked from commit 6b217ea)

Co-authored-by: sobolevn <mail@sobolevn.me>
sobolevn added a commit that referenced this pull request Jun 12, 2026
…o` (GH-151382) (#151398)

gh-151126: Fix crash on unset memory error in `ctypes.get_errno` (GH-151382)
(cherry picked from commit 6b217ea)

Co-authored-by: sobolevn <mail@sobolevn.me>
@bedevere-bot

Copy link
Copy Markdown

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

Hi! The buildbot aarch64 Fedora Stable LTO + PGO 3.13 (tier-2) has failed when building commit 7c3f0bd.

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/1433/builds/1125) and take a look at the build logs.
  4. Check if the failure is related to this commit (7c3f0bd) 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/1433/builds/1125

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

Click to see traceback logs
Previous HEAD position was 8754abc358a [3.13] gh-151065: Copy fix for memory leak from mimalloc upstream (GH-151066) (GH-151385)
HEAD is now at 7c3f0bd9b0e [3.13] gh-151126: Fix crash on unset memory error in `ctypes.get_errno` (GH-151382) (#151400)
Switched to and reset branch '3.13'

find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
make[2]: [Makefile:3126: clean-retain-profile] Error 1 (ignored)
In function ‘hashtable_key_from_2_strings’,
    inlined from ‘_extensions_cache_find_unlocked’ at Python/import.c:1284:17:
Python/import.c:1197:5: warning: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
 1197 |     strncpy(key, str1_data, str1_len);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Python/import.c:1183:27: note: length computed here
 1183 |     Py_ssize_t str1_len = strlen(str1_data);
      |                           ^~~~~~~~~~~~~~~~~
./Modules/socketmodule.c: In function ‘getsockaddrarg’:
./Modules/socketmodule.c:2518:9: warning: ‘strncpy’ specified bound 64 equals destination size [-Wstringop-truncation]
 2518 |         strncpy((char *)sa->salg_name, name, sizeof(sa->salg_name));
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ar: unable to copy file 'libpython3.13.a'; reason: No space left on device
make[2]: *** [Makefile:1061: libpython3.13.a] Error 1
make[1]: *** [Makefile:891: profile-gen-stamp] Error 2
make: *** [Makefile:903: profile-run-stamp] Error 2

@bedevere-bot

Copy link
Copy Markdown

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

Hi! The buildbot aarch64 Fedora Stable 3.14 (tier-2) has failed when building commit ab63a5a.

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/1750/builds/607) and take a look at the build logs.
  4. Check if the failure is related to this commit (ab63a5a) 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/1750/builds/607

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

Click to see traceback logs
Note: switching to 'ab63a5a510931e9d12eb67ca4d913be2be105ab2'.

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 ab63a5a510931 [3.14] gh-151126: Fix crash on unset memory error in `ctypes.get_errno` (GH-151382) (#151399)
Switched to and reset branch '3.14'

/usr/bin/ld: final link failed: No space left on device
collect2: error: ld returned 1 exit status
make: *** [Makefile:1181: libpython3.14d.so] Error 1

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants