-0777 broken in 1.8.1?

Version 1.8.0:

$ ruby -0777 -ne 'puts $FILENAME' .bash*
.bash_history
.bash_profile
.bashrc
.bashrc.funcs
.bashrc.mine
.bashrc.ode

Version 1.8.1:

$ ruby -0777 -ne 'puts $FILENAME' .bash* 
.bash_history
.bash_history
.bash_history
.bash_history
.bash_history
.bash_history
.bash_history
.bash_history
.bash_history
.bash_history
...

It appears that gets no longer proceeds to the next input file
automatically when $/=0777. (Tested on x86 and alpha)

Aron

Hi,

···

In message “-0777 broken in 1.8.1?” on 04/02/05, Aron Griffis ruby-talk@griffis1.net writes:

Version 1.8.1:

$ ruby -0777 -ne ‘puts $FILENAME’ .bash*
.bash_history
.bash_history
.bash_history
.bash_history
.bash_history
.bash_history
.bash_history
.bash_history
.bash_history
.bash_history

It appears that gets no longer proceeds to the next input file
automatically when $/=0777. (Tested on x86 and alpha)

Can’t reproduce on my machine (i686-linux). Can you show us more info
about your platform and exact version (including date) of your interpreter?

						matz.

Yukihiro Matsumoto wrote: [Wed Feb 04 2004, 01:38:55PM EST]

Can’t reproduce on my machine (i686-linux). Can you show us more info
about your platform and exact version (including date) of your interpreter?

ruby 1.8.1 (2003-12-25) [i686-linux-gnu] <<< actually an Athlon-XP
CFLAGS=“-mcpu=athlon-xp -O3 -pipe”

ruby 1.8.1 (2003-12-25) [alphaev67-linux-gnu]
CFLAGS=“-mcpu=alphaev67 -mieee -O3 -pipe”

I can built ruby 1.8.0 (2003-08-04) on the same platforms with the same
CFLAGS and it works fine.

Aron

In article 20040204210013.GA12956@time,

Yukihiro Matsumoto wrote: [Wed Feb 04 2004, 01:38:55PM EST]

Can’t reproduce on my machine (i686-linux). Can you show us more info
about your platform and exact version (including date) of your interpreter?

ruby 1.8.1 (2003-12-25) [i686-linux-gnu] <<< actually an Athlon-XP
CFLAGS=“-mcpu=athlon-xp -O3 -pipe”

ruby 1.8.1 (2003-12-25) [alphaev67-linux-gnu]
CFLAGS=“-mcpu=alphaev67 -mieee -O3 -pipe”

I can built ruby 1.8.0 (2003-08-04) on the same platforms with the same
CFLAGS and it works fine.

Which compiler do you use? When I use -mcpu=athlon-xp -O3 -pipe and try
the test suite on my Mandrake 9.2 I get errors, but if I turn the
optimisation down to -O2 it works. Using a stable snapshot from last
night (just because I was looking at it and have a build script)

[mike@ratdog ruby-stable]$ gcc -v
Reading specs from /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.1/specs
Configured with: ../configure --prefix=/usr --libdir=/usr/lib
–with-slibdir=/lib --mandir=/usr/share/man --infodir=/usr/share/info
–enable-shared --enable-threads=posix --disable-checking
–enable-long-long --enable-__cxa_atexit
–enable-languages=c,c++,ada,f77,objc,java,pascal
–host=i586-mandrake-linux-gnu --with-system-zlib
Thread model: posix
gcc version 3.3.1 (Mandrake Linux 9.2 3.3.1-2mdk)
[mike@ratdog ruby-stable]$ cat build-snap
#!/bin/bash

set +e

target_dir=/usr/local/mike/ruby-snap
source_archive=stable-snapshot.tar.gz

rm -rf $target_dir
mkdir $target_dir

rm -rf ruby
tar -zxf $source_archive

cd ruby
CFLAGS=“-O2 -march=athlon-xp -pipe” ./configure --prefix=$target_dir
make
make test
make install
cd test
$target_dir/bin/ruby runner.rb
[mike@ratdog ruby-stable]$

If I run that then all goes well, and the runner.rb finishes up with


Finished in 69.782969 seconds.

726 tests, 7386 assertions, 0 failures, 0 errors

If I change -O2 to -O3 then I see this in the out

E, [2004-02-04T16:35:38.702628 #15571] ERROR – : CGIHandler:
/usr/local/mike/src/ruby-stable/ruby/test/soap/calc/server.cgi:
/usr/local/mike/ruby-snap/lib/ruby/1.8/time.rb:66: [BUG] Segmentation
fault
ruby 1.8.1 (2004-02-03) [i686-linux]

E

Finished in 69.948753 seconds.

  1. Error:
    test_calc_cgi(SOAP::Calc::TestCalcCGI):
    SOAP::StreamError: Illegal media type.

When I run the test suite. Maybe it’s an optimisation problem. I only
looked at it for a few minutes before work this morning as I was
thinking about using the same compiler flags on ruby as on perl.

Hope this helps,

Mike

···

Aron Griffis ruby-talk@griffis1.net wrote:

mike@stok.co.uk | The “`Stok’ disclaimers” apply.
http://www.stok.co.uk/~mike/ | GPG PGP Key 1024D/059913DA
mike@exegenix.com | Fingerprint 0570 71CD 6790 7C28 3D60
http://www.exegenix.com/ | 75D2 9EC4 C1C0 0599 13DA

Mike Stok wrote: [Wed Feb 04 2004, 04:40:03PM EST]

Which compiler do you use? When I use -mcpu=athlon-xp -O3 -pipe and try
the test suite on my Mandrake 9.2 I get errors, but if I turn the
optimisation down to -O2 it works. Using a stable snapshot from last
night (just because I was looking at it and have a build script)

I’m using gcc-3.3.2. I just tested with -O0 but the problem persists.
The fact that it appears with 1.8.1 (on two architectures) but not with
1.8.0 suggests that it should be possible to narrow down some related
source changes within ruby.

Regards,
Aron

Aron Griffis wrote:

Mike Stok wrote: [Wed Feb 04 2004, 04:40:03PM EST]

Which compiler do you use? When I use -mcpu=athlon-xp -O3 -pipe and try
the test suite on my Mandrake 9.2 I get errors, but if I turn the
optimisation down to -O2 it works. Using a stable snapshot from last
night (just because I was looking at it and have a build script)

I’m using gcc-3.3.2. I just tested with -O0 but the problem persists.
The fact that it appears with 1.8.1 (on two architectures) but not with
1.8.0 suggests that it should be possible to narrow down some related
source changes within ruby.

Regards,
Aron

I ran into this with 1.8.1 last week, where the end-of-file was not
being detected when the input record separator is null. This seems to
have been fixed in io.c (on 26 December 2003). It now works correctly in
the CVS version:

~/src/ruby-1.8.0% ./ruby -v; ./ruby -0777 -ne ‘puts $FILENAME’ ran*
ruby 1.8.0 (2003-06-23) [i686-linux]
random.c
random.o
range.c
range.o

~/src/ruby-1.8.1% ./ruby -v; ./ruby -0777 -ne ‘puts $FILENAME’ ran*
ruby 1.8.1 (2003-12-25) [i686-linux]
random.c
random.c
random.c
random.c
random.c
random.c

~/src/ruby-cvs/ruby% ./ruby -v; ./ruby -0777 -ne ‘puts $FILENAME’ ran*
ruby 1.9.0 (2004-02-06) [i686-linux]
random.c
random.o
range.c
range.o

–Jeff

···


Jeff Pace / jpace@incava.org

Jeff Pace wrote: [Thu Feb 05 2004, 10:19:02PM EST]

I ran into this with 1.8.1 last week, where the end-of-file was not
being detected when the input record separator is null. This seems to
have been fixed in io.c (on 26 December 2003). It now works correctly in
the CVS version:

Thanks Jeff! That does the trick! Sounds like 1.8.2 should be right
around the corner… :wink:

Aron