nodejs / nodejs/node

deps: backport V8 LLE alias fix to 26.x and 24.x

Ouverte
#66,112 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
JavaScript
Étoiles
122k
Forks
37.4k
Merge moyen
4 j 3 h
PR mergées (30 j)
272

Description

Summary

Please backport V8 commit b44239fe / V8 bug 554421904, "Turboshaft LLE: non-writing calls can create aliases", to the active Node.js 26.x and 24.x release lines.

This is the same upstream V8 miscompilation tracked in #66083 for 26.x, but 24.x is also affected by default: Node 24 ships V8 13.6 with Turboshaft load elimination enabled by default, and the minimized reproducer returns the wrong value there too.

Version

Reproduced locally with:

  • v26.9.0 / V8 14.6.202.34-node.32
  • v24.18.0 / V8 13.6.233.17-node.50

Source check after fetching current tags/branches:

  • upstream/v26.x and upstream/v26.x-staging: V8 14.6.202.34, no regress-554421904 test
  • upstream/v24.x and upstream/v24.x-staging: V8 13.6.233.17, no regress-554421904 test

Platform

macOS arm64

This appears to be a compiler optimization bug rather than platform-specific behavior.

Subsystem

V8 / deps

What steps will reproduce the bug?

Run the minimized reproducer from #66083 with native syntax enabled:

node --allow-natives-syntax v8-lle-poc.js

I also checked the relevant runtime flag defaults:

  • 26.x: --turboshaft-load-elimination is enabled by default
  • 24.x: --turboshaft-load-elimination is enabled by default
  • 22.x: --turboshaft-load-elimination is disabled by default, so this request is intentionally limited to 26.x and 24.x

How often does it reproduce? Is there a required condition?

It reproduced consistently for me on both default-affected lines listed above.

The reproducer requires optimized code and the Turboshaft load-elimination pass. That pass is enabled by default on the Node 26 and Node 24 builds tested.

What is the expected behavior? Why is that the expected behavior?

The store to staleArray[7] should be preserved, so the returned array slot should contain 1.1:

staleArray[7]: 1.1 | expected: 1.1 | OK
RESULT: NOT TRIGGERED on this build

What do you see instead?

Node 26:

v26.9.0 V8 14.6.202.34-node.32
staleArray[7]: undefined | expected: 1.1 | WRONG!
RESULT: BUG TRIGGERED — Turboshaft LLE eliminated a valid store

Node 24:

v24.18.0 V8 13.6.233.17-node.50
staleArray[7]: undefined | expected: 1.1 | WRONG!
RESULT: BUG TRIGGERED — Turboshaft LLE eliminated a valid store

Additional information

The upstream fix is small and directly addresses the alias invalidation ordering in Turboshaft late load elimination:

The current 26.x and 24.x V8 snapshots still have the vulnerable early !op.Effects().can_write() bailout before invalidating non-aliasing inputs in deps/v8/src/compiler/turboshaft/late-load-elimination-reducer.cc.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par deps/v8/src/compiler/turboshaft/late-load-elimination-reducer.cc et comparez les snapshots V8 actifs 26.x et 24.x avec le commit upstream b44239fe. Exécutez v8-lle-poc.js avec node --allow-natives-syntax sur les deux lignes de release, puis vérifiez que le correctif upstream et la couverture de regress-554421904 sont présents et que le reproducer renvoie 1.1.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
javascript
Domaine
compilers, release
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Active
Clarté
Clairement spécifiée
Accessibilité débutants
52/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.