Cryptomator / Dokany crashes after heavy use

os:windows

#1

When running Cryptomator 1.4.2 using Dokany when decrypting a large number of files sequentially, cryptomator fails then closes the Dokany session. All further access fails until the vault is manually closed and reopened. This failure occurs on different files at different offsets seemingly at random. It occurs more frequently when a heavy decrypt load is applied.

Cryptomator 1.4.2
OS: Windows 10 64-bit build 17134.523
Vault access: Dokany
Vault location: Google Drive File Stream v 29.1.78.2103

17:46:48.937 [Thread-68108] TRACE o.c.frontend.dokany.OpenFile - Reading 471040-475136 (0-1048576)
17:46:48.937 [Thread-68108] TRACE o.c.frontend.dokany.OpenFile - Reading 475136-479232 (0-1048576)
17:46:48.937 [Thread-68108] TRACE o.c.frontend.dokany.OpenFile - Reading 479232-483328 (0-1048576)
17:46:48.937 [Thread-68108] TRACE o.c.frontend.dokany.OpenFile - Reading 483328-487424 (0-1048576)
17:46:48.937 [Thread-68108] TRACE o.c.frontend.dokany.OpenFile - Reading 487424-491520 (0-1048576)
17:47:25.418 [Thread-68108] TRACE o.c.f.dokany.locks.DataRLockImpl - Released read data lock for '/Case/0024/Source7/POSITIONS - Tous les Comptes - Part 2.txt'
17:47:25.418 [Thread-68108] TRACE o.c.f.dokany.locks.PathRLockImpl - Released read path lock for '/Case/0024/Source7/POSITIONS - Tous les Comptes - Part 2.txt'
17:47:25.418 [Thread-68108] TRACE o.c.f.dokany.locks.PathRLockImpl - Released read path lock for '/Case/0024/Source7'
17:47:25.418 [Thread-68108] TRACE o.c.f.dokany.locks.PathRLockImpl - Released read path lock for '/Case/0024'
17:47:25.418 [Thread-68108] TRACE o.c.f.dokany.locks.PathRLockImpl - Released read path lock for '/Case'
17:47:25.418 [Thread-68108] TRACE o.c.f.dokany.locks.PathRLockImpl - Released read path lock for ''
17:47:25.418 [Thread-68108] DEBUG o.c.frontend.dokany.ReadWriteAdapter - (13513) readFile(): IO error while reading file /Case/0024/Source7/POSITIONS - Tous les Comptes - Part 2.txt.
17:47:25.424 [Thread-68108] DEBUG o.c.frontend.dokany.ReadWriteAdapter - Error is:
java.io.IOException: Incorrect function
	at java.base/sun.nio.ch.FileDispatcherImpl.pread0(Native Method)
	at java.base/sun.nio.ch.FileDispatcherImpl.pread(Unknown Source)
	at java.base/sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source)
	at java.base/sun.nio.ch.IOUtil.read(Unknown Source)
	at java.base/sun.nio.ch.FileChannelImpl.readInternal(Unknown Source)
	at java.base/sun.nio.ch.FileChannelImpl.read(Unknown Source)
	at org.cryptomator.cryptofs.ChunkLoader.load(ChunkLoader.java:34)
	at org.cryptomator.cryptofs.ChunkCache$1.load(ChunkCache.java:32)
	at org.cryptomator.cryptofs.ChunkCache$1.load(ChunkCache.java:29)
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3528)
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2277)
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2154)
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2044)
	at com.google.common.cache.LocalCache.get(LocalCache.java:3952)
	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3974)
	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4958)
	at org.cryptomator.cryptofs.ChunkCache.get(ChunkCache.java:40)
	at org.cryptomator.cryptofs.OpenCryptoFile.read(OpenCryptoFile.java:95)
	at org.cryptomator.cryptofs.CryptoFileChannel.internalRead(CryptoFileChannel.java:184)
	at org.cryptomator.cryptofs.CryptoFileChannel.lambda$read$0(CryptoFileChannel.java:67)
	at org.cryptomator.cryptofs.CryptoFileChannel.blockingIo(CryptoFileChannel.java:283)
	at org.cryptomator.cryptofs.CryptoFileChannel.read(CryptoFileChannel.java:67)
	at org.cryptomator.frontend.dokany.OpenFile.readNext(OpenFile.java:96)
	at org.cryptomator.frontend.dokany.OpenFile.read(OpenFile.java:54)
	at org.cryptomator.frontend.dokany.ReadWriteAdapter.readFile(ReadWriteAdapter.java:324)
	at com.dokany.java.DokanyOperationsProxy$ReadFileProxy.callback(DokanyOperationsProxy.java:72)
	at jdk.internal.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at com.sun.jna.CallbackReference$DefaultCallbackProxy.invokeCallback(CallbackReference.java:520)
	at com.sun.jna.CallbackReference$DefaultCallbackProxy.callback(CallbackReference.java:551)

17:47:25.504 [Background Thread 3] TRACE o.c.frontend.dokany.ReadWriteAdapter - unmounted() is called.

Is the memory leak a known issue?
#2

I have been having a similar issue. Under heavy use the cryptomator drive will crash/ become unresponsive. Manually closing/ opening the vault resets this behavior. I have also been able to reproduce this behavior using the wbDAV integration. For the larger files I store in the vault this makes the application near un-usable

When frozen the drive will loose its storage bar in explorer (see picture below)
drive

Windows 10 Pro 17763.253
Cryptomator 1.4.2
Drive File Stream: Version: 29.1.85.2056
Dokany: 1.2.1.2 x64


#3

I’ve found with Dokan the folders that cause instability for me are always media folders on windows 10. Open a folder full of word docs, and paste something in- no problems. Open a folder full of photos and the client becomes unresponsive (decrypting all while generating thumbnails) . Try pasting something new in during this process usually crashes the dokany drive. Just my observations on very limited testing,


#4

This is a known bug of dokany, the bug report and any progress to narrow it down can be seen there: https://github.com/cryptomator/cryptomator/issues/791


#5

Well, we found a memory leak which lead to a crash of the Java Virtual Machine :grin: With Cryptomator 1.4.7 the leak is sealed and it run smoothly over a long time now (;