GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-107954, PEP 741: Add PyConfig_Get() function by vstinner · Pull Request #123472 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Aug 29, 2024 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Add PyConfig_Get(), PyConfig_GetInt(), PyConfig_Set() and PyConfig_Names() functions to get and set the current runtime Python configuration.

_PyConfig_AsDict() now converts PyConfig.xoptions as a dictionary.

  • Issue: [C API] PEP 741: Add PyInitConfig C API to customize the Python initialization #107954

📚 Documentation preview 📚: https://cpython-previews--123472.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vstinner
pythongh-107954, PEP 741: Add PyConfig_Get() function
4c79a52
Add PyConfig_Get(), PyConfig_GetInt(), PyConfig_Set() and
PyConfig_Names() functions to get and set the current runtime Python
configuration.

_PyConfig_AsDict() now converts PyConfig.xoptions as a dictionary.
@vstinner
vstinner requested review from a team, ericsnowcurrently and erlend-aasland as code owners August 29, 2024 14:25
@bedevere-app bedevere-app Bot mentioned this pull request Aug 29, 2024
[C API] PEP 741: Add PyInitConfig C API to customize the Python initialization #107954
Closed
@bedevere-app bedevere-app Bot added the awaiting core review label Aug 29, 2024
@vstinner vstinner mentioned this pull request Aug 29, 2024
[PEP 741] gh-107954: Add PyConfig_Get() function #112609
Closed
@vstinner

vstinner commented Aug 29, 2024

Copy link
Copy Markdown
Member Author

(Previous version of the PR, before PEP 741 was accepted: #112609.)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Aug 29, 2024

Copy link
Copy Markdown
Member Author

cc @zooba

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vstinner added 3 commits August 29, 2024 21:33
@vstinner
Test enable_gil option
988dca5
@vstinner
Fix make check-c-globals
2d592a6
@vstinner
Merge branch 'main' into config_get
4e0951e
picnixz
picnixz reviewed Aug 30, 2024
View reviewed changes

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member

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.

I don't have much to say except my usual style nitpicks.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/c-api/init_config.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/c-api/init_config.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/c-api/init_config.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/c-api/init_config.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/c-api/init_config.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/initconfig.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/initconfig.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/initconfig.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/initconfig.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/initconfig.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

vstinner and others added 6 commits August 30, 2024 18:37
@vstinner @picnixz
Update Doc/c-api/init_config.rst
edc9974
Co-authored-by: Bénédikt Tran <[email protected]>
@vstinner @picnixz
Update Doc/c-api/init_config.rst
4616b52
Co-authored-by: Bénédikt Tran <[email protected]>
@vstinner @picnixz
Update Modules/_testcapi/config.c
135d862
Co-authored-by: Bénédikt Tran <[email protected]>
@vstinner @picnixz
Update Python/initconfig.c
2324465
Co-authored-by: Bénédikt Tran <[email protected]>
@vstinner @picnixz
Update Python/initconfig.c
0c20c8a
Co-authored-by: Bénédikt Tran <[email protected]>
@vstinner @picnixz
Apply suggestions from code review
67210db
Co-authored-by: Bénédikt Tran <[email protected]>
@vstinner

vstinner commented Aug 30, 2024

Copy link
Copy Markdown
Member Author

@picnixz: About your suggested changes to replace type* with type *: I prefer type* for the return type, and type *var for declaration. It's just a personal preference, and I don't think that PEP 7 enforces a specific formatting. It should also be consistent with existing code in initconfig.c (I wrote most of its code).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vstinner added 2 commits August 30, 2024 23:21
@vstinner
Address Bénédikt's review
262738f
@vstinner
Change SPEC() macro for the visibility
fcf0918
@vstinner

vstinner commented Aug 30, 2024

Copy link
Copy Markdown
Member Author

@picnixz: I addressed most of your reviews.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@picnixz

picnixz commented Aug 31, 2024

Copy link
Copy Markdown
Member

About your suggested changes to replace type* with type : I prefer type for the return type, and type *var for declaration. It's just a personal preference, and I don't think that PEP 7 enforces a specific formatting. It should also be consistent with existing code in initconfig.c (I wrote most of its code).

Sound good to me. Consistency in this case is better so I'm fine. And PEP 7 indeed doesn't say anything on this matter (it just says that the function name must be on its own line I think).

I addressed most of your reviews.

Thank you!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vstinner added 6 commits September 2, 2024 18:09
@vstinner
Complete test_config_get_sys_flags()
a39857e
@vstinner
Revert test_cmd_line.py changes
2014c52
@vstinner
Check pos argument in sys_set_flag()
4a3595c
Update also PyConfig in _PySys_SetIntMaxStrDigits().
@vstinner
Cleanup initconfig.c
8c321f1
Add _PyWideStringList_AsTuple() function.
@vstinner
Merge branch 'main' into config_get
1556b95
@vstinner
Fix sys_set_flag() assertion
b655e93
@vstinner
vstinner merged commit 33b7909 into python:main Sep 2, 2024
@vstinner
vstinner deleted the config_get branch September 2, 2024 21:25
@bedevere-app bedevere-app Bot removed the awaiting core review label Sep 2, 2024
@bedevere-bot

bedevere-bot commented Sep 3, 2024

Copy link
Copy Markdown

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

Hi! The buildbot AMD64 Arch Linux Perf 3.x has failed when building commit 33b7909.

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

Failed tests:

  • test_perf_profiler

Failed subtests:

  • test_python_calls_appear_in_the_stack_if_perf_activated - test.test_perf_profiler.TestPerfProfilerWithDwarf.test_python_calls_appear_in_the_stack_if_perf_activated

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

==

Click to see traceback logs
Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/Lib/test/test_perf_profiler.py", line 356, in test_python_calls_appear_in_the_stack_if_perf_activated
    self.assertIn(f"py::bar:{script}", stdout)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'py::bar:/tmp/test_python_kny9768u/tmphjpqq00r/perftest.py' not found in 'perf-exec 1679626 3573275.289032:          1 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 [unknown] ([unknown])\n\tffffffff975a8101 [unknown] ([unknown])\n\tffffffff975a81fe [unknown] ([unknown])\n\tffffffff975a8548 [unknown] ([unknown])\n\tffffffff975a8867 [unknown] ([unknown])\n\tffffffff972054f0 [unknown] ([unknown])\n\tffffffff97fc63e6 [unknown] ([unknown])\n\tffffffff98000124 [unknown] ([unknown])\n\nperf-exec 1679626 3573275.289039:          1 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 [unknown] ([unknown])\n\tffffffff975a8101 [unknown] ([unknown])\n\tffffffff975a81fe [unknown] ([unknown])\n\tffffffff975a8548 [unknown] ([unknown])\n\tffffffff975a8867 [unknown] ([unknown])\n\tffffffff972054f0 [unknown] ([unknown])\n\tffffffff97fc63e6 [unknown] ([unknown])\n\tffffffff98000124 [unknown] ([unknown])\n\nperf-exec 1679626 3573275.289042:        180 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 
rfbuild/build/python)\n\t    7f263ac630bf [unknown] (//anon)\n\npython 1679626 3573275.417040:   61490717 cycles:P: \n\t    557dffe59297 _PyLong_FromMedium+0x127 (inlined)\n\t    557dffe59297 PyLong_FromLong+0x127 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    557dffdb36b3 _PyEval_EvalFrameDefault+0xb7b3 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f263ac24ae5 py::foo:/tmp/test_python_kny9768u/tmphjpqq00r/perftest.py+0x5 (/tmp/perf-1679626.map)\n\npython 1679626 3573275.431311:   55605021 cycles:P: \n\t    557dffda9a41 _PyEval_EvalFrameDefault+0x1b41 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f263ac24ae5 py::foo:/tmp/test_python_kny9768u/tmphjpqq00r/perftest.py+0x5 (/tmp/perf-1679626.map)\n\npython 1679626 3573275.444329:   50474003 cycles:P: \n\t    557dffe4fc8d long_normalize+0x12d (inlined)\n\t    557dffe4fc8d x_add+0x12d (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    557dffdb0904 _PyEval_EvalFrameDefault+0x8a04 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f263ac24ae5 py::foo:/tmp/test_python_kny9768u/tmphjpqq00r/perftest.py+0x5 (/tmp/perf-1679626.map)\n\npython 1679626 3573275.455972:   48925544 cycles:P: \n\t    557dffea4e09 pymalloc_alloc+0x39 (inlined)\n\t    557dffea4e09 _PyObject_Malloc+0x39 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    557dffe4fbc5 _PyLong_New+0x65 (inlined)\n\t    557dffe4fbc5 x_add+0x65 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    557dffdb0904 _PyEval_EvalFrameDefault+0x8a04 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f263ac24ae5 py::foo:/tmp/test_python_kny9768u/tmphjpqq00r/perftest.py+0x5 (/tmp/perf-1679626.map)\n\npython 1679626 3573275.467281:   47144381 cycles:P: \n\t    557dffdb36a8 _PyEval_EvalFrameDefault+0xb7a8 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f263ac24ae5 py::foo:/tmp/test_python_kny9768u/tmphjpqq00r/perftest.py+0x5 (/tmp/perf-1679626.map)\n\npython 1679626 3573275.478197:   46067344 cycles:P: \n\t    557dffdabd64 _PyEval_EvalFrameDefault+0x3e64 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f263ac24ae5 py::foo:/tmp/test_python_kny9768u/tmphjpqq00r/perftest.py+0x5 (/tmp/perf-1679626.map)\n\npython 1679626 3573275.488837:   45298900 cycles:P: \n\t    557dffe4fbcd _PyLong_New+0x6d (inlined)\n\t    557dffe4fbcd x_add+0x6d (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    557dffdb0904 _PyEval_EvalFrameDefault+0x8a04 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f263ac24ae5 py::foo:/tmp/test_python_kny9768u/tmphjpqq00r/perftest.py+0x5 (/tmp/perf-1679626.map)\n\npython 1679626 3573275.499289:   44938714 cycles:P: \n\t    557dffdabd42 _Py_atomic_load_uintptr_relaxed+0x3e42 (inlined)\n\t    557dffdabd42 _PyEval_EvalFrameDefault+0x3e42 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f263ac24ae5 py::foo:/tmp/test_python_kny9768u/tmphjpqq00r/perftest.py+0x5 (/tmp/perf-1679626.map)\n\npython 1679626 3573275.509596:   44608188 cycles:P: \n\t    557dffe5ea24 _PyLong_Add+0x44 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    557dffdb0904 _PyEval_EvalFrameDefault+0x8a04 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f263ac24ae5 py::foo:/tmp/test_python_kny9768u/tmphjpqq00r/perftest.py+0x5 (/tmp/perf-1679626.map)\n\npython 1679626 3573275.519834:   44461292 cycles:P: \n\t    557dffe4ee4d _PyLong_CompactValue+0x1d (inlined)\n\t    557dffe4ee4d long_dealloc+0x1d (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    557dffda9a43 _PyEval_EvalFrameDefault+0x1b43 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f263ac24ae5 py::foo:/tmp/test_python_kny9768u/tmphjpqq00r/perftest.py+0x5 (/tmp/perf-1679626.map)\n\npython 1679626 3573275.530104:   44244567 cycles:P: \n\t


Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/Lib/test/test_perf_profiler.py", line 356, in test_python_calls_appear_in_the_stack_if_perf_activated
    self.assertIn(f"py::bar:{script}", stdout)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'py::bar:/tmp/test_python_g743bzl5/tmpl1emz2od/perftest.py' not found in 'perf-exec 1688463 3573495.449281:          1 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 [unknown] ([unknown])\n\tffffffff975a8101 [unknown] ([unknown])\n\tffffffff975a81fe [unknown] ([unknown])\n\tffffffff975a8548 [unknown] ([unknown])\n\tffffffff975a8867 [unknown] ([unknown])\n\tffffffff972054f0 [unknown] ([unknown])\n\tffffffff97fc63e6 [unknown] ([unknown])\n\tffffffff98000124 [unknown] ([unknown])\n\nperf-exec 1688463 3573495.449288:          1 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 [unknown] ([unknown])\n\tffffffff975a8101 [unknown] ([unknown])\n\tffffffff975a81fe [unknown] ([unknown])\n\tffffffff975a8548 [unknown] ([unknown])\n\tffffffff975a8867 [unknown] ([unknown])\n\tffffffff972054f0 [unknown] ([unknown])\n\tffffffff97fc63e6 [unknown] ([unknown])\n\tffffffff98000124 [unknown] ([unknown])\n\nperf-exec 1688463 3573495.449291:        184 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 [unknown] ([unknown])\n\tffffffff975a8101 [unknown] ([unknown])\n\tffffffff975a81fe [unknown] ([unknown])\n\tffffffff975a8548 [unknown] ([unknown])\n\tffffffff975a8867 [unknown] ([unknown])\n\tffffffff972054f0 [unknown] ([unknown])\n\tffffffff97fc63e6 [unknown] ([unknown])\n\tffffffff98000124 [unknown] ([unknown])\n\nperf-exec 1688463 3573495.449294:      66558 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 [unknown] ([unknown])\n\tffffffff975a8101 [unknown] ([unknown])\n\tffffffff975a81fe [unknown] ([unknown])\n\tffffffff975a8548 [unknown] ([unknown])\n\tffffffff975a8867 [unknown] ([unknown])\n\tffffffff972054f0 [unknown] ([unknown])\n\tffffffff97fc63e6 [unknown] ([unkn
up+0x693 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    5580a49baaa3 _PyDict_GetItemRef_KnownHash+0x23 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    5580a4a08eb5 find_name_in_mro+0xa5 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    5580a4a1277b update_one_slot+0xfb (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    5580a4a1b2bf fixup_slot_dispatchers+0xcbf (inlined)\n\t    5580a4a1b2bf type_new_impl+0xcbf (inlined)\n\t    5580a4a1b2bf type_new+0xcbf (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    5580a4a0550c tp_new_wrapper+0xfc (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    5580a49ca6ea cfunction_call+0x5a (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    5580a496409a _PyObject_Call+0x7a (inlined)\n\t    5580a496409a PyObject_Call+0x7a (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    5580a48f37fd _PyEval_EvalFrameDefault+0x8fd (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f6d5b8c72e5 py::ABCMeta.__new__:<frozen abc>+0x5 (/tmp/perf-1688463.map)\n\npython 1688463 3573495.568523:   76108142 cycles:P: \n\t    5580a49efdd0 _PyObject_Malloc+0x0 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7ffe86f589bf [unknown] ([stack])\n\npython 1688463 3573495.585826:   62998085 cycles:P: \n\t    5580a49a419b PyLong_FromLong+0x2b (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    5580a48fe6b3 _PyEval_EvalFrameDefault+0xb7b3 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f6d5b8c7ae5 py::foo:/tmp/test_python_g743bzl5/tmpl1emz2od/perftest.py+0x5 (/tmp/perf-1688463.map)\n\npython 1688463 3573495.600167:   55298926 cycles:P: \n\t    5580a499acc4 _PyLong_SetDigitCount+0x164 (inlined)\n\t    5580a499acc4 long_normalize+0x164 (inlined)\n\t    5580a499acc4 x_add+0x164 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    5580a48fb904 _PyEval_EvalFrameDefault+0x8a04 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f6d5b8c7ae5 py::foo:/tmp/test_python_g743bzl5/tmpl1emz2od/perftest.py+0x5 (/tmp/perf-1688463.map)\n\npython 1688463 3573495.612740:   51712861 cycles:P: \n\t    5580a48f626c _PyEval_EvalFrameDefault+0x336c (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f6d5b8c7ae5 py::foo:/tmp/test_python_g743bzl5/tmpl1emz2od/perftest.py+0x5 (/tmp/perf-1688463.map)\n\npython 1688463 3573495.624533:   49256868 cycles:P: \n\t    5580a4999e39 long_dealloc+0x9 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    5580a48f4a43 _PyEval_EvalFrameDefault+0x1b43 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f6d5b8c7ae5 py::foo:/tmp/test_python_g743bzl5/tmpl1emz2od/perftest.py+0x5 (/tmp/perf-1688463.map)\n\npython 1688463 3573495.635732:   48123553 cycles:P: \n\t    5580a48f4a41 _PyEval_EvalFrameDefault+0x1b41 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f6d5b8c7ae5 py::foo:/tmp/test_python_g743bzl5/tmpl1emz2od/perftest.py+0x5 (/tmp/perf-1688463.map)\n\npython 1688463 3573495.646675:   46903439 cycles:P: \n\t    5580a48f6d6e _PyEval_EvalFrameDefault+0x3e6e (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f6d5b8c7ae5 py::foo:/tmp/test_python_g743bzl5/tmpl1emz2od/perftest.py+0x5 (/tmp/perf-1688463.map)\n\npython 1688463 3573495.657413:   46067424 cycles:P: \n\t    5580a49efe16 pymalloc_alloc+0x46 (inlined)\n\t    5580a49efe16 _PyObject_Malloc+0x46 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    5580a499abc5 _PyLong_New+0x65 (inlined)\n\t    5580a499abc5 x_add+0x65 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    5580a48fb904 _PyEval_EvalFrameDefault+0x8a04 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f6d5b8c7ae5 py::
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot

bedevere-bot commented Sep 3, 2024

Copy link
Copy Markdown

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

Hi! The buildbot AMD64 Arch Linux TraceRefs 3.x has failed when building commit 33b7909.

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

Failed tests:

  • test_perf_profiler

Failed subtests:

  • test_python_calls_appear_in_the_stack_if_perf_activated - test.test_perf_profiler.TestPerfProfilerWithDwarf.test_python_calls_appear_in_the_stack_if_perf_activated

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

==

Click to see traceback logs
Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/Lib/test/test_perf_profiler.py", line 356, in test_python_calls_appear_in_the_stack_if_perf_activated
    self.assertIn(f"py::bar:{script}", stdout)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'py::bar:/tmp/test_python_a63br8fn/tmph7x9rrja/perftest.py' not found in 'perf-exec 1713407 3574522.920521:          1 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 [unknown] ([unknown])\n\tffffffff975a8101 [unknown] ([unknown])\n\tffffffff975a81fe [unknown] ([unknown])\n\tffffffff975a8548 [unknown] ([unknown])\n\tffffffff975a8867 [unknown] ([unknown])\n\tffffffff972054f0 [unknown] ([unknown])\n\tffffffff97fc63e6 [unknown] ([unknown])\n\tffffffff98000124 [unknown] ([unknown])\n\nperf-exec 1713407 3574522.920529:          1 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 [unknown] ([unknown])\n\tffffffff975a8101 [unknown] ([unknown])\n\tffffffff975a81fe [unknown] ([unknown])\n\tffffffff975a8548 [unknown] ([unknown])\n\tffffffff975a8867 [unknown] ([unknown])\n\tffffffff972054f0 [unknown] ([unknown])\n\tffffffff97fc63e6 [unknown] ([unknown])\n\tffffffff98000124 [unknown] ([unknown])\n\nperf-exec 1713407 3574522.920533:        146 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 [unknown] ([unknown])\n\tffffffff975a8101 [unknown] ([unknown])\n\tffffffff975a81fe


Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/Lib/test/test_perf_profiler.py", line 356, in test_python_calls_appear_in_the_stack_if_perf_activated
    self.assertIn(f"py::bar:{script}", stdout)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'py::bar:/tmp/test_python_0fcql3_d/tmptgchnrw3/perftest.py' not found in 'perf-exec 1724972 3574960.855300:          1 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 [unknown] ([unknown])\n\tffffffff975a8101 [unknown] ([unknown])\n\tffffffff975a81fe [unknown] ([unknown])\n\tffffffff975a8548 [unknown] ([unknown])\n\tffffffff975a8867 [unknown] ([unknown])\n\tffffffff972054f0 [unknown] ([unknown])\n\tffffffff97fc63e6 [unknown] ([unknown])\n\tffffffff98000124 [unknown] ([unknown])\n\nperf-exec 1724972 3574960.855307:          1 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 [unknown] ([unknown])\n\tffffffff975a8101 [unknown] ([unknown])\n\tffffffff975a81fe [unknown] ([unknown])\n\tffffffff975a8548 [unknown] ([unknown])\n\tffffffff975a8867 [unknown] ([unknown])\n\tffffffff972054f0 [unknown] ([unknown])\n\tffffffff97fc63e6 [unknown] ([unknown])\n\tffffffff98000124 [unknown] ([unknown])\n\nperf-exec 1724972 3574960.855310:        189 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 [unknown] ([unknown])\n\tffffffff975a8101 [unknown] ([unknown])\n\tffffffff975a81fe [unknown] ([unknown])\n\tffffffff975a8548 [unknown] ([unknown])\n\tffffffff975a8867 [unknown] ([unknown])\n\tffffffff972054f0 [unknown] ([unknown])\n\tffffffff97fc63e6 [unknown] ([unknown])\n\tffffffff98000124 [unknown] ([unknown])\n\nperf-exec 1724972 3574960.855313:      73570 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 [unknown] ([unknown])\n\tffffffff975a8101 [unknown] ([unknown])\n\tffffffff975a81fe [unknown] ([unknown])\n\tffffffff975a8548 [unknown] ([unknown])\n\tffffffff975a8867 [unknown] ([unknown])\n\tffffffff972054f0 [unknown] ([unknown])\n\tffffffff97fc63e6 [unknown] ([unknown])\n\tf
thon)\n\t    56217dfdd4b4 _Py_Dealloc+0x6c (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e024bf0 Py_DECREF+0x3c (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e030c8f intern_common+0x17d (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e06174e _PyUnicode_InternMortal+0x18 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e061800 PyUnicode_InternFromString+0x35 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217df950db descr_new+0x40 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217df961f5 PyDescr_NewMethod+0x91 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e00c9f2 type_add_method+0x120 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e00caab type_add_methods+0x26 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e00cd14 type_ready_fill_dict+0x1c (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e01ab0c type_ready+0xb7 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e0131fc PyType_Ready+0x3b (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e013f36 _PyType_FromMetaclass_impl+0x906 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e0142c0 PyType_FromModuleAndSpec+0x1c (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e188d43 iomodule_exec+0x11e (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217dfdadc3 PyModule_ExecDef+0x82 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e108dca exec_builtin_or_dynamic+0x4d (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e108ddf _imp_exec_builtin_impl+0xb (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e109211 _imp_exec_builtin+0xd (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217dfd8457 cfunction_vectorcall_O+0x66 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217df8994d _PyVectorcall_Call+0x74 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217df89c65 _PyObject_Call+0x145 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217df89c9d PyObject_Call+0x1f (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e0b814a _PyEval_EvalFrameDefault+0x53a4 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e0cc218 _PyEval_EvalFrame+0x1c (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e0cc335 _PyEval_Vector+0xd9 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217df87d60 _PyFunction_Vectorcall+0x53 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217df880c1 _PyObject_VectorcallTstate+0x51 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217df88edb object_vacall+0x112 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217df89014 PyObject_CallMethodObjArgs+0xfe (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e108c33 import_find_and_load+0x124 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e10c7d8 PyImport_ImportModuleLevelObject+0x1b4 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e0b2192 _PyEval_ImportName+0xbc (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e0bfa07 _PyEval_EvalFrameDefault+0xcc61 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e0cc218 _PyEval_EvalFrame+0x1c (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e0cc335 _PyEval_Vector+0xd9 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e0cc3f4 PyEval_EvalCode+0xaf (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e0aade7 builtin_exec_impl+0x409 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e0aaef4 builtin_exec+0xde (/buildbot/buildarea/3.x.pablogsal-arch-x86_64
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pablogsal

pablogsal commented Sep 26, 2024

Copy link
Copy Markdown
Member

@vstinner Seems this PR broke the Linux perf profiler buildbots (and have been broken since)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Sep 26, 2024

Copy link
Copy Markdown
Member Author

@pablogsal do you have some details?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pablogsal

pablogsal commented Sep 26, 2024

Copy link
Copy Markdown
Member

No other than the buildbot logs

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pablogsal

pablogsal commented Sep 26, 2024

Copy link
Copy Markdown
Member

I can try to look into this once I am back from the core dev sprint since here I don't have a laptop with new enough perf

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pablogsal pablogsal mentioned this pull request Sep 26, 2024
test_perf_profiler fails on Linux (both AArch64 and x86) #124613
Closed
@pablogsal

pablogsal commented Sep 26, 2024

Copy link
Copy Markdown
Member

I can confirm that the previous commit builds correctly

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pablogsal

pablogsal commented Sep 26, 2024

Copy link
Copy Markdown
Member

Found the problem: #124636

diegorusso reacted with rocket emoji
All reactions
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@diegorusso

diegorusso commented Sep 26, 2024

Copy link
Copy Markdown
Contributor

Yes, it fixes the issue I raised

Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@diegorusso

diegorusso commented Sep 26, 2024

Copy link
Copy Markdown
Contributor

But also the real question is: why wasn't this picked up by the GH runners and rely on buildbot builds?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pablogsal

pablogsal commented Sep 27, 2024

Copy link
Copy Markdown
Member

But also the real question is: why wasn't this picked up by the GH runners and rely on buildbot builds?

Because running the minimum Perf in GH runners is close to impossible

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

@picnixz picnixz picnixz left review comments
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner
@erlend-aasland erlend-aasland Awaiting requested review from erlend-aasland erlend-aasland is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@vstinner @picnixz @bedevere-bot @pablogsal @diegorusso
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.