logoalt Hacker News

Neywiny • yesterday at 9:31 PM • 2 replies • view on HN

Interesting they show clangd crashing in vscode. That's been my biggest gripe with it. But they also show clice crashing in the same spot? Seems odd to not just fix it


Replies

quacker • today at 1:10 AM

They explain exactly why in article:

Because C++ is simply too complex, and on certain corner cases the compiler can easily crash or leak memory. That is especially true for incomplete code in the middle of editing: a huge downstream user base tests compilers on complete code, while very few people test them on half-written code, where the compiler mostly falls back on best-effort heuristics

It's the compiler that crashes. Both clangd and clice are built on top of the same compiler (clang) which is why both experience a crash on the same code.

dwattttt • yesterday at 10:04 PM

I'm not a C++ expert, but I don't see anything in the shown snippet that would cause a language server crash, so I imagine the server is crashing on something off screen.

I could understand them showing off crash recovery by using code deliberately written to crash the language server, and so not being something you can "fix".