Skip to content

chore(deps): bump monty from 0.0.19 to 0.0.21 - #2297

Closed
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/cargo/monty-0.0.21
Closed

chore(deps): bump monty from 0.0.19 to 0.0.21#2297
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/cargo/monty-0.0.21

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Aug 13, 2026

Copy link
Copy Markdown
Contributor

Bumps monty from 0.0.19 to 0.0.21.

Release notes

Sourced from monty's releases.

v0.0.21 - 2026-08-09

What's Changed

Full Changelog: pydantic/monty@v0.0.20...v0.0.21

v0.0.20 - 2026-08-09

What's Changed

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [monty](https://github.com/pydantic/monty) from 0.0.19 to 0.0.21.
- [Release notes](https://github.com/pydantic/monty/releases)
- [Commits](pydantic/monty@v0.0.19...v0.0.21)

---
updated-dependencies:
- dependency-name: monty
  dependency-version: 0.0.21
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file rust Pull requests that update rust code labels Aug 13, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 13, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bashkit 206870a Commit Preview URL

Branch Preview URL
Aug 13 2026, 09:36 AM

@claude

claude Bot commented Aug 14, 2026

Copy link
Copy Markdown

Investigated this together with #2297. Two separate findings.

1. This PR cannot pass on its own. monty 0.0.19 depends on monty-types 0.0.19, so bumping only one of them leaves two monty-types versions in the graph and its result types stop unifying:

error[E0277]: the trait bound `monty_types::results::ExtFunctionResult:
              From<monty_types::ExtFunctionResult>` is not satisfied

That single cause is behind all ~22 failing checks here. monty and monty-types have to move together.

2. The combined bump is blocked by an upstream regression. I did the combined upgrade (#2298) and it compiles, but Monty 0.0.21 silently turns PythonLimits::max_memory into a no-op. max_memory is now evaluated from LIVE_MEMORY/BASELINE_MEMORY, which are only populated by monty-alloc installed as the process #[global_allocator]. Unarmed, probe_memory() is pinned at 0, so the limit can never fire — a 1M-item list allocation under a 2 MB cap exits 0 instead of being killed. The per-allocation on_grow/on_free hooks bashkit used to meter the VM were removed in the same change.

bashkit is a library and cannot install a global allocator on behalf of its embedders, so this is not fixable at our end. Evidence and options are in #2298.

Leaving this open rather than closing it so the upgrade isn't forgotten — but it should not be merged until the memory-enforcement question is resolved upstream, or an explicit decision is taken to narrow the guarantee.


Generated by Claude Code

chaliy added a commit that referenced this pull request Aug 15, 2026
…ry (#2300)

Monty 0.0.21 moves `max_memory` enforcement from host-side accounting in
`LimitedTracker::on_grow` to a probe of the `LIVE_MEMORY`/`BASELINE_MEMORY`
statics. Only the separate `monty-alloc` crate writes those, and only when
installed as the process-wide global allocator; neither `monty` nor
`monty-types` depends on it.

Bashkit cannot supply that allocator — it is an embeddable library, and
bashkit-python is a CPython extension module. With the statics at their
initial values `probe_memory()` is `0.saturating_sub(usize::MAX)` == 0, so
`check_allocation` never trips and the Python sandbox's memory ceiling is
silently unenforced.

Four threat-model regression tests fail on the bump (nested_list_bomb,
successive_allocations_accumulate, tight_memory_blocks_many_small_objects,
threat_python_pow_exhaustion) while the duration, recursion and print-cap
tests still pass, localising the regression to allocator-backed memory.

Adds dependabot ignores so the broken bump is not regenerated weekly, and
documents the blocker — along with the `ResourceTracker`/`ResourceLimits`
API migration and the `jiter` git-patch removal that become possible once
the memory fix lands — in the Python builtin knowledge doc.

Supersedes #2296 and #2297.
@dependabot @github

dependabot Bot commented on behalf of github Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

Looks like monty is no longer being updated by Dependabot, so this is no longer needed.

@dependabot dependabot Bot closed this Aug 15, 2026
@dependabot
dependabot Bot deleted the dependabot/cargo/monty-0.0.21 branch August 15, 2026 09:34

chaliy commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Closing — superseded by #2300, which holds monty/monty-types at 0.0.19 on purpose.

Two problems here. The smaller one is that this PR and #2296 each bump one half of a version-locked pair, so both fail every check (no LimitedTracker in the root, expected trait, found struct ResourceTracker). Fixing that split locally surfaced the real one.

Monty 0.0.21 silently disables the Python sandbox's memory ceiling. It moves max_memory enforcement from in-process accounting (LimitedTracker::on_grow) to probe_memory(), which reads the LIVE_MEMORY/BASELINE_MEMORY statics. Those are written only by the separate monty-alloc crate, and only when it is installed as the process-wide global allocator — and neither monty nor monty-types depends on it. With it absent the statics keep their initial values, so probe_memory() is 0.saturating_sub(usize::MAX) == 0 and check_allocation — backing both max_memory and check_large_result — can never trip. No error, no warning.

Bashkit cannot supply that allocator: it is an embeddable library, so the global allocator belongs to the downstream binary, and bashkit-python is a CPython extension module where it is CPython's.

Verified by applying the full bump (both crates together, plus the ResourceTracker/ResourceLimits migration needed to compile) and running the resource-limit suites:

test python_security_tests::whitebox_resource_limits::successive_allocations_accumulate ... FAILED
test python_security_tests::whitebox_resource_limits::nested_list_bomb ... FAILED
test python_security_tests::whitebox_resource_limits::tight_memory_blocks_many_small_objects ... FAILED
test threat_model_tests::python_security_regressions::threat_python_pow_exhaustion ... FAILED

test result: FAILED. 9 passed; 4 failed; 1457 filtered out

Duration, recursion and print-cap tests pass in the same run, which localises the regression to allocator-backed memory.

#2300 adds dependabot ignore entries for both crates so this bump is not regenerated weekly, and records the blocker in knowledge/runtimes/python-builtin.md — including the API migration and the fact that 0.0.21 would let us drop the jiter [patch.crates-io] git pin (a real supply-chain win, but not worth taking a silent sandbox regression for). Worth revisiting once Monty exposes an embedder-usable memory bound.


Generated by Claude Code

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

Labels

dependencies Pull requests that update a dependency file rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant