Stack overflow for lab4 in good7.fun

66 views
Skip to first unread message

Björn Johansson

unread,
Mar 12, 2014, 1:02:15 PM3/12/14
to proglang-c...@googlegroups.com
I am getting a stack overflow when running good7.fun. This seems like a natural consequence of the deep level of recursion required to process the number 111111. I guess this test was created for that particular reason but I don't understand how I can avoid this. Any hints?

Björn Johansson

unread,
Mar 12, 2014, 1:06:24 PM3/12/14
to proglang-c...@googlegroups.com
So a quick follow up. Simply increasing the stack size for the JVM solves the issue. I changed my script to "java -Xss40m ..." and everything was OK. Is this an acceptable solution?

Inari Listenmaa

unread,
Mar 12, 2014, 2:04:26 PM3/12/14
to proglang-c...@googlegroups.com
Yes, this is acceptable. As long as it works on some input; you can also just change the number to a smaller one (e.g. 111 instead of 111111).

Inari
Reply all
Reply to author
Forward
0 new messages