-
Notifications
You must be signed in to change notification settings - Fork 236
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
propagation (of new files in a directory?) uses 6 stack frames per file, rather than iterating (NOT ABOUT ocaml 5.x!!) #990
Comments
I am unable to reproduce this stack growth. @olafhering could you please report the full version you were using, including the version of the compiler used. Are you using a different version on the remote end? Please also report any non-default preferences that might impact the syncing process (you can leave out prefs such as ignore, paths, etc.). Is the remote (in this case, the receiving) end significantly slower than the sending side, or is there high latency in the network? If you can reproduce the crash with the GUI, could you try and see if the stack starts growing with the text UI. If you can reproduce the crash then some things to try:
|
Both unison binaries are identical. They are built with dune, using OCaml 4.14.1. Both systems are in the same LAN, connected via 1G. While looking at the I will see if I can reproduce it again with this new finding. |
The I guess you already answered it, but just in case: have you used any preference like If you manage to reliably reproduce the issue, could you then try with version 2.53.0 and see if it works there? |
I've done some more debugging and can see the same code being executed, yet the stack is not growing (and I'm testing with far larger directory trees). I see this as unlikely but it could be that your binary is not properly optimized. If you manage to reproduce the issue, could you try with a binary that is built in a different environment (for example, download from GH)? More precisely, you should try with a binary built without |
The binaries come from It will take some time until I find the time to reproduce it. |
I can easily reproduce with your build and also the 2.53.3 build from GH. I was myself testing with the latest code (unreleased, but available at GH) and this worked even with a tiny stack. It is thus likely that the next release fixes this issue but it would be great if you could actually test the latest code already now. |
I'm going to close this as believe fixed in the current code base. If you can repro with 2.53.4 (RC2 today, release tomorrow), please post and I'm happy to reopen. |
I was told on unison-users to report here a similar case: Version 2.53.4 (ocaml 5.1.0) I got reproducible crashes syncing my laptop against my desktop, both running linux. The crash happened while the sync was going on, no user interaction was necessary. I could repeat it three times, all three times the backtrace in gdb showed I can also confirm that using the text ui unison worked without any problem. I attach three different traces I got from the three crashes. |
I have prepared a tentative fix which I believe might be common to both this ticket and #1006, even though archlinux seems to be hit harder and might still be a different issue. @olafhering if you are interested in testing then see details at #1006 (comment) |
As reported by @olafhering on unison-users@ after discussion, propagation seems to use excessive stack depth.
The repro recipe is roughly:
Looking at the stack trace below, it smells like there is a recursive function which does not do tail recursion when it should, but that is speculation. The bug is that while 350K files might reasonably take 350K * A bytes of RAM for some A, it should not result in stack usage proportional to the number of files.
The text was updated successfully, but these errors were encountered: