-
Notifications
You must be signed in to change notification settings - Fork 35
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
Thread#wakeup leads to Zlib::BufError #57
Comments
I can reproduce the issue. My Ruby backtrace was different, showing the problem in
This was run under gdb with a breakpoint on
The failure in err = (int)(VALUE)rb_thread_call_without_gvl(zstream_run_func, (void *)args,
zstream_unblock_func, (void *)args); Looking at
Based on the comment, my guess is that there is no safe way to interrupt zstream inflation/deflation, and Thread#wakeup causes an interrupt, so it is not possible to support what you want. At best, we could document that it is not supported. However, I'm not a zlib expert, so it's possible I'm misunderstanding things. Hopefully someone with more experience in this area could confirm or correct my understanding. |
Thank you very much for looking into this!
Sometimes it's
An interesting thing, then, would be
|
I got this error. /* retry if no exception is thrown */
if (err == Z_OK && args->interrupt) {
args->interrupt = 0;
goto loop;
} MRI calls HOWEVER, it is possible to complete the task (e.g. deflate) before cancelling and there is no data to So the above retrying code should be: /* retry if no exception is thrown */
if (err == Z_OK && args->interrupt && not_completed(z)) {
args->interrupt = 0;
goto loop;
} I'm not sure how to implement |
#74 fixes this for certain cases. I was hoping it would resolve the |
Minimal reproducible script:
leads to
The error doesn't happen, however, if we change
Zlib::GzipReader.new(StringIO.new(gzipped)).read
toZlib.gunzip(gzipped)
, but still happens withZlib.gzip(content)
.Probably related to #49
The text was updated successfully, but these errors were encountered: