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-141770: Annotate anonymous mmap usage if "-X dev" is used by corona10 · Pull Request #142079 · python/cpython

Conversation

@corona10

@corona10 corona10 commented Nov 29, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member
  • Issue: Name arenas allocated by mmap in _PyMem_ArenaAlloc for debugging #141770

Sorry, something went wrong.

Uh oh!

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

All reactions
corona10 and others added 3 commits November 29, 2025 01:14
@corona10
pythongh-141770: Annotate anonymous mmap only for debug build
0e3933d
@corona10
Apply annotation feature to modules
8b7023e
@corona10
Add NEWS.d
816d962
@corona10
corona10 requested review from AA-Turner, brandtbucher, diegorusso, emmatyping, ericsnowcurrently, erlend-aasland and savannahostrowski as code owners November 29, 2025 09:16
@bedevere-app bedevere-app Bot added the awaiting core review label Nov 29, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Nov 29, 2025
Name arenas allocated by mmap in _PyMem_ArenaAlloc for debugging #141770
Closed
@corona10

corona10 commented Nov 29, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

Annotation

Screenshot 2025-11-29 at 6 10 03 PM

Without annotation

Screenshot 2025-11-29 at 6 23 31 PM

I verified that this annotation actually works, and I believe it will be very helpful for debugging when needed.

  • Ruby: Annotate anonymous mmap ruby/ruby#12119
  • Go: https://go.dev/doc/go1.25#vma-names-on-linux
All reactions

Sorry, something went wrong.

Uh oh!

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

@corona10

corona10 commented Nov 29, 2025

Copy link
Copy Markdown
Member Author

cc @picnixz

All reactions

Sorry, something went wrong.

Uh oh!

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

@corona10

corona10 commented Nov 29, 2025

Copy link
Copy Markdown
Member Author

FYI, Fedora does not support yet even if the kernel version itself already support it.
See: https://bugzilla.redhat.com/show_bug.cgi?id=2302746

cc @vstinner @encukou

All reactions

Sorry, something went wrong.

Uh oh!

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

picnixz
picnixz reviewed Nov 29, 2025
View reviewed changes
Comment thread Include/internal/pycore_pymem.h Resolved

Uh oh!

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

Comment thread Include/internal/pycore_pymem.h Resolved

Uh oh!

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

corona10 and others added 3 commits November 29, 2025 09:30
@corona10
nit
979ce02
@corona10 @picnixz
Update Include/internal/pycore_pymem.h
b3d8547
Co-authored-by: Bénédikt Tran <[email protected]>
@corona10
Address code review
0c5a495
@corona10
corona10 requested a review from picnixz November 29, 2025 10:13
picnixz
picnixz reviewed Nov 29, 2025
View reviewed changes
Comment thread Include/internal/pycore_pymem.h Resolved

Uh oh!

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

@corona10
Address code review
e757dd9
picnixz
picnixz approved these changes Nov 29, 2025
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Nov 29, 2025
@SpecLad

SpecLad commented Nov 29, 2025

Copy link
Copy Markdown
Contributor

FWIW, it would be useful to have an option to enable this in release builds too.

corona10 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@corona10

corona10 commented Nov 29, 2025

Copy link
Copy Markdown
Member Author

@SpecLad Thanks for the feedback, I will create a separate PR :)

All reactions

Sorry, something went wrong.

Uh oh!

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

@corona10

corona10 commented Nov 29, 2025

Copy link
Copy Markdown
Member Author

@SpecLad Just out of curiosity, passing the build flag through ./configure --enable-annotate-mmap would be fine to you?
I would like to follow Ruby's approach but disable this flag by default unless many disto actually want this flag.

All reactions

Sorry, something went wrong.

Uh oh!

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

@SpecLad

SpecLad commented Nov 29, 2025

Copy link
Copy Markdown
Contributor

To be clear, by "option" I really mean a runtime option. 🙂 It would be pretty annoying to have to rebuild Python just for this. If you compare with other implementations, none of them require a compile-time option:

  • C (glibc) - off by default, can be enabled with environment variable;
  • Go - on by default, can be disabled with environment variable;
  • Ruby - on permanently (unless I missed something).

TBH, I don't see why Python shouldn't also permanently enable this, but I would settle for "off by default, enabled with environment variable or -X option".

All reactions

Sorry, something went wrong.

Uh oh!

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

@picnixz

picnixz commented Nov 29, 2025

Copy link
Copy Markdown
Member

It's a bit annoying that this would only be supported on Linux. Do we have an option that isn't supported everywhere?

All reactions

Sorry, something went wrong.

Uh oh!

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

corona10 and others added 3 commits December 5, 2025 23:03
@corona10 @vstinner
Apply suggestions from code review
fee757e
Co-authored-by: Victor Stinner <[email protected]>
@corona10 @vstinner
Update Objects/obmalloc.c
a240b3c
Co-authored-by: Victor Stinner <[email protected]>
@corona10
Address code review
805c539
@corona10
corona10 requested a review from vstinner December 5, 2025 14:08
corona10
corona10 commented Dec 5, 2025
View reviewed changes

@corona10 corona10 left a comment

Copy link
Copy Markdown
Member Author

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.

@vstinner @picnixz I 've applied all your suggestion.

Sorry, something went wrong.

Uh oh!

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

All reactions
picnixz
picnixz approved these changes Dec 5, 2025
View reviewed changes
Comment thread Doc/whatsnew/3.15.rst Outdated
modules that are missing or packaged separately.
(Contributed by Stan Ulbrych and Petr Viktorin in :gh:`139707`.)

* Annotating anonymous mmap usage is now supported if Linux kernel supports ``PR_SET_VMA_ANON_NAME`` (Linux 5.17 or newer).

@picnixz picnixz Dec 5, 2025

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.

* Annotating anonymous mmap usage is now supported if Linux kernel
  supports :manpage:`PR_SET_VMA_ANON_NAME <PR_SET_VMA(2const)>`
  (Linux 5.17 or newer).

I don't know under which manpage entry it is, but if you locally run Sphinx, you should be able to find the correct one. That way, users would have a link to click on. If there isn't a manpage, nevermind.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Misc/NEWS.d/next/Core_and_Builtins/2025-11-29-18-14-28.gh-issue-141770.JURnvg.rst Resolved

Uh oh!

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

Comment thread Include/internal/pycore_mmap.h Resolved

Uh oh!

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

corona10 and others added 4 commits December 6, 2025 00:42
@corona10 @picnixz
Update Misc/NEWS.d/next/Core_and_Builtins/2025-11-29-18-14-28.gh-issu…
795d31c
…e-141770.JURnvg.rst

Co-authored-by: Bénédikt Tran <[email protected]>
@corona10
Address code review
be4d550
@corona10
Address code review
290864a
@corona10
nit
b287e0c
vstinner
vstinner reviewed Dec 6, 2025
View reviewed changes
Comment thread Misc/NEWS.d/next/Core_and_Builtins/2025-11-29-18-14-28.gh-issue-141770.JURnvg.rst Resolved

Uh oh!

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

@corona10 @vstinner
Update Misc/NEWS.d/next/Core_and_Builtins/2025-11-29-18-14-28.gh-issu…
1619f95
…e-141770.JURnvg.rst

Co-authored-by: Victor Stinner <[email protected]>
vstinner
vstinner reviewed Dec 8, 2025
View reviewed changes
Comment thread Include/internal/pycore_mmap.h Resolved

Uh oh!

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

corona10 and others added 2 commits December 8, 2025 23:09
@corona10 @vstinner
Update Include/internal/pycore_mmap.h
a1ad592
Co-authored-by: Victor Stinner <[email protected]>
@corona10 @encukou
Update Modules/_ctypes/malloc_closure.c
e4e4835
Co-authored-by: Petr Viktorin <[email protected]>
vstinner
vstinner approved these changes Dec 8, 2025
View reviewed changes

@vstinner vstinner 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.

LGTM

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Include/internal/pycore_mmap.h Resolved

Uh oh!

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

@corona10 @vstinner
Update Include/internal/pycore_mmap.h
0429a0a
Co-authored-by: Victor Stinner <[email protected]>
@corona10
corona10 enabled auto-merge (squash) December 8, 2025 14:20
@corona10
corona10 merged commit c4ccaf4 into python:main Dec 8, 2025
64 checks passed

Uh oh!

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

@bedevere-app bedevere-app Bot removed the awaiting merge label Dec 8, 2025
@corona10
corona10 deleted the gh-141770 branch December 8, 2025 14:51
@bedevere-bot

bedevere-bot commented Dec 8, 2025

Copy link
Copy Markdown

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

Hi! The buildbot AMD64 Ubuntu Shared 3.x (tier-1) has failed when building commit c4ccaf4.

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

Failed tests:

  • test_sys
  • test_audit
  • test_profiling
  • test_external_inspection
  • test_remote_pdb

Failed subtests:

  • test_sys_remote_exec - test.test_audit.AuditTest.test_sys_remote_exec

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

==

Click to see traceback logs
Traceback (most recent call last):
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_audit.py", line 332, in test_sys_remote_exec
    self.fail(stderr)
    ~~~~~~~~~^^^^^^^^
AssertionError: Fatal Python error: _Py_CheckFunctionResult: a function returned a result with an exception set
Python runtime state: initialized
OSError: Cannot open ELF file '[anon:cpython:pymalloc]' for section 'PyRuntime' search: No such file or directory
All reactions

Sorry, something went wrong.

Uh oh!

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

@hugovk

hugovk commented Dec 10, 2025

Copy link
Copy Markdown
Member

Please can you check the buildbot failure?

All reactions

Sorry, something went wrong.

Uh oh!

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

hugovk added a commit to hugovk/cpython that referenced this pull request Dec 10, 2025
@hugovk
Revert "pythongh-141770: Annotate anonymous mmap usage if "-X dev" is…
702ab91
… used (pythongh-142079)"

This reverts commit c4ccaf4.
@hugovk

hugovk commented Dec 11, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

I think it's a problem with the buildbot machine: it's timing out on other branches now, and the builds are taking nearly five hours, when they used to take around 50 minutes:

https://buildbot.python.org/#/workers/31

All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner

vstinner commented Dec 11, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

I just sent an email to David Bolen (the buildbot owner) to ask him to have a look. Something seems to be wrong with this buildbot worker.

hugovk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@vstinner

vstinner commented Dec 12, 2025

Copy link
Copy Markdown
Member

This change introduced a regression: #142627.

All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner

vstinner commented Dec 12, 2025

Copy link
Copy Markdown
Member

Note for myself: The feature is not available on Fedora, since Fedora builds the Linux kernel without the CONFIG_ANON_VMA_NAME option:

$ grep CONFIG_ANON_VMA_NAME /boot/config-$(uname -r)
# CONFIG_ANON_VMA_NAME is not set
All reactions

Sorry, something went wrong.

Uh oh!

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

@corona10 corona10 mentioned this pull request Dec 13, 2025
gh-142419: Add mmap.set_name method for user custom annotation #142480
Merged
@yosifkit yosifkit mentioned this pull request Jan 9, 2026
failure building Python 3.15.0a3 through 3.15.0 release on Alpine #143632
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner vstinner approved these changes
@picnixz picnixz picnixz approved these changes
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently
@brandtbucher brandtbucher Awaiting requested review from brandtbucher brandtbucher is a code owner
@savannahostrowski savannahostrowski Awaiting requested review from savannahostrowski
@diegorusso diegorusso Awaiting requested review from diegorusso diegorusso is a code owner
@erlend-aasland erlend-aasland Awaiting requested review from erlend-aasland erlend-aasland is a code owner
@AA-Turner AA-Turner Awaiting requested review from AA-Turner AA-Turner is a code owner
@emmatyping emmatyping Awaiting requested review from emmatyping emmatyping is a code owner
@encukou encukou Awaiting requested review from encukou
@zooba zooba Awaiting requested review from zooba
+1 more reviewer
@SpecLad SpecLad SpecLad left review comments
Reviewers whose approvals may not affect merge requirements

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.

8 participants

@corona10 @SpecLad @picnixz @encukou @bedevere-bot @hugovk @vstinner @zooba
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.