Comments (12)
this element had to be redesigned as it was freed by the GC shortly after the call as it is now async and GC has no clue it is still used natively which produce the same type of crash.
My god, that was the reason. Instead of the operations struct, the dokanOptions were locally created and with the next gc run freed.
Thanks a lot, now it runs without crashing. :D
from dokany-nio-adapter.
After a several experiments, the current state is: Dokany 2.x does not run stable using JNA.
The reasons are unclear, but after a longer (or shorter) time, the running process crashes with NTSTATUS either STATUS_ACCESS_DENIED or STATUS_INTEGER_DIVIDE_BY_ZERO. In rare cases memory dump is created.
The branch contains the rewrite of the library, discarding the type safe enumerations and mainly dealing with "raw" values. The class ReadOnlyAdapter
contains a minimal read only filesystem implmentation, to test the stability of the implementation.
from dokany-nio-adapter.
@infeo couple of fixes were introduced since in the library to deal with memory corruption and synchronisation. If you can give another try and share any issues that would be appreciated!
from dokany-nio-adapter.
Thanks for the reminder! I gave it another whirl, and it seems that the mount is stable after a certain time has passed (on my machine ~15s).
In the new implementation DokanCreateFileSystem
is used. If the calling thread leaves the scope of the surrounding java method before the aforementioned time span passed, it is very likey the application crashes with one of the above error codes. The exception triggering dll is ntdll.dll
, so i honestly don't know where the error is located.
@Liryna Is there some critical (background) operation at the mount which can explain that the mount stabilizes after a certain time?
from dokany-nio-adapter.
Are you able to get the library logs in that case ? We could see if there is an unmount happening.
Could it be possible that somehow java is releasing the allocated native memory when going out of scope ? Like the delegates are free and it natively crash.
from dokany-nio-adapter.
Could it be possible that somehow java is releasing the allocated native memory when going out of scope ?
It is possible from my naive point of view, but unlikey, because the used libraries are stable and mature.
The two possibilites i see are either a wrong memory mapping (e.g. wrong start address) or memory is freed to early.
I have collected logs of a crash including driver output and the event logging: dokan_crashLog.zip
@Liryna Since this is a lot to look through, can you point me in some directions where to look at or what to look for?
from dokany-nio-adapter.
Also noteworhty: I can almost certainly trigger the crash, when accessing the volume properties (event without implementing DokenGetVolumeInformation
.
from dokany-nio-adapter.
Thanks for the logs @infeo .
What I am seeing is that the driver start to unmount due to the keepalive handle being closed happening when windows release the resource after the app crashes.
All the communication looks good and properly received by the kernel.
Quickly looking at https://github.com/cryptomator/dokany-nio-adapter/tree/feature/dokan-2.0 the API change seems to have been applied correctly but it is hard without a "real" diff.
When I pointed at the native resources being released, I was thinking at the mount parameters and especially dokanOperations.
The dotnet wrapper was successfully migrated but even if it is also a mature library this element had to be redesigned as it was freed by the GC shortly after the call as it is now async and GC has no clue it is still used natively which produce the same type of crash.
dokan-dev/dokan-dotnet#280
I have 0 experience in Java so I cannot say if that's the case but it should be looked at and ensure that's not the case.
from dokany-nio-adapter.
there have been some new versions of dokany. Together with learnings from #52 (comment) -> maybe one should give it a new try.
Latest version is 2.0.5.1000 from 2022-07-04
https://github.com/dokan-dev/dokany/blob/master/CHANGELOG.md
The benchmarks of v2 look really promising and should make migration well worth it:
https://github.com/dokan-dev/dokany#benchmark-v1511000-vs-v2031000
from dokany-nio-adapter.
related to:
cryptomator/cryptomator#2001
from dokany-nio-adapter.
There is a improved doc with latest revision from 7th june 2022 on
How to Update Dokan 1.1.0 application to Dokany 2.0.0
https://github.com/dokan-dev/dokany/wiki/Update-Dokan-1.1.0-application-to-Dokany-2.0.0
=> possibly it's worth a look, if it (in latest revision) contains the mission pieces of information...
from dokany-nio-adapter.
another reason for dokany v2 support
(beside e.g. speed see https://github.com/dokan-dev/dokany#benchmark-v1511000-vs-v2031000):
....the WINFSP option does not provide case-insensitive DIR and TAB-Completion as DOKANY does.
cryptomator/cryptomator#2001 (comment)
from dokany-nio-adapter.
Related Issues (20)
- Add option to use custom mount options HOT 2
- Migration to JDK 11 HOT 1
- Very slow writing speed / Always synchronised writing HOT 1
- Wrong UNC name HOT 3
- Shutdown hook never invoked
- Handling of `FILE_NO_INTERMEDIATE_BUFFERING` HOT 1
- Add Cryptomator-Icon to Drive HOT 8
- Too Long File Names Error Code Support
- Google Drive File Stream: Certain applications do not write to file HOT 6
- Add method to API to check if there are open handles
- Windows CMD access the wrong folder HOT 1
- Windows tool XCOPY: File metadata preservation issue
- FindFilesWithPattern: Wrong pattern matching HOT 1
- Unable to stream video files with VLC HOT 1
- Impossible to mount more filesystems than number of CPU cores HOT 1
- Delegate revealing a drive to the API consumer HOT 3
- Default mount options are used if none are given HOT 1
- Observe status of mounted filesystem
- Relax condition of successful mount
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dokany-nio-adapter.