Landed JS argument inspection support in the GDB & LLDB plugins for V8, for both live and coredump debugging
- bt now shows previews of JS arguments for JS frames
- New `v8 args` command to show arguments of selected frame
- `v8 inspect` now takes this, arg names and indices
It's been a great experience to contribute to the V8 upgrades for the 27 release and improve the V8 upgrade process in Node.js in the past months. Thanks @TechAtBloomberg for supporting my work on this :D
Last week, the new Node.js 27 Alpha release upgrades V8 to version 15.6, from the 14.6 used by Node.js 26. Let's take a closer look at what this means for developers and what the new version of V8 brings.
- New JS features and language changes
- Performance improvements
- Memory usage and GC changes
- Diagnostic and tooling changes
- Behavior differences
..and more!
https://t.co/sp66IST7eU
Observations:
- It was easier to find multipage spec and check history with the C++ spec anchor compared to ecma262
- pre-commit CI coverage of high-impact C++ compiler projects is small when compared to Node.js/V8
- There is a visible test262-shaped void in the C++ world
Landed fixes in GCC & Clang for [expr.static.cast]/8 wrong-code bugs when investigating a V8 bug related to it. Previously:
enum Flag : bool { kNo, kYes };
static_cast<Flag>(2); // kNo in GCC β, kYes in Clang β
static_cast<Flag>(0.5); // kNo in GCC and Clang β
There were more docs to update when changing semantics in Clang, had to educate myself with the release process before finishing the commit
Clang commit
https://t.co/i6afWKOZ8D
Made the new debug helper plugins work for Node.js + bleeding edge V8 π Verified it works in LLDB (Linux, macOS) & GDB (Linux), both in live and coredump debugging
Going to backport the patches to Node.js when the object inspection is more polished and it stablizes bit more..
Added some new commands to the GDB & LLDB plugin for V8..
`v8 source`: shows the JS source of the selected frame
`v8 isolate`: find the isolate address in the current thread, works from the coredump too (implementing that in LLDB was quite a bit of challenge!)
@matteocollina It does on this branch of mine https://t.co/6SQrqhadFj (which was based on v8 15.1), it will take some time to get them rolled into Node.js, but most stuff is backportable
@matteocollina@jdalton Testing Server.prototype._listen2 is monkey patchable π π»ββοΈ
Testing diagnostics channel work for intercepting listens ππ»ββοΈ
Whether it's done by AI makes no difference, it's whether the author verify how much sense the tests make and DONT OVERFIT
@lemire@matteocollina@nodejs Most kernel in the wild donβt enable CONFIG_READ_ONLY_THP_FOR_FS, then MADV_HUGEPAGE is still no-op on the file-backed .text. AFAICT that flag works around the rollout complexities by relocating to a chunk of anonymous memory so MADV_HUGEPAGE is effective on more configurations
Made the new debug helper plugins work for Node.js + bleeding edge V8 π Verified it works in LLDB (Linux, macOS) & GDB (Linux), both in live and coredump debugging
Going to backport the patches to Node.js when the object inspection is more polished and it stablizes bit more..
Landed some improvements to errors for require(esm) with top-level await (behind --experimental-print-required-tla for now):
- No need to run the code to collect the TLA locations, so it can be enabled by default soon
- Added require stack and location metadata to the error
@matteocollina@lemire You already know that I recently just got two reports classified as βnot vulnerabilities but things we can harden with a public PR to avoid spec violationβ :)
I think what helped was clarifying the boundaries in the threat model and adding more boundaries as we learn
New to open source, or wondering how to get your first Node.js contribution landed and released?
Check out our new first-time contributors guide, with practical tips and answers to FAQs about working with our volunteer-driven model. Welcome aboard! π€
https://t.co/6R0FWUroiL
Today I gave a talk @thejsnation about the life cycle of ESM in Node.js, how it differs in other environments and the new features that will affect these stages. Slides: https://t.co/Nlc2Hua4ne
@mmomtchev I do have some plans to follow this up with a new Node.js extension (because the mechanism powering llnode is going away and too hard to maintain), though whether a replacement can be hosted in the Node.js organization will still depend on consensus of other contributors.
Moving along with the debug_helper-based LLDB & GDB V8 plugins, this now supports basic object inspection! It was fun to write tests that deliberately corrupt the memory and ensure the plugin falls back gracefully, something I've never tried before when maintaining other plugins!
@mmomtchev Node.js doesn't really have a dedicated team; in the past some plugins like these (like llnode) are maintained by a group of contributors as separate project under the Node.js GitHub organization, some of them (like mdb_v8) are hosted in other organizations.