3 ms·
Not entirely of the same vein, but this C++ stacktrace bomb is one of my favourites: struct x struct z<x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(y,x(y><y*,x(y*w>v<
by shakna 6y ago
Not entirely of the same vein, but this C++ stacktrace bomb is one of my favourites:
struct x struct z<x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(y,x(y><y*,x(y*w>v<y*,w,x{}
A tiny 79 bytes that explodes into a huge stacktrace that takes an inordinate amount of time to finish processing.
- colejohnson66 6y agoHow is this supposed to work?
- phoe-krk 6y agoTry compiling it. The compiler will scream at you for a long long time. Also see https://codegolf.stackexchange.com/questions/1956/generate-the-longest-error-message-in-c https://codegolf.stackexchange.com/questions/1956/generate-t...
- colejohnson66 6y agoAh. I was confused by your usage of the word "stacktrace" which, to me, means an exception stack trace, not an error message. For those curious: $ g++ test.cpp 2>&1 > /dev/null | wc -l 10223622 Ten million lines.
- phoe-krk 6y agoWasn't "my" usage per se since I'm not the original comment author, but yes, I too find this term confusing in this context. A stack trace to me usually means a textual dump of a call stack printed from some point of the program execution (usually an error site and/or a breakpoint), not compiler output that contains no information about the compiler's runtime stack.
- Sharlin 6y agoIn this case the error message contains information about the compiler's template instantiation stack which is rather analogous to the stack trace of a recursive function. But yeah, a somewhat nonstandard usage.
- gpderetta 6y agoI would say that 'stacktrace' is appropriate. The template expansion machinery is pretty much a purely functional language and the compiler is the interpreter. The stacktrace in this case is not of the interpreter itself but of the program being executed. In fact understanding that template error messages are none other than execution stack traces is key to making sense them.
- deleted 6y ago[deleted]