3 ms·
I wonder if it's possible to craft a non-gigantic C++ file which causes a clang frontend to crash.
by msla 7y ago
I wonder if it's possible to craft a non-gigantic C++ file which causes a clang frontend to crash.
- earenndil 7y agoFor sure. Generally it boils down to a non-gigantic number of template instantiations or macro expansions that end up generating a huge parse tree.
- jeeyoungk 7y agoThis is possible in almost all language, even Python (!!!) - see the Stack Overflow question https://codegolf.stackexchange.com/questions/69189/build-a-compiler-bomb https://codegolf.stackexchange.com/questions/69189/build-a-c...
- pnako 7y agoThere is this funny competition: https://tgceec.tumblr.com/ https://tgceec.tumblr.com/ You could pick the winning entries and use them as a corpus for a fuzzer and you might find compiler crashes.
- gpderetta 7y agoICEs [1] used to be very common from all front ends especially with malformed template code, but now a day I think most compilers don't report an ICE to the user as long as they managed to issue at least one diagnostic. It is still not uncommon to se ICEs on some extreme template constructs. [1] Internal Compiler Error, i.e. the compiler segfaulted or hit an internal assertion.