57 Small Programs that Crash Compilers
I noticed there are no MSVC examples in there — was it not a targeted compiler? If so, I’m curious as to why.
[This piece is co-authored with Vsevolod Livinskii.] Formal verification isn’t some sort of magic pixie dust that we sprinkle over a computer system to make it better. Real formal verification involves a lot of the same kind of difficult, nasty, grungy engineering work that any other systems-level job involves…
Visit blog.regehr.org → RSS feedOn Hacker News May 2010 – Aug 2023
Software Engineering 34Programming Languages 20Systems & Performance 8Life, Learning & Writing 6Security & Privacy 5Career & Management 3
I noticed there are no MSVC examples in there — was it not a targeted compiler? If so, I’m curious as to why.
Mutation-based fuzzing is based on the idea that new, bug-triggering inputs can often be created by randomly modifying existing, non-bug-triggering inputs. For example, if we wanted to find bugs in a PDF reader, we could grab a bunch of PDF files off the web, mutate them by flipping a few bits or something, and feed…
Interesting post, but you lost me at “Let’s try to do that using undef”. Why bother with notions of an “undef value” (or “deferred UB”), when plain UB is all you need?
Are you arguing that undefined behaviour should not be a thing in, e.g., C? It sounds like you’re claiming that the fabled sufficiently smart compiler could take code in a C-like language with no UB, and emit something equivalent to what a C compiler would produce given equivalent input in C that correctly avoids UB…
My hope would be option 1 for application code (as opposed to the “systems code” that you have there): fewer and fewer people use these languages to write application code. Moreover, I think that’s probably happening to some extent.
An “optimizer” should really be called an “improver”, and a “superoptimizer” should be called an “optimizer” 🙂
Hello, My name is Nadav and I am a PhD candidate, researching compilers for embedded systems and high-level synthesis. This is an excellent post and I enjoyed reading it. I have a few comments. 1. I agree about verification and optimization joining forces. We already see it to some extent with compiler warnings. 2…
(You probably already have realized this.) The reason the compiler produced code that terminated was based upon the fact that the values being altered (i.e., a, b and c) within the “while” loop are never referenced again after the loop. But, once you added code which printed the resulting values it was forced to…