Skip to content

Instantly share code, notes, and snippets.

@c2nes
Created September 30, 2012 16:36
Show Gist options
  • Save c2nes/3807494 to your computer and use it in GitHub Desktop.
Save c2nes/3807494 to your computer and use it in GitHub Desktop.
Generates a Test.java file that causes a stack overflow exception when compiled with javac
(
echo 'public class Test {'
echo ' public void test() {'
echo -n ' int n = '
for i in {0..10000}; do
echo -n '(';
done;
echo -n 1;
for i in {0..10000}; do
echo -n ' + 1)';
done
echo ';'
echo ' }'
echo '}'
) > Test.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment