June 29, 2026

Stack attack, but make it safe

Memory Safe Context Switching (longjmp, setjmp) in Fil-C

Fil-C picks a fight with one of C’s messiest tricks — and the comments got spicy

TLDR: Fil-C says it can tame one of C’s oldest and messiest jump-based features so bad code crashes safely instead of corrupting memory. Commenters split between impressed curiosity, “this is still risky,” and classic nitpicking over whether the article oversold old context-switching tools.

A niche programming update somehow turned into a mini comment-war, because Fil-C claims it can make some of C’s most infamous escape hatches — the ones that let programs “jump” around and switch stacks — behave safely instead of exploding into weird crashes. In plain English: this is about stopping old-school low-level code from leaping back onto memory that no longer exists, a bug class that can cause baffling failures or even security nightmares. Fil-C’s pitch is bold: in normal C, this stuff can go full chaos; in Fil-C, bad uses are either blocked or turned into clean panics instead of silent disaster.

And wow, the peanut gallery had thoughts. One commenter immediately swerved into AI speculation, bluntly asking, “Is Fil-C now using Claude for dev?” — the kind of drive-by remark that instantly changes the vibe from technical deep dive to gossip thread. Others were more serious, warning that even if memory safety is fixed, code built around these ancient jump tricks can still have a much bigger risk profile. Translation: “Congrats on putting seatbelts on the clown car, but it’s still a clown car.”

Then came the correctness police. One skeptical voice flatly argued these functions have “no bearing on safety”, while a more curious commenter pushed back with a softer, almost delighted reaction: they’d assumed this was impossible and admitted they’d barely even heard of one of the older context-switching tools. Meanwhile, a performance-minded Boost fan popped in to say, essentially, don’t get it twisted — the article’s mention of ucontext made it sound more mainstream than it is, and in their view it’s the “incredibly slow fallback.” So yes, the release is technical — but the real show is the community splitting into camps: impressed, suspicious, pedantic, and gloriously nitpicky.

Key Points

  • Fil-C added memory-safe support for `setjmp`/`longjmp` and, since release 0.680, ucontext APIs including `setcontext`, `getcontext`, `makecontext`, and `swapcontext`.
  • The article states that misuse of these APIs in Fil-C cannot cause stack corruption or violate Fil-C’s capability model.
  • It identifies common unsafe scenarios in conventional C environments, such as restoring a context after its stack frame has disappeared or after a thread stack has been freed.
  • The article says Fil-C prevents dangling-stack execution by either treating misuse as a safety panic or by managing stacks so execution remains legal.
  • A sample C program is used to explain `setjmp`/`longjmp` behavior, including why a variable must be declared `volatile` to reliably preserve its value across the control transfer.

Hottest takes

"Is Fil-C now using Claude for dev?" — brcmthrowaway
"code that uses setjmp/longjmp often has a risk profile that’s way bigger than memory safety alone" — gruntled-worker
"Maybe for the incredibly slow fallback" — nanolith
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.