Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I wonder if it's possible to craft a non-gigantic C++ file which causes a clang frontend to crash.


This is possible in almost all language, even Python (!!!) - see the Stack Overflow question https://codegolf.stackexchange.com/questions/69189/build-a-c...


ICEs [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.


There is this funny competition: 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.


For sure. Generally it boils down to a non-gigantic number of template instantiations or macro expansions that end up generating a huge parse tree.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: