Overly large array allocation may panic with "integer overflow"
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- backend
Hướng nghiên cứu
Start with the Array.replicate and ByteArray.emptyWithCapacity reproductions in the issue, then trace their runtime allocation paths and relevant tests. Reproduce the reported overflow with Lean 4.35.0 and compare interpreted and compiled behavior. Done means oversized requests are accepted or rejected gracefully without an uncaught runtime panic.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Prerequisites
- [ x] Check that your issue is not already filed:
https://github.com/leanprover/lean4/issues - [ x] Reduce the issue to a minimal, self-contained, reproducible test case.
Avoid dependencies to Mathlib or Batteries. - Test your test case against the latest nightly release, for example on
https://live.lean-lang.org/#project=lean-nightly
(You can also use the settings there to switch to “Lean nightly”)
locally reproduced with nightly - When reporting a perceived soundness bug: Does it affect
lake check --paranoid?
If in doubt, please reach out on [email protected] for responsible disclosure.
Description
Minimal repro:
-- Repro.lean (lean-toolchain: leanprover/lean4:v4.35.0)
def main : IO Unit := do
let n : Nat := 2^61 -- 2^61 * sizeof(void*) overflows size_t on 64-bit
IO.println s!"allocating Array of {n} elements"
let a := Array.replicate n (0 : Nat)
IO.println s!"size = {a.size}"
$ lean --run Repro.lean
INTERNAL PANIC: integer overflow in runtime computation (exit 1)
Variants:
┌───────────────────────────────────────────────┬─────────────────────────────────────────────────────────┐
│ Case │ Interpreted and compiled │
├───────────────────────────────────────────────┼─────────────────────────────────────────────────────────┤
│ Array.replicate (2^60) │ INTERNAL PANIC: out of memory │
├───────────────────────────────────────────────┼─────────────────────────────────────────────────────────┤
│ Array.replicate (2^61) │ INTERNAL PANIC: integer overflow in runtime computation │
├───────────────────────────────────────────────┼─────────────────────────────────────────────────────────┤
│ ByteArray.emptyWithCapacity (2^63) and (2^64) │ out of memory │
├───────────────────────────────────────────────┼─────────────────────────────────────────────────────────┤
│ Array.replicate (2^61) inside try … catch │ still aborts; not catchable │
└───────────────────────────────────────────────┴─────────────────────────────────────────────────────────┘
Expected behavior: [Clear and concise description of what you expect to happen]
Accept the program or a graceful rejection instead of a panic.
Actual behavior: [Clear and concise description of what actually happens]
Panic
Versions
4.35.0, reproduced on Linux and Mac.
Additional Information
[Additional information, configuration or data that might be necessary to reproduce the issue]
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
- Ngôn ngữ chính
- Lean
- Star
- 10.3k
- Fork
- 1.1k
- Merge trung bình
- 19 giờ 8 phút
- Pull request đã merge (30 ngày)
- 421
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của leanprover/lean4
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
leanprover/lean4#16681 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
leanprover/lean4#16305 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
leanprover/lean4#16299 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
leanprover/lean4#16257 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`IO.FS.realPath` reports every failure as `noFileOrDirectory` instead of classifying by `errno`Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
leanprover/lean4#15683 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của leanprover/lean4
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Upgrade Django to 5.2.18Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
-
`response_to_event_dict` crashes on repeated Content-Length headers, dropping the http batchĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
blacklanternsecurity/bbot#3678 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
A failed hydrate call can be dropped when the row's wait is ready tooCó thể đã có người làm @turbot-agent-fleet đã nhận hôm nay. Đang mởagent:ready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
turbot/steampipe-plugin-sdk#1018 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
router-for-me/CLIProxyAPI#7976 ·
Maintainer thường phản hồi trong vòng 1 ngày