Project

General

Profile

Actions

Bug #20672

closed

UNIXSocket.pair transmitting data between pids looks flaky

Added by danh337 (Dan H) 3 months ago. Updated 3 months ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 3.3.4 (2024-07-09 revision be1089c8ec) [x86_64-linux]
[ruby-core:118827]

Description

I have code that uses UNIXSocket.pair and fork to send data between parent and child.

It seems to work fine for a small number of messages passed, but then fails with Errno::EBADF on the child pid writing to its socket received from the parent.

I attached a test driver which includes successful and failed test runs. This is boiled down logic from a larger app, where I first started seeing this issue. I believe I first saw this on Ruby 3.0, but now I am on 3.3.4.

This could be me, as in my code or my workstation env, but I have not been able to prove that from many web searches. If you look at my test driver and see something wrong with it, I will take the shame and learn something. BUT just in case this is an issue in low level Ruby code, I am submitting this here.


Files

test.rb (13 KB) test.rb Show logic, including log of success vs failed run danh337 (Dan H), 08/10/2024 02:41 AM
Actions

Also available in: Atom PDF

Like0
Like0Like1Like0