config
config copied to clipboard
StackOverflowError when using the concatenation operator
It is possible to easily trigger a StackOverflowError
during resolution if using the concatenation operator a large number of times.
For example the following test case is likely to fail with the exception:
val config = (1 to 1000).map { i => s"a += $i" }.mkString("\n")
val values = ConfigFactory.parseString(config).resolve()
assertEquals("lists did not merge", Seq.range(1, 1001), values.getIntList("a").asScala
(Note that it would fail too with a lower number of concatenations if substitution tracing was enabled)
I have to increase JVM stack size to 4 MB as a workaround. Substitutions should not be parsed recursively.
This is still a huge issue for me. @havocp, do you think it can be easily fixed?
No idea, I haven't looked...