Sitemap

A libc++ Odyssey

16 min readApr 28, 2021

--

This was originally an internal essay published to the Electron Maintainers group. For context, Electron continually tracks the latest version of Chromium, generally landing an update into the main branch once every week or two. Some upgrades are more difficult than others.

who kindly Zoomed with me while I sobbed into the debugger. And by “debugger”, I of course mean printf. I added two printf calls, one in nan_typedarray_contents.h right before the failing call to GetBackingStore(), and one inside GetBackingStore() itself. To explain what I saw I have to take a q̶u̶i̶c̶k (lol sorry) detour into some V8 internals. It’ll only hurt a bit, I promise.

Press enter or click to view image in full size
“Wait, it’s all just numbers?” / “Always has been” (astronaut meme)

Also, as a side note, we now know why IsSmi was returning true: the low bit of 0x4f00000070 is 0, so it passes the HAS_SMI_TAG check. It’s just that that’s … not the Address of our object.

kindly bisected for me): it broke when we rolled chromium from 1f252b391..90.0.4415.0.

Thanks to

for reviewing drafts of this article, and to Deepak Mohan for encouraging me to publish it as a blog post.

--

--