Snapshot#warmup! aborts when the warmup code creates an Intl object (CheckGlobalAndEternalHandles failed)
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 52/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- javascript, ruby
- Domaine
- backend, embedded-iot
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- JavaScript
- Étoiles
- 628
- Forks
- 100
- Merge moyen
- 1 j 20 h
- PR mergées (30 j)
- 2
Préparer son environnement
- Fournit un Dockerfile ou un fichier Docker Compose
- Aucun modèle de pull request
- Aucun guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de rubyjs/mini_racer
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
rubyjs/mini_racer#449 ·
-
Snapshot.load accepts a blob from another V8 version, and Context.new then kills the processOuverte
Difficulté 4/5 3-5 jours Accessibilité débutants 52/100
rubyjs/mini_racer#448 ·
-
bug/crash platform: linux/x86
Difficulté 4/5 3-5 jours Accessibilité débutants 42/100
rubyjs/mini_racer#422 · 10 commentaires ·
-
platform: darwin/x86
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
rubyjs/mini_racer#388 · 4 commentaires ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 20/100
rubyjs/mini_racer#376 ·
Toutes les issues de rubyjs/mini_racer
Issues similaires
-
type/bug
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 66/100
Les mainteneurs répondent en général sous 1 jour
-
Update to mocha 12.xOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
rescript-lang/rescript#8996 ·
Les mainteneurs répondent en général sous 1 jour
-
Add: Ministerstvoidey.ruOuvertecheck:passed logos:add
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100