Closed dmitry-timofeev closed 5 years ago
@dmitry-timofeev,
Amazing work! Thank you so much for this 😄 The power of open-source wins again.
I did have some reservations about using temporary directories. I tried many things but in the end, using temporary directories turned out to be the only reliable way I could extract the shared libraries from the JAR. I had not thought of synchronisation issues, but I am glad your PR solves that problem.
Let me review and I'll create a release as soon as possible.
Wonderful, thank you very much! If anything is needed regarding this modification — let me know.
Just to let you know your changes have been incorporated and released in 3.7.1
.
Thank you for your contribution 😄
Great, thank you!
Library loading, which happens on lazysodium instantiation, has a couple of issues:
LinkageError
when ran several processes simultaneously, but I suspect a process crash is also possible with unlucky timing.It is not thread safe. If multiple threads instantiate
SodiumJava
about the same time, the process will crash with segfault. Here is a test demonstrating that:SodiumJava
several times with the default constructor, it will copylibsodium.so
as many times to the temp directory as invoked.I've locally resolved the first issue and will submit the PR soon. I suggest to resolve the other too in the same PR, as they are closely related, WDYT?