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 — Reject oversized bytearray resize requests by youknowdot · Pull Request #9815 · RustPython/RustPython

Conversation

@youknowdot

@youknowdot youknowdot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Reject bytearray resize requests above CPython 3.15's normal GIL-build bytes allocation limit before allocating. Keep same-size no-ops and exported-buffer errors ahead of the allocation check.

The failure appeared after #9807 enabled test_bytes.test_resize. On 32-bit WASI, the existing Vec-backed implementation can successfully allocate sys.maxsize bytes. I reproduced that on a pre-#9813 build; the bytearray source is identical on current main and the failing #9813 CI merge.

The fix is seven Rust lines. The snippet covers the first forbidden length on either pointer width, preservation of contents, and BufferError precedence. No Lib tests or workflow settings change.

Reference: CPython 3.15 bytearray size ceiling and resize ordering, resize implementation.

Validation

  • Exact CI WASI profile/features build with Rust 1.99.0 and Wasmer 7.5.0.
  • WASI test_bytes: 332 tests, 18 skipped, success. Focused resize selection: 2 tests passed.
  • WASI boundary probe: six allocation-limit checks and eighteen error-precedence checks passed, including the first forbidden 32-bit length, 2147483631.
  • CPython 3.15.1: full modified bytearray snippet and the same boundary/error-precedence probe passed.
  • Independent source review, formatting, diff checks, and repository pre-commit hooks passed.
  • Native workspace tests, C-API tests, strict Clippy, native test_bytes, and snippet harness are queued behind existing shared builds. This remains a draft until those checks and CI finish.

AI assistance: OpenAI Codex investigated, implemented, reviewed, and tested this change. The runtime did not expose an exact model version.

Sorry, something went wrong.

Uh oh!

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

All reactions
@youknowdot
Reject oversized bytearray resize requests
98f5158
Match CPython 3.15's normal bytes-allocation ceiling before allocating a resized bytearray. Preserve the same-size and exported-buffer checks, and cover the first excluded length, contents preservation, and export precedence on either pointer width.

Assisted-by: Codex:unreported
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

  • X
  • Mastodon
  • Reddit
  • LinkedIn
All reactions

Sorry, something went wrong.

Uh oh!

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

youknowone
youknowone approved these changes Nov 12, 2026
View reviewed changes
@youknowone
youknowone marked this pull request as ready for review November 12, 2026 09:12
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-12T09:12:18.606864Z
We couldn’t complete this review. Comment @codex review to try again.
98f5158 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

All reactions

Sorry, something went wrong.

Uh oh!

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

@youknowone
youknowone merged commit 586d38a into RustPython:main Nov 12, 2026
20 checks passed

Uh oh!

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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

@youknowone youknowone youknowone approved these changes

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.

2 participants

@youknowdot @youknowone
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.