# \[Bug #1129\] IO.binread(Pathname(...)) dumps core

**URL:** <https://www.ruby-forum.com/t/bug-1129-io-binread-pathname-dumps-core/159747>\
**Category:** Development\
**Created:** [February 8, 2009, 6:29am UTC](https://www.ruby-forum.com/t/bug-1129-io-binread-pathname-dumps-core/159747 "2009-02-08T06:29:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sakuro\_OZAWA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@Sakuro\_OZAWA](https://www.ruby-forum.com/u/Sakuro_OZAWA)\
**Post date:** [February 8, 2009, 6:29am UTC](https://www.ruby-forum.com/t/bug-1129-io-binread-pathname-dumps-core/159747/1 "2009-02-08T06:29:54Z")

</div>

Bug #1129: IO.binread(Pathname(…)) dumps core  
[http://redmine.ruby-lang.org/issues/show/1129](http://redmine.ruby-lang.org/issues/show/1129)

e$B5/I\<\<Te(B: Sakuro OZAWA  
e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal  
ruby -v: ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-darwin9.6.0]

Pathnamee$B$N%$%s%9%?%s%9$r0z?t$K$7$?$H$-!“e(B  
IO.binreade$B$,%3%”$rEG$-$^$9!#e(B  
IO.reade$B$OEG$-$^$;$s!#e(B

MacOS X Leopard 10.5.6e$B$Ne(BMacPortse$B$Ne(Bruby19  
Ubuntu Linux 8.04(Low Price Intel  
Architecture)e$B$G\<+J,$G%3%s%Q%$%k$7$?$b$Ne(B  
e$B$G3NG’!#e(B

% ruby -rpathname -e ‘puts IO.read(Pathname(“/etc/shells”))’

# List of acceptable shells for chpass(1).

# Ftpd will not allow users to connect who are not using
/bin/tcsh /bin/zsh

% ruby -rpathname -e ‘puts IO.binread(Pathname(“/etc/shells”))’  
-e:1: [BUG] Bus Error  
ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-darwin9.6.0]

## – control frame ---------- c:0004 p:---- s:0011 b:0011 l:000010 d:000010 CFUNC :binread c:0003 p:0025 s:0007 b:0006 l:001b64 d:001dd4 EVAL -e:1 c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH c:0001 p:0000 s:0002 b:0002 l:001b64 d:001b64 TOP :47140

– Ruby level backtrace  
information-----------------------------------------  
-e:1:in `binread' -e:1:in `’

## – C level backtrace information

0x2f8e02 0 libruby.dylib 0x002f8e02  
rb\_vm\_bugreport + 82  
0x20e38c 1 libruby.dylib 0x0020e38c rb\_warning +  
444  
0x20e3eb 2 libruby.dylib 0x0020e3eb rb\_bug + 43  
0x29f5ab 3 libruby.dylib 0x0029f5ab  
rb\_enable\_interrupt + 75  
0x95abe2bb 4 libSystem.B.dylib 0x95abe2bb \_sigtramp

- 43  
0xffffffff 5 ??? 0xffffffff 0x0 +  
4294967295  
0x22cdc4 6 libruby.dylib 0x0022cdc4  
rb\_close\_before\_exec + 484  
0x23696f 7 libruby.dylib 0x0023696f  
rb\_file\_open\_str + 4959  
0x236a4d 8 libruby.dylib 0x00236a4d  
rb\_file\_open\_str + 5181  
0x2e4845 9 libruby.dylib 0x002e4845  
rb\_iseq\_compile + 1125  
0x2e92bd 10 libruby.dylib 0x002e92bd rb\_funcall2
- 1773  
0x2eba2b 11 libruby.dylib 0x002eba2b rb\_funcall2
- 11867  
0x2f0e1b 12 libruby.dylib 0x002f0e1b rb\_funcall2
- 33355  
0x2f102f 13 libruby.dylib 0x002f102f  
rb\_iseq\_eval\_main + 159  
0x2114e9 14 libruby.dylib 0x002114e9  
ruby\_exec\_node + 169  
0x213b6e 15 libruby.dylib 0x00213b6e  
ruby\_run\_node + 94  
0x1fef 16 ruby 0x00001fef main + 95  
0x1f56 17 ruby 0x00001f56 start + 54  
0x4 18 ??? 0x00000004 0x0 + 4

[NOTE]  
You may encounter a bug of Ruby interpreter. Bug reports are welcome.  
For details: [http://www.ruby-lang.org/bugreport.html](http://www.ruby-lang.org/bugreport.html)

zsh: abort (core dumped) ruby -rpathname -e ‘puts  
IO.binread(Pathname(“/etc/shells”))’

---

<div class="post-metadata">

**Author:** ![Sakuro\_OZAWA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@Sakuro\_OZAWA](https://www.ruby-forum.com/u/Sakuro_OZAWA)\
**Post date:** [February 8, 2009, 10:37am UTC](https://www.ruby-forum.com/t/bug-1129-io-binread-pathname-dumps-core/159747/2 "2009-02-08T10:37:51Z")

</div>

e$B%A%1%C%He(B #1129 e$B$,99?7$5$l$^$7$?!#e(B (by Nobuyoshi N.)

e$B%9%F!\<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B  
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

## Applied in changeset r22121.

[http://redmine.ruby-lang.org/issues/show/1129](http://redmine.ruby-lang.org/issues/show/1129)
