JSON.parse failure on deeply nested input corrupts the string; later split() returns non-array, then FATAL 'Not a native context' (v26)
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 45/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- javascript, node.js
Rechercherichtung
Start by reproducing the supplied snippet on Node.js v26 and compare its output with v20, v22, and v24; the report points to the V8 JSON parser’s deep-nesting error path and subsequent string split. Trace the parser behavior and the relevant V8 or Node.js regression tests, then add a regression test showing that a caught parse error leaves the input usable by split() and does not abort on exit.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Version
v26.13.0 (official node:26-slim image, V8 14.6.202.34-node.40); also v26.8.1 (Arch Linux package). Not reproducible on v20.20.2, v22.23.4, v24.22.2.
Platform
Linux x86_64
Subsystem
v8
What steps will reproduce the bug?
const t = '[1,\n'.repeat(10000) + '1]'; // nested ~10,000 arrays deep, unclosed
try { JSON.parse(t); } catch {} // throws (expected)
const s = t.split('\n');
console.log(Array.isArray(s), s.length); // expected: true 10001
Same result with --no-maglev --no-turbofan.
How often does it reproduce? Is there a required condition?
Every time with the snippet above: a failing JSON.parse on a string nested several thousand levels deep, then split on the same string.
What is the expected behavior? Why is that the expected behavior?
true 10001, as on Node 20, 22 and 24. A caught parse error must not affect later operations on the input string.
What do you see instead?
false 3, then the process aborts on exit:
FATAL ERROR: Context::GetNumberOfEmbedderDataFields Not a native context
4: v8::Context::GetNumberOfEmbedderDataFields()
5: node::Environment::GetCurrent(v8::Isolate*)
6: node::async_context_frame::set(...)
...
Aborted (core dumped)
In a larger app the same shape aborted with Check failed: IsName() or a SIGSEGV.
Additional information
Found when a service parsed a ~380 KB model output beginning with [. Our workaround is to check nesting depth before calling JSON.parse. Looks like the JSON parser's stack-overflow path leaves the string (or heap) in a bad state; it may belong upstream in V8.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 124k
- Forks
- 38k
- Ø Merge
- 4 T. 2 Std.
- Gemergte PRs (30 T.)
- 266
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
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 nodejs/node
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 69/100
Maintainer antworten meist innerhalb von 1 Tag
-
fs: document readStream.start and readStream.endEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offendoc
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
nodejs/node#67848 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
doc: document the Buffer.prototype.*Slice() methodsEvtl. vergeben @AyushCipher hat das heute übernommen. Offendoc
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
nodejs/node#67847 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
`styleText` fast path bypasses `options` and `options.validateStream` validationEvtl. vergeben @GBra-4-669 hat das vor 8 Tagen übernommen. Offenutil
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
riscv64
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
nodejs/node#67655 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Ähnliche Issues
-
bug triage needed
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 2 Tagen
-
[Resource]: PersephoneOffenresource-submission validation-passed
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
hesreallyhim/awesome-claude-code#3773 · 1 Kommentar ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 73/100
tabatkins/railroad-diagrams#129 ·
-
web: api() turns a null or object-valued error body into a TypeError or "[object Object]" and loses the statusEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
OCM: shares using the `embedded` protocol are rejected with "Missing sharedSecret in protocol"Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag