Project

General

Profile

Actions

Bug #11738

closed

ARGF.readpartial raises a wrong exception

Added by shugo (Shugo Maeda) over 8 years ago. Updated over 8 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0dev (2015-11-09 trunk 52500) [x86_64-linux]
[ruby-core:71668]

Description

ARGF.readpartial raises a RuntimeError when EOF is detected more than twice:

lexington:ruby$ cat t.rb
p ARGF.readpartial(16) rescue nil
p ARGF.readpartial(16)
lexington:ruby$ ruby t.rb /dev/null
t.rb:2:in `readpartial': can't modify frozen NilClass (RuntimeError)
	from t.rb:2:in `<main>'
lexington:ruby$

An EOFError is expected.

Updated by normalperson (Eric Wong) over 8 years ago

1.9.3, 2.0.0, and 2.1 branches segfault for me, even.
Current bug is 2.2+

I might have time to look at this tomorrow if nobody beats me to it.

Actions #2

Updated by shugo (Shugo Maeda) over 8 years ago

  • Status changed from Open to Closed

Applied in changeset r52745.


  • io.c (argf_getpartial): should not resize str if the second
    argument is not given.
    [ruby-core:71668] [Bug #11738]

Updated by shugo (Shugo Maeda) over 8 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: REQUIRED

Eric Wong wrote:

1.9.3, 2.0.0, and 2.1 branches segfault for me, even.
Current bug is 2.2+

Thanks for your check.

I've fixed the bug in trunk, and have set the Backport field of this ticket.

Updated by nagachika (Tomoyuki Chikanaga) over 8 years ago

  • Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: REQUIRED to 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: DONE

Backported into ruby_2_2 branch at r52788.

Updated by usa (Usaku NAKAMURA) over 8 years ago

  • Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: DONE to 2.0.0: REQUIRED, 2.1: DONE, 2.2: DONE

ruby_2_1 r52800 merged revision(s) 52745.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0