-
Notifications
You must be signed in to change notification settings - Fork 170
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
SIGSEGV when closing ZstdCompressCtx
#331
Comments
No, it can't be increased. After |
Emm..
|
Hmm, strange. I see some other methods that should be guarding the native code through the same lock but do not. May be that could be the issue, though these are not in the stack trace. |
added more guards around executing native code: cec9653 , but I am not sure if it will fix the problem here |
Thanks, we will give it a try when the new release is ready. |
just released 1.5.6-8 with that fix |
There is a race condition in
AutoCloseBase#close
based on my understandinghttps://github.com/luben/zstd-jni/blob/master/src/main/java/com/github/luben/zstd/AutoCloseBase.java#L68
Some other compressing thread can increase the
sharedLock
betweenand
Since
doClose
would deallocate the underlying native reference, the other compressing threads would crash with SIGSEGV.What is the reason that we can't use a
ReentrantReadWriteLock
here to guard this race condition?Performance concerns?
The text was updated successfully, but these errors were encountered: