Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-144281: Fix crash on memoryview slice assignment with shared memory#144284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@VanshAgarwal24036
Copy link
Contributor

@VanshAgarwal24036VanshAgarwal24036 commentedJan 27, 2026
edited by bedevere-appbot
Loading

Fix a possible interpreter crash when assigning to a memoryview slice backed by shared memory by validating the underlying buffer before writing. A regression test and NEWS entry are included.

@VanshAgarwal24036VanshAgarwal24036force-pushed thegh-144281-shared-memory-crash branch from20c6f0b to4cfbb0aCompareJanuary 27, 2026 18:13

CHECK_RELEASED_INT(self);

if (view->buf==NULL) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It is not clear this is a necessary or sufficient fix without a valid specific trigger.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I’ve updated the test that should also make the need for the view->buf NULL check clearer.

Copy link
Contributor

Choose a reason for hiding this comment

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

The issue is moot since this has been closed, but I'm afraid this still wouldn't have been useful. Your fix is unrelated to the test; it passes with or without it. It is good practice to always run your test scripts against affected versions, to confirm it reproduces the bug. Without that you don't know the testworks.

Also note the bug in the OP is aSIGBUS, a fatal signal. It is completely expected that invalid operations like this raise exceptions, but it shouldn't be possible to trigger a fatal signal via the public API-ish. Terms and conditions apply. Offer void whenctypes ormmap orgc or various other low-level power tools.

@da-woods
Copy link
Contributor

I don't think this can be right. Partly because if it is you'd need to guardevery use ofview->buf and not just that one. And you'd probably have to do that in a thread-safe way. But also becausememoryview ownsview so nothing else should even have access to modifyview and make it "no longer valid".

@picnixz
Copy link
Member

picnixz commentedJan 28, 2026
edited
Loading

If this is a legitimate issue, I believe this should be fixed as part of#143324. I will take care of that once I have time as well. More generally, I would prefer that you avoid addressing crash issues because many of your PRs are eventually closed and the issue is usually non-trivial so it is better to have a more seasoned contributor for those issues.

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

Reviewers

@gpsheadgpsheadAwaiting requested review from gpsheadgpshead is a code owner

@duanegduanegAwaiting requested review from duaneg

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@VanshAgarwal24036@da-woods@picnixz@duaneg

[8]ページ先頭

©2009-2026 Movatter.jp