Skip to content
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

Zlib.gzip sometimes errors out with Zlib::BufError if process has been forked #49

Open
hmdne opened this issue Nov 2, 2022 · 1 comment

Comments

@hmdne
Copy link

hmdne commented Nov 2, 2022

Ref: opal/opal#2463

The issue can't be reproduced reliably, the most reliable way is with the following code (you may need to launch it a couple of times) WARNING: it forks a lot of processes:

[user@localhost opal]# ruby _testzlib.rb 
_testzlib.rb:5:in `gzip': buffer error (Zlib::BufError)
	from _testzlib.rb:5:in `<main>'
[user@localhost opal]# _testzlib.rb:5:in `gzip': buffer error (Zlib::BufError)
	from _testzlib.rb:5:in `<main>'

[user@localhost opal]# 
[user@localhost opal]# cat _testzlib.rb 
require 'zlib'

10.times { fork }

Zlib.gzip("sdfasfasdfasdfasdasdfadfasdf" * 10000)
[user@localhost opal]# 

The issue has been seen on opal's CI since Ruby 2.6 until 3.1.

@ianks
Copy link

ianks commented Jan 13, 2024

We’ve been getting this error fairly regularly. At first I thought it could be due to the thread wake-up issue, but after shipping #74 we still get the BufError.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants