Backport #8980

backport r43112, r43114, r43117, r43118 (IO.pipe/popen and close_write/close_read)

Added by Tomoyuki Chikanaga 7 months ago. Updated 6 months ago.

[ruby-dev:47742]
Status:Closed
Priority:Normal
Assignee:Usaku NAKAMURA

Description

pipe と closewrite/closeread に関する一連の修正がバックポート必要か確認します。
備忘のためチケット化。

Associated revisions

Revision 43482
Added by Usaku NAKAMURA 6 months ago

merge revision(s) 43112,43114,43117,43118: [Backport #8980]

* io.c (rb_io_close_read): keep fptr in write_io to be discarded, to
  fix freed pointer access when it is in use by other threads, and get
  rid of potential memory/fd leak.

* io.c (rb_io_close_write): detach tied IO for writing before closing
  to get rid of race condition.  

* io.c (rb_io_close_read): duplex IO should wait its child process
  even after close_read.

History

#1 Updated by Nobuyoshi Nakada 7 months ago

少なくとも1.9以降は必要なはずです。

#2 Updated by Tomoyuki Chikanaga 7 months ago

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

This issue was solved with changeset r43144.
Tomoyuki, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 43112,43114,43117,43118: [Backport #8980]

* io.c (rb_io_close_read): keep fptr in write_io to be discarded, to
  fix freed pointer access when it is in use by other threads, and get
  rid of potential memory/fd leak.

* io.c (rb_io_close_write): detach tied IO for writing before closing
  to get rid of race condition.  

* io.c (rb_io_close_read): duplex IO should wait its child process
  even after close_read.

#3 Updated by Tomoyuki Chikanaga 7 months ago

  • Project changed from Backport200 to Backport93
  • Status changed from Closed to Assigned
  • Assignee changed from Tomoyuki Chikanaga to Usaku NAKAMURA

1.9 にも必要らしいということで移動しておきます。

#4 Updated by Usaku NAKAMURA 6 months ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r43482.
Tomoyuki, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 43112,43114,43117,43118: [Backport #8980]

* io.c (rb_io_close_read): keep fptr in write_io to be discarded, to
  fix freed pointer access when it is in use by other threads, and get
  rid of potential memory/fd leak.

* io.c (rb_io_close_write): detach tied IO for writing before closing
  to get rid of race condition.  

* io.c (rb_io_close_read): duplex IO should wait its child process
  even after close_read.

Also available in: Atom PDF