The goal is to raise the error message with the most bytes! The error message may not be generated by the program itself, such as Python's raise. errors that do not terminate the program are not allowed unless they do not show an error message.

Here is an example in python that raises 243041 bytes of error code:

def a(m):
        if m>0:

you can try it here.

  • 2
    \$\begingroup\$ That's not true for all languages; many languages will continue execution after an exception is thrown \$\endgroup\$ – Zaelin Goodman Jan 21 at 19:28
  • 4
    \$\begingroup\$ This feels less like a code challenge and more like a challenge to find the language with the most verbose error messages. \$\endgroup\$ – Shaggy Jan 21 at 19:44
  • 3
    \$\begingroup\$ So, maybe I'm missing something about Python, but doesn't your example utilize errors that do not terminate the code execution, seeing as they are trapped in a try block? If that's so, is it allowed to utilize errors that do not terminate code execution, so long as the code does eventually terminate; or is the example rendered invalid by this clarification? \$\endgroup\$ – Zaelin Goodman Jan 21 at 19:48
  • 3
    \$\begingroup\$ I think this is a duplicate of really any challenge involving printing big numbers e.g. this or this, as answers aren't going to do anything other than "generate big number, repeat string that many times, execute" as having a long string is usually an error. I'd VTC as a duplicate of one of them if I hadn't already VTCed as unclear, but even if this is clarified and reopened, I still believe it should stay closed \$\endgroup\$ – caird coinheringaahing Jan 21 at 20:20
  • 1
    \$\begingroup\$ @user In it's current state, I stand by my VTC as unclear, as the challenge needs a proper description of an "error", but challenges don't need to be exact duplicates to be closed as one another \$\endgroup\$ – caird coinheringaahing Jan 21 at 20:47

APL (Dyalog Unicode), limited only by available memory

Full program. Causes error message a bit bigger than twice the given number.


Try it online!

⎕A the uppercase Alphabet

2e6⍴ cyclically reshape to a string with two million characters


This causes an error of the form:

VALUE ERROR: Undefined name: string
  • \$\begingroup\$ if you theoretically had an infinite memory, how long would the error be? \$\endgroup\$ – someone Jan 21 at 19:55
  • \$\begingroup\$ @someone Simply increase the number (2e6 in the post) until the memory fills. \$\endgroup\$ – Adám Jan 21 at 19:57
  • \$\begingroup\$ if you increased the number enough, it would be bigger that one hundred bytes, which is the maximum allowed size, so you can't enlarge the number forever. \$\endgroup\$ – someone Jan 21 at 20:00
  • \$\begingroup\$ @someone The universe is estimated to be able to contain about 10¹²² bits, i.e. about 10¹²² bytes, so since we're using exponential format, 1e6 would simple need to be replaced by the 2 bytes longer 1e122, possibly adding a few bytes for more significant digits, once the exact number is known. \$\endgroup\$ – Adám Jan 21 at 20:05
  • \$\begingroup\$ Given the limit is 100 bytes, surely something like ⍎9e999...99⍴⎕A with enough 9s to get to 100 bytes would be the best score? \$\endgroup\$ – caird coinheringaahing Jan 21 at 20:06

Python 3, \$\approx\$A(A(A(9,9),A(9,9)),A(A(9,9),A(99,99))) where A is the Ackermann function,or limited by RAM

A=lambda m,n:m and A(m-1,n<1or A(m,n-1))or-~n

Don't try it online!

Stole the Ackermann function from here.

More manageable version to demonstrate:

A=lambda m,n:m and A(m-1,n<1or A(m,n-1))or-~n

Try it online!

Admittedly I'm not certain this approach is arbitrarily extendible in practice.

  • \$\begingroup\$ I think you can squeeze in a few more 9s, or one more A(), by moving the second line into the exec and eliminating a=. But either way it seems that the recursion limit needs to be increased (massively) to produce the intended error. I gather that this can be done (in principle) via sys.setrecursionlimit, but I'm not sure whether there's a policy on counting the bytes required to do this. \$\endgroup\$ – Dingus Jan 21 at 22:40

Jelly, a huge number \$ + 1605\$ bytes


Try it online!

More specifically, this outputs an error message which is 1605 bytes long, plus two occurrences of massive chains of .... Unsurprisingly, this does not actually show an error really no matter where you run it, but in theory it will

How it works, and what the number is

The basic strategy is simple: create a massive number, repeat "." that many times, then run as Python code, throwing a syntax error.

The first line is a helper link which we use to calculate a number with Knuth's up-arrow notation. We're calculating \$z \uparrow^z z\$.

\$z\$ is absolutely huge. For convenience, we'll say \$t = { {2^{32}} ^ {2^{32}} }\$. To start, we'll take


This yields \$u_t\$ where

$$u_0 = t \\ u_n = u_{n-1}^{u_{n-1}}$$

We then take the related value \$u'_t\$ where

$$u'_0 = t, u'_1 = u_t, u'_2 = u_{u_t}, \dots$$

then \$u''_t\$ where

$$u''_0 = t, u''_1 = u'_t, u''_2 = u'_{u'_t}, \dots$$

and so on, until \$x = u''''''''''''''''''''''''_t\$ (that's 24 \${}'\$s).

Finally, we yield \$z = x^x\$ and calculate \$z \uparrow^z z\$.


Zsh, \$4\times(9\times10^{307})^{32}+47\$ bytes

alias r=repeat\ 9e307
r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r a+=1111
let $a

Try it online!

Generates a string containing \$4\times(9\times10^{307})^{32}\$ ones, then tries to evaluate it as an integer.

In practice you will obviously run into memory limitations. Here is a more manageable version:

repeat 9e1 repeat 9e1 a+=1
let $a
  • alias r=repeat\ 9e307 allows us to nest more repeats in the 100 bytes we have
  • 9e307 (\$9\times10^{307}\$) is the largest compact finite floating-point number zsh might be able to count to

Java 11, repeat error message [231 - 1] times

String's Maximum length in Java is Integer.MAX_VALUE i.e. == 231 - 1, or less, it depends on server max memory size and other conditions otherwise it produces OutOfMemoryError.

  1. You can throw some Error with the certain message, for example:

    throw new Error("fatal".repeat(Integer.MAX_VALUE/5));

    Number of times to repeat is Integer.MAX_VALUE / 5 - because "fatal" is 5 chars.

  2. You can return something like this. It is not the error itself, but the error message:

    for(int i=0;i<Integer.MAX_VALUE;i++){
        String m="fatal"+i;

Not the answer you're looking for? Browse other questions tagged or ask your own question.