cryptomator / fuse-cloud-access-adapter

FUSE access to cloud-access-java
GNU Affero General Public License v3.0
2 stars 1 forks source link

Listing of huge directories throws StackOverflowError #2

Closed infeo closed 4 years ago

infeo commented 4 years ago

Library: WinFSP OS: Windows 10 Pro 2004

Using the localFSProvider to mirror a local directory containing 15,000 files, a StackOverflowError is throw, Windows reports an I/O error occured and the directory cannot be listed.

This is due to the recursive calling structure of the OpenDir class: https://github.com/cryptomator/fuse-cloud-access-adapter/blob/b91f286451df77d8138f49013a1525e551d7bec9/src/main/java/org/cryptomator/fusecloudaccess/OpenDir.java#L44-L53

Log:

[main] INFO org.cryptomator.fusecloudaccess.Main - Mounting FUSE file system at XXX
The service java has been started.
[main] INFO org.cryptomator.fusecloudaccess.Main - Type anything and hit enter to stop.
[Thread-246] ERROR org.cryptomator.fusecloudaccess.CloudAccessFS - readdir() failed
java.util.concurrent.CompletionException: java.lang.StackOverflowError
    at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
    at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1113)
    at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2235)
    at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:143)
    at org.cryptomator.fusecloudaccess.OpenDir.list(OpenDir.java:58)
    at org.cryptomator.fusecloudaccess.OpenDir.list(OpenDir.java:52)
    at org.cryptomator.fusecloudaccess.OpenDir.list(OpenDir.java:52)
    at org.cryptomator.fusecloudaccess.CloudAccessFS.readdir(CloudAccessFS.java:154)
    at ru.serce.jnrfuse.AbstractFuseFS.lambda$init$10(AbstractFuseFS.java:169)
    at jnr.ffi.provider.jffi.NativeClosureProxy$$impl$$13.invoke(Unknown Source)
Caused by: java.lang.StackOverflowError
    at com.kenai.jffi.HeapInvocationBuffer$LE64ArrayIO.putAddress(HeapInvocationBuffer.java:480)
    at com.kenai.jffi.HeapInvocationBuffer$DefaultEncoder.putAddress(HeapInvocationBuffer.java:360)
    at com.kenai.jffi.HeapInvocationBuffer.putObject(HeapInvocationBuffer.java:221)
    at ru.serce.jnrfuse.FuseFillDir$jnr$fromNativeConverter$0.apply(Unknown Source)
    at ru.serce.jnrfuse.FuseFillDir.apply(FuseFillDir.java:29)
    at org.cryptomator.fusecloudaccess.OpenDir.list(OpenDir.java:48)
    at org.cryptomator.fusecloudaccess.OpenDir.list(OpenDir.java:52)
    at org.cryptomator.fusecloudaccess.OpenDir.list(OpenDir.java:52)
    at org.cryptomator.fusecloudaccess.OpenDir.list(OpenDir.java:52)
    at org.cryptomator.fusecloudaccess.OpenDir.list(OpenDir.java:52)
        [...]