UPDATE (see below for more details)
The root cause of this seems to be related to parallel directory listing/file stat operations. Reproducing it requires parallelism. See my update below.
What is the problem you are having with rclone?
rclone mount
is non-deterministically crashing during file listing operations for my putio
backend mounted with rclone mount
. The crash seems non-deterministic but I can semi-consistently trigger the crash by running fd . some_folder
where some_folder
is a folder on putio with many files/folders in it.
Primary error message: Assertion failed: (tmpin > *in), function _citrus_iconv_std_iconv_convert, file citrus_iconv_std.c, line 1059.
. I believe that specific code can be found online here.
Run the command 'rclone version' and share the full output of the command.
rclone v1.65.0
- os/version: darwin 14.1 (64 bit)
- os/kernel: 23.1.0 (arm64)
- os/type: darwin
- os/arch: arm64 (ARMv8 compatible)
- go/version: go1.21.4
- go/linking: dynamic
- go/tags: cmount
Which cloud storage system are you using? (eg Google Drive)
putio
The command you were trying to run (eg rclone copy /tmp remote:tmp
)
my putio backend is being mounted with rclone with this command:
rclone mount -v --rc --rc-no-auth --rc-addr=localhost:5573 --vfs-read-ahead=2M --vfs-cache-mode full --vfs-read-chunk-size=20M --vfs-read-chunk-size-limit=1G --vfs-cache-max-age=4800h --vfs-cache-max-size=130G --volname putio_mount_direct --fast-list --dir-cache-time 36h --checkers 10 --timeout 10s --contimeout 30s putio:/ /Users/chris/putio_mount_direct
The rclone config contents with secrets removed.
My putio
configuration from my rclone.conf
* [putio]
* type = putio
token = {"access_token":"xxxx","expiry":"0001-01-01T00:00:00Z"}
A log from the command with the -vv
flag
The key error is:
Assertion failed: (tmpin > *in), function _citrus_iconv_std_iconv_convert, file citrus_iconv_std.c, line 1059.
Any idea's at all what could be causing this or ideas for workarounds?
Edit: Self-investigation report
Looking at this more, the assertion seems to be in the macOS implementation of iconv
. Specifically this line of code: https://github.com/apple-open-source/macos/blob/414fd262e186f544ada6544ce90c0d265ec70834/libiconv/libiconv_modules/iconv_std/citrus_iconv_std.c#L1059
It seems like running repeat 100 fd . > /dev/null
in a rclone mounted directory with sub-directories will consistently trigger the crash. However, if I disabled parallelism by running repeat 100 fd --threads 1 . > /dev/null
the crash never occurs. Similarly, running find .
or tree
don't trigger a crash presumably because they're single threaded. Introducing parallelism with repeat 100 { find . & }
does indeed cause the crash, so it's not just something fd
specific.
So I think the root cause is something related to parallelism around directory listing. That makes sense because I initially encountered this crash a few times when I wasn't running fd
, but I must have been doing some sort of other parallel directory listing/stat operations.