Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Process.spawn with IO.pipe output fails on Java 21 + warbler

Đang mở
#569 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
java, rails, ruby
Lĩnh vực
cli

Hướng nghiên cứu

The failure is an EBADF raised from spawn when Warbler packages a JRuby app and runs on Java 21, so the trigger lies in JRuby's process and file-descriptor handling rather than in Warbler's own Ruby files. Reproduce with the minimal IO.pipe and spawn('ls', out: out_w) snippet from the body under java21 with and without a Warbler war. Done means the spawn succeeds inside the war and the captured output matches the non-war run.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Using Open3.capture3 fails when running with java21 from a warbler jar with

ERROR: org.jruby.embed.EvalFailedException: (EBADF) Bad file descriptor - ls

This works correctly with java 11 and warbler, or with java 21 and no warbler. This is tested on jruby 9.4.12 and warbler 2.0.5.

I simplified the Open3 code down to this repro:

out_r, out_w = IO.pipe

pid = spawn('ls', out: out_w)

wait_thr = Process.detach(pid)
out_w.close
begin
  out_reader = Thread.new { out_r.read }
  output = out_reader.value
  puts output
ensure
  out_r.close
  wait_thr.join
end

When running this, it will fail at spawn. Spawning without an output pipe works fine in the java21+warbler configuration.

Ngôn ngữ chính
Ruby
Star
901
Fork
206
Merge trung bình
1 ngày 10 giờ
Pull request đã merge (30 ngày)
3

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của jruby/warbler

Tất cả issue của jruby/warbler

Issue tương tự

Thêm issue về Ruby

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.