StackOverflowError when parsing with parse-file (1)
When parsing certain files I occassionally get a StackOverflowError: http://pastebin.com/HG3PgnWUSubmitted by Zef Hemel on 13 April 2010 at 12:08
It turns out that Spoofax is unintentionally converting all ATerm parse trees into StrategoTerm parse trees. It’s definitely not supposed to do that as it costs a lot of time and space, not to mention that it can trigger stack overflows.
This can probably be fixed by turning all WeakHashMaps in SourceMappings into IdentityWeakHashMaps. Note that IMPParseStringPTPrimitive.mappings should also be an IdentityWeakHashMap, and probably all other instances of WeakHashMap should be changed since a WeakHashMap with object equality makes no sense whatsoever. Maybe we could use Google collections, where they fixed this, or we could add our own little subclass of WeakHashMap.
Should be fixed in 0.4.4.
Sadly, it’s not fixed. This error still occurs.
Actually, this bug was fixed “again” in 0.4.4.1. I’ll upload it to the “unstable” update site.
Log in to post comments