-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot unpack libzstd-jni-1.5.4-2 ?!?! When using virtual threads on Correto-21 + Windows #295
Comments
Also using compressBound seem to trigger this for me now. |
May be related to timing / parallel threads - when I change the number of threads used in my tests I can make the problem come and go but not in an intuitive way.... |
Hmm, interesting - all the loading/isLoaded/etc methods are synchronized so there is no way 2 or them to run concurrently. On another side, the |
Looking at the error - it tries to unpack the native DLL file onto file that exists and is already used. The question is why |
If it makes any difference I should mention I am using virtual Threads
(except for the main program Thread that is a platform thread and that
drive my test)...
…On Fri, Dec 22, 2023 at 3:38 PM luben karavelov ***@***.***> wrote:
Looking at the error - it tries to unpack the native DLL file onto file
that exists and is already used. The question is why File.createTempFile
is returning the same filename?
—
Reply to this email directly, view it on GitHub
<#295 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADXQFZHFLFOUWHCVCAGJLDYKWLOFAVCNFSM6AAAAABA6XJ7J6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRXG42TSOBZGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
It also varies from run to run - sometimes I can run my test program four
times without a problem but the fifth time it fail. Sometimes it locks up
the entire VM so badly that I need to kill the whole command window (i.e.
CTRL-C does not work).
…On Fri, Dec 22, 2023 at 3:54 PM Javafanboy ***@***.***> wrote:
If it makes any difference I should mention I am using virtual Threads
(except for the main program Thread that is a platform thread and that
drive my test)...
On Fri, Dec 22, 2023 at 3:38 PM luben karavelov ***@***.***>
wrote:
> Looking at the error - it tries to unpack the native DLL file onto file
> that exists and is already used. The question is why File.createTempFile
> is returning the same filename?
>
> —
> Reply to this email directly, view it on GitHub
> <#295 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AADXQFZHFLFOUWHCVCAGJLDYKWLOFAVCNFSM6AAAAABA6XJ7J6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRXG42TSOBZGI>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
Hmm, that's interesting - virtual threads could be the issue here as I have not tested with them. |
Realized it could be a matter of as specific Open JDK distro perhaps in
combination with a specific OS - on Windows I use Corretto (AWS OpenJDK
distro) as AWS is my ultimate environment for this project even though I
have not tried running it on EC2 yet.
When I tried the same program on Linux (WSL) where I have the "normal open
source JDK 21 distro" I have yet to run into the problem.
/Magnus
…On Fri, Dec 22, 2023 at 5:47 PM luben karavelov ***@***.***> wrote:
Hmm, that's interesting - virtual threads could be the issue here as I
have not tested with them.
—
Reply to this email directly, view it on GitHub
<#295 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADXQFYPQLRFFQ3JWZ6JUV3YKW2RDAVCNFSM6AAAAABA6XJ7J6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRXHA4DOMZZHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Anyhow I managed to work around the problem by ensuring the first access of
the library was made before may other threads was created and could make
use of it - now my test work both on Windows and Ubuntu Linux and with both
JDK 21 (OpenJDK and Corretto).
Seem to be something amiss with some of Windows, Corretto and Virtual
Threads - maybe somebody else will run into the same problem and can dig up
some more facts...
…On Fri, Dec 22, 2023 at 7:36 PM Javafanboy ***@***.***> wrote:
Realized it could be a matter of as specific Open JDK distro perhaps in
combination with a specific OS - on Windows I use Corretto (AWS OpenJDK
distro) as AWS is my ultimate environment for this project even though I
have not tried running it on EC2 yet.
When I tried the same program on Linux (WSL) where I have the "normal open
source JDK 21 distro" I have yet to run into the problem.
/Magnus
On Fri, Dec 22, 2023 at 5:47 PM luben karavelov ***@***.***>
wrote:
> Hmm, that's interesting - virtual threads could be the issue here as I
> have not tested with them.
>
> —
> Reply to this email directly, view it on GitHub
> <#295 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AADXQFYPQLRFFQ3JWZ6JUV3YKW2RDAVCNFSM6AAAAABA6XJ7J6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRXHA4DOMZZHA>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
I tried a bit more and can report that Corretto do work with the library on
Linux but on Windows I still get the problem with the file access during
native loading intermittently with Corretto even when I tried to myself
synchronize access with putting the first access in a synchronized method
:-(
…On Fri, Dec 22, 2023 at 9:12 PM Javafanboy ***@***.***> wrote:
Anyhow I managed to work around the problem by ensuring the first access
of the library was made before may other threads was created and could make
use of it - now my test work both on Windows and Ubuntu Linux and with both
JDK 21 (OpenJDK and Corretto).
Seem to be something amiss with some of Windows, Corretto and Virtual
Threads - maybe somebody else will run into the same problem and can dig up
some more facts...
On Fri, Dec 22, 2023 at 7:36 PM Javafanboy ***@***.***> wrote:
> Realized it could be a matter of as specific Open JDK distro perhaps in
> combination with a specific OS - on Windows I use Corretto (AWS OpenJDK
> distro) as AWS is my ultimate environment for this project even though I
> have not tried running it on EC2 yet.
>
> When I tried the same program on Linux (WSL) where I have the "normal
> open source JDK 21 distro" I have yet to run into the problem.
>
> /Magnus
>
> On Fri, Dec 22, 2023 at 5:47 PM luben karavelov ***@***.***>
> wrote:
>
>> Hmm, that's interesting - virtual threads could be the issue here as I
>> have not tested with them.
>>
>> —
>> Reply to this email directly, view it on GitHub
>> <#295 (comment)>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/AADXQFYPQLRFFQ3JWZ6JUV3YKW2RDAVCNFSM6AAAAABA6XJ7J6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRXHA4DOMZZHA>
>> .
>> You are receiving this because you authored the thread.Message ID:
>> ***@***.***>
>>
>
|
Hmm, strange bug in Correto/Windows then. I test with Correto but on Linux... I will leave open this issue and improve the title so if other people experience the same can benefit of your investigation. |
When the first thing I do with the zstd library (using JDK 21 running on Windows 10) is to create a dictionary I get the following exception:
java.lang.ExceptionInInitializerError:: Cannot unpack libzstd-jni-1.5.4-2: C:\Users\myaccount\AppData\Local\Temp\libzstd-jni-1.5.4-217418534051402262760.dll (The process cannot access the file because it is being used by another process)
any thought on why I get it and/or what I can try to avoid it?
The text was updated successfully, but these errors were encountered: