-0777 broken in 1.8.1?

A

Aron Griffis

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
 
Y

Yukihiro Matsumoto

Hi,

In message "-0777 broken in 1.8.1?"

|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.
 
A

Aron Griffis

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
 
M

Mike Stok

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
 
A

Aron Griffis

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
 
J

Jeff Pace

Aron said:
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
 
A

Aron Griffis

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... ;-)

Aron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top