Snapshot#warmup! aborts when the warmup code creates an Intl object (CheckGlobalAndEternalHandles failed)
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 52/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- javascript, ruby
- Bereich
- backend, embedded-iot
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 628
- Forks
- 100
- Ø Merge
- 1 T. 20 Std.
- Gemergte PRs (30 T.)
- 2
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Kein Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus rubyjs/mini_racer
-
bug/crash platform: linux/x86
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 42/100
rubyjs/mini_racer#422 · 10 Kommentare ·
-
platform: darwin/x86
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
rubyjs/mini_racer#388 · 4 Kommentare ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 20/100
rubyjs/mini_racer#376 ·
-
Load script as moduleOffen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
rubyjs/mini_racer#353 ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
rubyjs/mini_racer#346 · 6 Kommentare · 1 Reaktion ·
Alle Issues in rubyjs/mini_racer
Ähnliche Issues
-
bug Frontend P2-medium UI UX
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 76/100
Deepak3699/Ai_Mentor#427 ·
Maintainer antworten meist innerhalb von 1 Tag
-
needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
11ty/buildawesome#4407 · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
keyxmakerx/Chronicle#1711 ·
Maintainer antworten meist innerhalb von 1 Tag
-
frontend
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 69/100
uoftblueprint/canada-basketball#79 ·
Maintainer antworten meist innerhalb von 1 Tag
-
New App Request
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 76/100
ThatGuySam/doesitarm#1126 · 1 Kommentar ·