March 14, 2026
When your code ghosts the OS
Making your JITted Code known: Let me count the ways
Windows vs Linux brawl as ‘invisible’ code crashes apps and devs point fingers
TLDR: A Windows compiler change exposed that JIT code needs proper “ID badges” so crashes can be handled safely; without them, things break. The comments erupted into a Windows-vs-Linux blamefest, with devs trading war stories over jump-back tricks and agreeing JITs must play by each platform’s rules.
A deep-dive on how just-in-time (JIT) code needs to “introduce itself” to the system turned into a platform soap opera, with devs swapping war stories and roasting each other’s setups. The gist: ahead-of-time compilers ship handy breadcrumbs so crashes and errors can be traced. But MoarVM, which powers the Raku language, hit chaos on Windows when a Microsoft compiler change made a jump-back trick start fully “walking the stack,” demanding those breadcrumbs from on-the-fly JIT code. Without that info, things fell over—fast.
Cue the comment-section fireworks. One coder, [kgeist], said they had the exact opposite experience: Windows sailed through, Linux face-planted after the first piece of JIT code. That lit the fuse on classic OS tribalism. Windows folks joked their system “politely looks away,” while Linux loyalists clapped back that it’s stricter because “correctness matters.” Memes flew: “My stack unwound more than my weekend plans,” and “JIT frames are vampires—you have to invite them in.”
The spiciest take? People arguing whether sneaky tricks like longjmp/setjmp (a jump-back shortcut) are genius hacks or gremlins waiting to strike. The consensus-ish: JIT code needs proper ‘ID badges’ (metadata) or the OS will toss it out of the party, and every platform enforces the dress code differently. Drama, delivered.
Key Points
- •AOT compilers emit metadata such as symbols and debug info to support linking, tooling, and diagnostics.
- •Exception handling relies on runtime tables that guide stack unwinding and per-frame cleanup without extra code in every function.
- •MoarVM, written in C, runs Raku/nqp and uses setjmp/longjmp to implement exception-like control flow separate from the C stack.
- •On Windows, a change in MSVC made longjmp perform full frame-by-frame stack unwinding, breaking MoarVM builds starting with a specific version.
- •The new longjmp behavior necessitates proper unwind metadata, whereas earlier C code could rely on restoring the stack pointer alone.