Snapshot#warmup! aborts when the warmup code creates an Intl object (CheckGlobalAndEternalHandles failed)
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
- 52/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, ruby
- Lĩnh vực
- backend, embedded-iot
Hướng nghiên cứu
Start in ext/mini_racer_extension/mini_racer_v8.cc at snapshot() around lines 949 and 1004, then compare its handle scopes with V8’s WarmUpSnapshotDataBlobInternal scopes. Reproduce with the supplied Ruby snippet, first warming with f() alone and then with Intl.DateTimeFormat. Done means the latter completes or raises MiniRacer::SnapshotError instead of terminating the process.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Creating an Intl.DateTimeFormat during Snapshot#warmup! aborts inside V8. Warming the same snapshot with f() alone works, and a context created from it evaluates f() to 1.
Reproduce
require "mini_racer"
snapshot = MiniRacer::Snapshot.new("function f() { return 1 }")
snapshot.warmup!("var formatter = new Intl.DateTimeFormat('en'); f()")
puts "not reached"
What happens
global handle not serialized: 0x1f890d0c9ea1: [Foreign]
- map: 0x3cea0c000e91 <Map[16](FOREIGN_TYPE)>
- foreign address: 0x7fc7a4187060
...
#
# Fatal error in , line 0
# CheckGlobalAndEternalHandles failed
Exit status 133 (SIGTRAP). V8 prints three global handle not serialized blocks, then the fatal error and a native backtrace through v8_thread_main.
Expected
The warmup should complete or raise MiniRacer::SnapshotError. It should not terminate the process.
Cause
The likely cause is that snapshot() uses one v8::HandleScope for the entire function (ext/mini_racer_extension/mini_racer_v8.cc:949), leaving the warmup context and values it created referenced when CreateBlob runs (ext/mini_racer_extension/mini_racer_v8.cc:1004). V8's WarmUpSnapshotDataBlobInternal runs the warmup in its own HandleScope and creates the default context in a separate scope. I have not confirmed that this scope owns the reported handles.
Environment
- mini_racer 0.22.1 with libv8-node 24.12.0.1 (V8 13.6.233.17-node.37)
- Ruby 3.4.2 x86_64-linux
- Fedora 44
Reproduced in 3 of 3 runs.
- Ngôn ngữ chính
- JavaScript
- Star
- 628
- Fork
- 100
- Merge trung bình
- 1 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không 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 rubyjs/mini_racer
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
rubyjs/mini_racer#449 ·
-
Snapshot.load accepts a blob from another V8 version, and Context.new then kills the processĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
rubyjs/mini_racer#448 ·
-
bug/crash platform: linux/x86
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
rubyjs/mini_racer#422 · 10 bình luận ·
-
platform: darwin/x86
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
rubyjs/mini_racer#388 · 4 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
rubyjs/mini_racer#376 ·
Tất cả issue của rubyjs/mini_racer
Issue tương tự
-
enhancement good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
DepressionCenter/agentprise#50 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
ccomkhj/product-demo#10 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Possible null error in core.jsĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 73/100
-
`at-root-no-redundant` suggested fix breaks `@at-root { ... }` (at-root not followed by a selector)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
stylelint-scss/stylelint-scss#1368 ·