-
-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StackOverflowError on 1.3.186 but script properly working with 1.3.185 #1642
Comments
Strangely when I change the (defn filter-empty-dirs
([entries]
(let [groups (group-by #(dir? %) entries)
dirs (map #(.path %) (groups true))
files (map #(.path %) (groups false))]
(filter-empty-dirs files dirs)))
([files dirs]
(println (count files) (count dirs)) # This line makes it work
(if (empty? files)
dirs
(let [[current-file & rest-files] files]
(->> dirs
(remove (path-components current-file))
(recur rest-files)))))) |
I am repro-ing with docker with 1.3.185 and it also gives an SO:
You can fix this by making
|
Thnks!!!! |
Strangely it does not fail for me when I use 1.3.185 docker image as you do. But it does when I use 1.3.186. |
It could be that the stack size is slightly different in your case, but lazy expression don't mix well with deeply recursive code and is known to cause such problems sooner or later. |
Great!!! Thank you for your patience. |
I have an script with a tail recursive function that works properly on babashka version 1.3.185 but fails with java.lang.StackOverflowError on 1.3.186.
version
1.3.186
platform
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=20
DISTRIB_CODENAME=ulyana
DISTRIB_DESCRIPTION="Linux Mint 20 Ulyana"
problem
The script brokens with java.lang.StackOverFlow but only on babashka 1.3.186.
repro
The files.txt file should be present at the current directory when the script gets executed.
expected behavior
When executed with babashka 1.3.185 it properly lists:
The text was updated successfully, but these errors were encountered: