Project

General

Profile

Actions

Backport #2559

closed

IO#write raises Errno::EINVAL instead of expected Errno::EPIPE

Added by hongli (Hongli Lai) over 14 years ago. Updated almost 13 years ago.


Description

=begin
Test case:

require 'thread'

a, b = IO.pipe
Thread.new do
a.read(1)
a.close
end

sleep 0.1 # wait for thread to begin
b.write("x" * (1024 * 16)) # should be larger than pipe/socket buffer size

b.write on 1.8.7-p174 raises Errno::EPIPE, as expected.
1.8.7-p248 raises Errno::EINVAL.

It looks like this bug was introduced in revision 25918. Unapplying that revision fixes the problem.
=end


Files

io-write-fix.diff (1.33 KB) io-write-fix.diff hongli (Hongli Lai), 01/06/2010 03:37 AM
Actions #1

Updated by hongli (Hongli Lai) over 14 years ago

=begin
Simpler test case:

a, b = IO.pipe
a.close
b.write("x")
=end

Actions #2

Updated by hongli (Hongli Lai) over 14 years ago

=begin
Attached patch fixes the problem. Includes unit test.
=end

Actions #3

Updated by nobu (Nobuyoshi Nakada) over 14 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r26253.
Hongli, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Actions #4

Updated by nobu (Nobuyoshi Nakada) over 14 years ago

  • Status changed from Closed to Assigned
  • Assignee set to shyouhei (Shyouhei Urabe)

=begin

=end

Actions #5

Updated by normalperson (Eric Wong) about 14 years ago

=begin
Nobuyoshi Nakada wrote:

Issue #2559 has been updated by Nobuyoshi Nakada.

Status changed from Open to Closed
% Done changed from 0 to 100

This issue was solved with changeset r26253.

This affects a FreeBSD user on 1.8.7-p248. Can somebody please backport
this to the 1.8.7 branch?

Thanks

--
Eric Wong

=end

Actions #6

Updated by shyouhei (Shyouhei Urabe) almost 14 years ago

  • Status changed from Assigned to Closed

=begin
This issue was solved with changeset r27913.
Hongli, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0