Fixing StackOverflowError on travis-ci when running clojurescript tests


Recently i received strange error when running clojurescript tests on travis-ci:

$ lein2 cljsbuild test
...
Compiling "target/cljs-test.js" failed.
Exception in thread "main" java.lang.StackOverflowError, compiling:(/tmp/form-init311799534829133165.clj:1:89)
	at clojure.lang.Compiler.load(Compiler.java:7142)
	at clojure.lang.Compiler.loadFile(Compiler.java:7086)
	at clojure.main$load_script.invoke(main.clj:274)
	at clojure.main$init_opt.invoke(main.clj:279)
	at clojure.main$initialize.invoke(main.clj:307)
	at clojure.main$null_opt.invoke(main.clj:342)
	at clojure.main$main.doInvoke(main.clj:420)
	at clojure.lang.RestFn.invoke(RestFn.java:421)
	at clojure.lang.Var.invoke(Var.java:383)
	at clojure.lang.AFn.applyToHelper(AFn.java:156)
	at clojure.lang.Var.applyTo(Var.java:700)
	at clojure.main.main(main.java:37)
Caused by: java.lang.StackOverflowError
...

But locally all worked ok. And i found simple solution – increase thread stack size up to 16mb by adding this line to my project.clj:

:jvm-opts ["-Xss16m"]

As a result travis-ci build succeeded.



comments powered by Disqus