Skip to content

gh-160359: Accept older musl getdents64 buffer declarations - #160365

Merged
itamaro merged 3 commits into
python:mainfrom
zanieb:pbs/musl-getdents64-upstream
Oct 23, 2026
Merged

itamaro merged 3 commits into
python:mainfrom
zanieb:pbs/musl-getdents64-upstream

Conversation

@zanieb

@zanieb zanieb commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Older musl headers expose getdents64 as an alias for getdents, whose buffer parameter is struct dirent *. Passing the raw character buffer triggers an incompatible-pointer diagnostic. Pass it through void * to support both that interface and the glibc declaration.

Ports PBS's patch-posixsubprocess-musl-getdents64.patch.

Closes #160359.

@itamaro itamaro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@itamaro
itamaro enabled auto-merge (squash) October 22, 2026 22:20

@gpshead gpshead left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

easy for this to regress without the comment or a CI check that fails otherwise. but this code doesn't really change.

@gpshead gpshead added needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Oct 22, 2026
@zanieb

zanieb commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

I'll add a comment, seems reasonable

Comment thread Modules/_posixsubprocess.c
Comment thread Modules/_posixsubprocess.c Outdated
@zanieb

zanieb commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Feedback on the comment welcome, as I'm not a C developer :)

@itamaro

itamaro commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Feedback on the comment welcome, as I'm not a C developer :)

comment looks good to me. there was a CI failure (windows free threading). I retried it, I don't see how this change could impact windows, probably a flake.

@itamaro
itamaro merged commit 74c91a6 into python:main Oct 23, 2026
96 of 98 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @zanieb for the PR, and @itamaro for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

@miss-islington-app

Copy link
Copy Markdown

Sorry, @zanieb and @itamaro, I could not cleanly backport this to 3.15 due to a conflict.

Please backport manually with cherry_picker, see the devguide for more information.

cherry_picker 74c91a6fbfa3625cdc850acc99b509cc3d8c6ed0 3.15

@miss-islington-app

Copy link
Copy Markdown

Sorry, @zanieb and @itamaro, I could not cleanly backport this to 3.14 due to a conflict.

Please backport manually with cherry_picker, see the devguide for more information.

cherry_picker 74c91a6fbfa3625cdc850acc99b509cc3d8c6ed0 3.14

@zanieb zanieb removed needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Oct 23, 2026
@zanieb

zanieb commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

This does not need backporting to 3.14 or 3.15: both branches call syscall(SYS_getdents64, ...) and do not use the libc getdents64() function affected by this change. The getdents64() call was introduced on main for Python 3.16 by #155518.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

_posixsubprocess passes an incompatible buffer to older musl getdents64

3 participants