Skip to content

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchakaserhiy-storchaka commented Feb 24, 2025

The use of PySys_GetObject() and _PySys_GetAttr(), which return a borrowed reference, has been replaced by using one of the following functions, which return a strong reference and distinguish a missing attribute from an error: _PySys_GetOptionalAttr(), _PySys_GetOptionalAttrString(), _PySys_GetRequiredAttr(), and _PySys_GetRequiredAttrString().

This PR is written in a form that will minimized the diff for #111035 or #129736 and minimize future difference between main and other branches.

… free-threaded build The use of PySys_GetObject() and _PySys_GetAttr(), which return a borrowed reference, has been replaced by using one of the following functions, which return a strong reference and distinguish a missing attribute from an error: _PySys_GetOptionalAttr(), _PySys_GetOptionalAttrString(), _PySys_GetRequiredAttr(), and _PySys_GetRequiredAttrString().
@serhiy-storchakaserhiy-storchaka added 🔨 test-with-buildbots Test PR w/ buildbots; report in status section and removed 🔨 test-with-buildbots Test PR w/ buildbots; report in status section labels Feb 24, 2025
@serhiy-storchakaserhiy-storchaka changed the title gh-108512: Fix possible crashes related to PySys_GetObject() in free-threaded buildgh-130163: Fix possible crashes related to PySys_GetObject() in free-threaded buildFeb 25, 2025
@serhiy-storchakaserhiy-storchaka removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Feb 25, 2025
@serhiy-storchakaserhiy-storchaka changed the title gh-130163: Fix possible crashes related to PySys_GetObject() in free-threaded buildgh-130163: Fix possible crashes related to PySys_GetObject()Feb 25, 2025
@serhiy-storchakaserhiy-storchaka merged commit 0ef4ffe into python:mainFeb 25, 2025
47 checks passed
@miss-islington-app
Copy link

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 0ef4ffeefd1737c18dc9326133c7894d58108c2e 3.13 

@serhiy-storchakaserhiy-storchaka deleted the capi-PySys_GetAttr3 branch February 25, 2025 21:04
@miss-islington-app
Copy link

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 0ef4ffeefd1737c18dc9326133c7894d58108c2e 3.12 

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Feb 25, 2025
…honGH-130503) The use of PySys_GetObject() and _PySys_GetAttr(), which return a borrowed reference, has been replaced by using one of the following functions, which return a strong reference and distinguish a missing attribute from an error: _PySys_GetOptionalAttr(), _PySys_GetOptionalAttrString(), _PySys_GetRequiredAttr(), and _PySys_GetRequiredAttrString(). (cherry picked from commit 0ef4ffe) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-app
Copy link

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

@bedevere-appbedevere-appbot removed the needs backport to 3.13 bugs and security fixes label Feb 25, 2025
@serhiy-storchakaserhiy-storchaka removed the needs backport to 3.12 only security fixes label Feb 25, 2025
serhiy-storchaka added a commit that referenced this pull request Feb 25, 2025
GH-130556) The use of PySys_GetObject() and _PySys_GetAttr(), which return a borrowed reference, has been replaced by using one of the following functions, which return a strong reference and distinguish a missing attribute from an error: _PySys_GetOptionalAttr(), _PySys_GetOptionalAttrString(), _PySys_GetRequiredAttr(), and _PySys_GetRequiredAttrString(). (cherry picked from commit 0ef4ffe)
@bedevere-bot
Copy link

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

Hi! The buildbot aarch64 Fedora Stable LTO + PGO 3.13 has failed when building commit 7c1b76f.

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

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

==

Click to see traceback logs
Traceback (most recent call last): File "/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.lto-pgo/build/Lib/threading.py", line 1041, in _bootstrap_innerself.run() ~~~~~~~~^^ File "/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.lto-pgo/build/Lib/threading.py", line 992, in runself._target(*self._args, **self._kwargs) ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.lto-pgo/build/Lib/test/test_interpreters/test_stress.py", line 47, in run interp = interpreters.create() File "/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.lto-pgo/build/Lib/test/support/interpreters/__init__.py", line 76, in createid= _interpreters.create(reqrefs=True) interpreters.InterpreterError: interpreter creation failed k 

@bedevere-bot
Copy link

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

Hi! The buildbot aarch64 RHEL8 Refleaks 3.13 has failed when building commit 7c1b76f.

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

Failed tests:

  • test_genericalias
  • test_ast
  • test_typing

Test leaking resources:

  • test_typing: references
  • test_ast: references
  • test_genericalias: references

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

==

Click to see traceback logs
remote: Enumerating objects: 36, done. remote: Counting objects: 2% (1/34) remote: Counting objects: 5% (2/34) remote: Counting objects: 8% (3/34) remote: Counting objects: 11% (4/34) remote: Counting objects: 14% (5/34) remote: Counting objects: 17% (6/34) remote: Counting objects: 20% (7/34) remote: Counting objects: 23% (8/34) remote: Counting objects: 26% (9/34) remote: Counting objects: 29% (10/34) remote: Counting objects: 32% (11/34) remote: Counting objects: 35% (12/34) remote: Counting objects: 38% (13/34) remote: Counting objects: 41% (14/34) remote: Counting objects: 44% (15/34) remote: Counting objects: 47% (16/34) remote: Counting objects: 50% (17/34) remote: Counting objects: 52% (18/34) remote: Counting objects: 55% (19/34) remote: Counting objects: 58% (20/34) remote: Counting objects: 61% (21/34) remote: Counting objects: 64% (22/34) remote: Counting objects: 67% (23/34) remote: Counting objects: 70% (24/34) remote: Counting objects: 73% (25/34) remote: Counting objects: 76% (26/34) remote: Counting objects: 79% (27/34) remote: Counting objects: 82% (28/34) remote: Counting objects: 85% (29/34) remote: Counting objects: 88% (30/34) remote: Counting objects: 91% (31/34) remote: Counting objects: 94% (32/34) remote: Counting objects: 97% (33/34) remote: Counting objects: 100% (34/34) remote: Counting objects: 100% (34/34), 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 36 (delta 27), reused 27 (delta 27), pack-reused 2 (from 2)  From https://github.com/python/cpython * branch 3.13 -> FETCH_HEAD Note: switching to '7c1b76fce8c8df00da38830f72dbdde6881a33be'. 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 7c1b76fce8c [3.13] gh-130163: Fix crashes related to PySys_GetObject() (GH-130503) (GH-130556) Switched to and reset branch '3.13' make: *** [Makefile:2246: buildbottest] Error 2

@bedevere-bot
Copy link

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

Hi! The buildbot s390x RHEL8 Refleaks 3.13 has failed when building commit 7c1b76f.

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

Failed tests:

  • test_genericalias
  • test_ast
  • test_pickletools
  • test_typing

Test leaking resources:

  • test_typing: references
  • test_pickletools: references
  • test_ast: references
  • test_genericalias: references
  • test_pickletools: memory blocks

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

==

Click to see traceback logs
remote: Enumerating objects: 36, done. remote: Counting objects: 2% (1/34) remote: Counting objects: 5% (2/34) remote: Counting objects: 8% (3/34) remote: Counting objects: 11% (4/34) remote: Counting objects: 14% (5/34) remote: Counting objects: 17% (6/34) remote: Counting objects: 20% (7/34) remote: Counting objects: 23% (8/34) remote: Counting objects: 26% (9/34) remote: Counting objects: 29% (10/34) remote: Counting objects: 32% (11/34) remote: Counting objects: 35% (12/34) remote: Counting objects: 38% (13/34) remote: Counting objects: 41% (14/34) remote: Counting objects: 44% (15/34) remote: Counting objects: 47% (16/34) remote: Counting objects: 50% (17/34) remote: Counting objects: 52% (18/34) remote: Counting objects: 55% (19/34) remote: Counting objects: 58% (20/34) remote: Counting objects: 61% (21/34) remote: Counting objects: 64% (22/34) remote: Counting objects: 67% (23/34) remote: Counting objects: 70% (24/34) remote: Counting objects: 73% (25/34) remote: Counting objects: 76% (26/34) remote: Counting objects: 79% (27/34) remote: Counting objects: 82% (28/34) remote: Counting objects: 85% (29/34) remote: Counting objects: 88% (30/34) remote: Counting objects: 91% (31/34) remote: Counting objects: 94% (32/34) remote: Counting objects: 97% (33/34) remote: Counting objects: 100% (34/34) remote: Counting objects: 100% (34/34), 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 36 (delta 27), reused 27 (delta 27), pack-reused 2 (from 2)  From https://github.com/python/cpython * branch 3.13 -> FETCH_HEAD Note: switching to '7c1b76fce8c8df00da38830f72dbdde6881a33be'. 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 7c1b76fce8c [3.13] gh-130163: Fix crashes related to PySys_GetObject() (GH-130503) (GH-130556) Switched to and reset branch '3.13' configure: WARNING: no system libmpdecimal found; falling back to bundled libmpdecimal (deprecated and scheduled for removal in Python 3.15)make: *** [Makefile:2246: buildbottest] Error 2

@bedevere-bot
Copy link

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

Hi! The buildbot s390x RHEL9 Refleaks 3.13 has failed when building commit 7c1b76f.

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

Failed tests:

  • test_genericalias
  • test_ast
  • test_typing

Test leaking resources:

  • test_typing: references
  • test_ast: references
  • test_genericalias: references

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

==

Click to see traceback logs
remote: Enumerating objects: 36, done. remote: Counting objects: 2% (1/34) remote: Counting objects: 5% (2/34) remote: Counting objects: 8% (3/34) remote: Counting objects: 11% (4/34) remote: Counting objects: 14% (5/34) remote: Counting objects: 17% (6/34) remote: Counting objects: 20% (7/34) remote: Counting objects: 23% (8/34) remote: Counting objects: 26% (9/34) remote: Counting objects: 29% (10/34) remote: Counting objects: 32% (11/34) remote: Counting objects: 35% (12/34) remote: Counting objects: 38% (13/34) remote: Counting objects: 41% (14/34) remote: Counting objects: 44% (15/34) remote: Counting objects: 47% (16/34) remote: Counting objects: 50% (17/34) remote: Counting objects: 52% (18/34) remote: Counting objects: 55% (19/34) remote: Counting objects: 58% (20/34) remote: Counting objects: 61% (21/34) remote: Counting objects: 64% (22/34) remote: Counting objects: 67% (23/34) remote: Counting objects: 70% (24/34) remote: Counting objects: 73% (25/34) remote: Counting objects: 76% (26/34) remote: Counting objects: 79% (27/34) remote: Counting objects: 82% (28/34) remote: Counting objects: 85% (29/34) remote: Counting objects: 88% (30/34) remote: Counting objects: 91% (31/34) remote: Counting objects: 94% (32/34) remote: Counting objects: 97% (33/34) remote: Counting objects: 100% (34/34) remote: Counting objects: 100% (34/34), 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 36 (delta 27), reused 27 (delta 27), pack-reused 2 (from 2)  From https://github.com/python/cpython * branch 3.13 -> FETCH_HEAD Note: switching to '7c1b76fce8c8df00da38830f72dbdde6881a33be'. 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 7c1b76fce8c [3.13] gh-130163: Fix crashes related to PySys_GetObject() (GH-130503) (GH-130556) Switched to and reset branch '3.13' make: *** [Makefile:2246: buildbottest] Error 2

@bedevere-bot
Copy link

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

Hi! The buildbot AMD64 RHEL8 Refleaks 3.13 has failed when building commit 7c1b76f.

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

Failed tests:

  • test_genericalias
  • test_ast
  • test_typing

Test leaking resources:

  • test_ast: memory blocks
  • test_typing: references
  • test_ast: references
  • test_genericalias: references

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

==

Click to see traceback logs
remote: Enumerating objects: 36, done. remote: Counting objects: 2% (1/34) remote: Counting objects: 5% (2/34) remote: Counting objects: 8% (3/34) remote: Counting objects: 11% (4/34) remote: Counting objects: 14% (5/34) remote: Counting objects: 17% (6/34) remote: Counting objects: 20% (7/34) remote: Counting objects: 23% (8/34) remote: Counting objects: 26% (9/34) remote: Counting objects: 29% (10/34) remote: Counting objects: 32% (11/34) remote: Counting objects: 35% (12/34) remote: Counting objects: 38% (13/34) remote: Counting objects: 41% (14/34) remote: Counting objects: 44% (15/34) remote: Counting objects: 47% (16/34) remote: Counting objects: 50% (17/34) remote: Counting objects: 52% (18/34) remote: Counting objects: 55% (19/34) remote: Counting objects: 58% (20/34) remote: Counting objects: 61% (21/34) remote: Counting objects: 64% (22/34) remote: Counting objects: 67% (23/34) remote: Counting objects: 70% (24/34) remote: Counting objects: 73% (25/34) remote: Counting objects: 76% (26/34) remote: Counting objects: 79% (27/34) remote: Counting objects: 82% (28/34) remote: Counting objects: 85% (29/34) remote: Counting objects: 88% (30/34) remote: Counting objects: 91% (31/34) remote: Counting objects: 94% (32/34) remote: Counting objects: 97% (33/34) remote: Counting objects: 100% (34/34) remote: Counting objects: 100% (34/34), 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 36 (delta 27), reused 27 (delta 27), pack-reused 2 (from 2)  From https://github.com/python/cpython * branch 3.13 -> FETCH_HEAD Note: switching to '7c1b76fce8c8df00da38830f72dbdde6881a33be'. 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 7c1b76fce8c [3.13] gh-130163: Fix crashes related to PySys_GetObject() (GH-130503) (GH-130556) Switched to and reset branch '3.13' configure: WARNING: no system libmpdecimal found; falling back to bundled libmpdecimal (deprecated and scheduled for removal in Python 3.15)make: *** [Makefile:2246: buildbottest] Error 2

@bedevere-bot
Copy link

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

Hi! The buildbot aarch64 Fedora Stable Refleaks 3.13 has failed when building commit 7c1b76f.

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

Failed tests:

  • test_pickle
  • test_ast
  • test_typing
  • test_genericalias
  • test_import

Test leaking resources:

  • test_typing: references
  • test_import: memory blocks
  • test_ast: references
  • test_pickle: memory blocks
  • test_genericalias: references
  • test_import: references
  • test_pickle: references

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

==

Click to see traceback logs
TracebackTests.test_exec_failure_nested) ... ok TracebackTests.test_broken_parent) ... ok TracebackTests.test_import_bug) ... ok TracebackTests.test_nonexistent_module) ... ok TracebackTests.test_syntax_error) ... ok TracebackTests.test_exec_failure) ... ok TracebackTests.test_broken_submodule) ... ok TracebackTests.test_unencodable_filename) ... ok TracebackTests.test_nonexistent_module_nested) ... ok TracebackTests.test_broken_parent_from) ... ok TracebackTests.test_broken_from) ... ok 

@bedevere-bot
Copy link

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

Hi! The buildbot AMD64 FreeBSD Refleaks 3.13 has failed when building commit 7c1b76f.

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

Failed tests:

  • test_genericalias
  • test_pickle
  • test_ast
  • test_typing

Test leaking resources:

  • test_typing: references
  • test_ast: references
  • test_pickle: memory blocks
  • test_genericalias: references
  • test_pickle: references

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

==

Click to see traceback logs
remote: Enumerating objects: 36, done. remote: Counting objects: 2% (1/34) remote: Counting objects: 5% (2/34) remote: Counting objects: 8% (3/34) remote: Counting objects: 11% (4/34) remote: Counting objects: 14% (5/34) remote: Counting objects: 17% (6/34) remote: Counting objects: 20% (7/34) remote: Counting objects: 23% (8/34) remote: Counting objects: 26% (9/34) remote: Counting objects: 29% (10/34) remote: Counting objects: 32% (11/34) remote: Counting objects: 35% (12/34) remote: Counting objects: 38% (13/34) remote: Counting objects: 41% (14/34) remote: Counting objects: 44% (15/34) remote: Counting objects: 47% (16/34) remote: Counting objects: 50% (17/34) remote: Counting objects: 52% (18/34) remote: Counting objects: 55% (19/34) remote: Counting objects: 58% (20/34) remote: Counting objects: 61% (21/34) remote: Counting objects: 64% (22/34) remote: Counting objects: 67% (23/34) remote: Counting objects: 70% (24/34) remote: Counting objects: 73% (25/34) remote: Counting objects: 76% (26/34) remote: Counting objects: 79% (27/34) remote: Counting objects: 82% (28/34) remote: Counting objects: 85% (29/34) remote: Counting objects: 88% (30/34) remote: Counting objects: 91% (31/34) remote: Counting objects: 94% (32/34) remote: Counting objects: 97% (33/34) remote: Counting objects: 100% (34/34) remote: Counting objects: 100% (34/34), 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 36 (delta 27), reused 27 (delta 27), pack-reused 2 (from 2)  From https://github.com/python/cpython * branch 3.13 -> FETCH_HEAD Note: switching to '7c1b76fce8c8df00da38830f72dbdde6881a33be'. 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 7c1b76fce8c [3.13] gh-130163: Fix crashes related to PySys_GetObject() (GH-130503) (GH-130556) Switched to and reset branch '3.13'

@bedevere-bot
Copy link

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

Hi! The buildbot AMD64 Fedora Stable Refleaks 3.13 has failed when building commit 7c1b76f.

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

Failed tests:

  • test_genericalias
  • test_ast
  • test_pickletools
  • test_typing

Test leaking resources:

  • test_typing: references
  • test_pickletools: references
  • test_ast: references
  • test_genericalias: references
  • test_pickletools: memory blocks

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

==

Click to see traceback logs
remote: Enumerating objects: 36, done. remote: Counting objects: 2% (1/34) remote: Counting objects: 5% (2/34) remote: Counting objects: 8% (3/34) remote: Counting objects: 11% (4/34) remote: Counting objects: 14% (5/34) remote: Counting objects: 17% (6/34) remote: Counting objects: 20% (7/34) remote: Counting objects: 23% (8/34) remote: Counting objects: 26% (9/34) remote: Counting objects: 29% (10/34) remote: Counting objects: 32% (11/34) remote: Counting objects: 35% (12/34) remote: Counting objects: 38% (13/34) remote: Counting objects: 41% (14/34) remote: Counting objects: 44% (15/34) remote: Counting objects: 47% (16/34) remote: Counting objects: 50% (17/34) remote: Counting objects: 52% (18/34) remote: Counting objects: 55% (19/34) remote: Counting objects: 58% (20/34) remote: Counting objects: 61% (21/34) remote: Counting objects: 64% (22/34) remote: Counting objects: 67% (23/34) remote: Counting objects: 70% (24/34) remote: Counting objects: 73% (25/34) remote: Counting objects: 76% (26/34) remote: Counting objects: 79% (27/34) remote: Counting objects: 82% (28/34) remote: Counting objects: 85% (29/34) remote: Counting objects: 88% (30/34) remote: Counting objects: 91% (31/34) remote: Counting objects: 94% (32/34) remote: Counting objects: 97% (33/34) remote: Counting objects: 100% (34/34) remote: Counting objects: 100% (34/34), 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 36 (delta 27), reused 27 (delta 27), pack-reused 2 (from 2)  From https://github.com/python/cpython * branch 3.13 -> FETCH_HEAD Note: switching to '7c1b76fce8c8df00da38830f72dbdde6881a33be'. 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 7c1b76fce8c [3.13] gh-130163: Fix crashes related to PySys_GetObject() (GH-130503) (GH-130556) Switched to and reset branch '3.13' configure: WARNING: no system libmpdecimal found; falling back to bundled libmpdecimal (deprecated and scheduled for removal in Python 3.15)make: *** [Makefile:2246: buildbottest] Error 2

@bedevere-bot
Copy link

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

Hi! The buildbot PPC64LE Fedora Stable Refleaks 3.13 has failed when building commit 7c1b76f.

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

Failed tests:

  • test_genericalias
  • test_pickle
  • test_ast
  • test_typing

Test leaking resources:

  • test_typing: references
  • test_ast: references
  • test_pickle: memory blocks
  • test_genericalias: references
  • test_pickle: references

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

==

Click to see traceback logs
Note: switching to '7c1b76fce8c8df00da38830f72dbdde6881a33be'. 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 7c1b76fce8c [3.13] gh-130163: Fix crashes related to PySys_GetObject() (GH-130503) (GH-130556) Switched to and reset branch '3.13' configure: WARNING: no system libmpdecimal found; falling back to bundled libmpdecimal (deprecated and scheduled for removal in Python 3.15)make: *** [Makefile:2246: buildbottest] Error 2

@bedevere-bot
Copy link

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

Hi! The buildbot AMD64 Windows11 Refleaks 3.13 has failed when building commit 7c1b76f.

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

Failed tests:

  • test_genericalias
  • test_ast
  • test_typing

Failed subtests:

  • test_finalize_with_trace - test.test_threading.ThreadTests.test_finalize_with_trace

Test leaking resources:

  • test_typing: references
  • test_ast: references
  • test_genericalias: references

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

==

Click to see traceback logs
Traceback (most recent call last): File "b:\uildarea\3.13.ware-win11.refleak\build\Lib\test\test_threading.py", line 470, in test_finalize_with_trace assert_python_ok("-c", """if 1:~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^import sys, threading ^^^^^^^^^^^^^^^^^^^^^...<17 lines>... sys.settrace(func) ^^^^^^^^^^^^^^^^^^""")^^^^ File "b:\uildarea\3.13.ware-win11.refleak\build\Lib\test\support\script_helper.py", line 180, in assert_python_okreturn _assert_python(True, *args, **env_vars) File "b:\uildarea\3.13.ware-win11.refleak\build\Lib\test\support\script_helper.py", line 165, in _assert_python res.fail(cmd_line) ~~~~~~~~^^^^^^^^^^ File "b:\uildarea\3.13.ware-win11.refleak\build\Lib\test\support\script_helper.py", line 75, in failraiseAssertionError("Process return code is %d\n"...<13 lines>... err)) AssertionError: Process return code is 3221225477 command line: ['b:\\uildarea\\3.13.ware-win11.refleak\\build\\PCbuild\\amd64\\python_d.exe', '-X', 'faulthandler', '-I', '-c', "if 1:\n import sys, threading\n\n # A deadlock-killer, to prevent the\n # testsuite to hang forever\n def killer():\n import os, time\n time.sleep(2)\n print('program blocked; aborting')\n os._exit(2)\n t = threading.Thread(target=killer)\n t.daemon = True\n t.start()\n\n # This is the trace function\n def func(frame, event, arg):\n threading.current_thread()\n return func\n\n sys.settrace(func)\n "] 

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Feb 26, 2025
…honGH-130503) (pythonGH-130556) The use of PySys_GetObject() and _PySys_GetAttr(), which return a borrowed reference, has been replaced by using one of the following functions, which return a strong reference and distinguish a missing attribute from an error: _PySys_GetOptionalAttr(), _PySys_GetOptionalAttrString(), _PySys_GetRequiredAttr(), and _PySys_GetRequiredAttrString(). (cherry picked from commit 0ef4ffe) (cherry picked from commit 7c1b76f) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this pull request Feb 26, 2025
GH-130556) (GH-130576) The use of PySys_GetObject() and _PySys_GetAttr(), which return a borrowed reference, has been replaced by using one of the following functions, which return a strong reference and distinguish a missing attribute from an error: _PySys_GetOptionalAttr(), _PySys_GetOptionalAttrString(), _PySys_GetRequiredAttr(), and _PySys_GetRequiredAttrString(). (cherry picked from commit 0ef4ffe) (cherry picked from commit 7c1b76f) (cherry picked from commit 2ab7e11)
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic-free-threadingtype-crashA hard crash of the interpreter, possibly with a core dump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@serhiy-storchaka@bedevere-bot