Ruby 1.8.1 preview4

O

Osuka Adartse

Yukihiro said:
Hi,

You can get the (hopefully) final preview to 1.8.1.

ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.1-preview4.tar.gz

Enjoy and report problems if you find any.

I will going to release 1.8.1 on 24th or 25th, unless any showstopper
prevents me. Merry Christmas.

matz.
Well...

E:\dev\Src\ruby-1.8.1\test>runner.rb
Loaded suite test
Started
..........................................................................................
.....................................E....................................................
..........................................................................................
..........................................................................................
....................basic_auth is not supported under soap4r + net/http
for now.
..........................................................................................
..........................................................................................
..........................................................................................
................................
Finished in 619.08 seconds.

1) Error:
test_ln(TestFileUtils):
Errno::EINVAL: Invalid argument - data/same or tmp/lndest
E:/usr/local/lib/ruby/1.8/fileutils.rb:246:in `link'
E:/usr/local/lib/ruby/1.8/fileutils.rb:246:in `ln'
E:/usr/local/lib/ruby/1.8/fileutils.rb:244:in `fu_each_src_dest0'
E:/usr/local/lib/ruby/1.8/fileutils.rb:244:in `ln'
E:/dev/Src/ruby-1.8.1/test/fileutils/test_fileutils.rb:389:in `test_ln'
E:/dev/Src/ruby-1.8.1/test/fileutils/test_fileutils.rb:388:in `each'
E:/dev/Src/ruby-1.8.1/test/fileutils/test_fileutils.rb:388:in `test_ln'

682 tests, 7955 assertions, 0 failures, 1 errors

but that's ln, it shouldn't work in windows anyway, isn't it?.
Tested in Win200 pro on cmd and msys shell, compiled with mingw, both
results the same in test_fileutils.rb. I'm not sure what the soap4r
above means.

cheers
Adartse
 
D

Dennis Ranke

On a Playstation2 running linux:

Thanks. Very interesting. Seems to be 3 kind of errors.


[1, 2, 31, 32; floating point]
1) Failure:
test_SOAPDouble(SOAP::TestSOAP) [./soap/test_basetype.rb:257]:
<"-0"> expected but was
<"+0">.

How does this dump?
$ ruby -e 'a = -0.0; p (1 / a > 0.0)'

expecting false..

irb(main):002:0> VERSION
=> "1.8.1"
irb(main):001:0> a=-0.0
=> 0.0
irb(main):002:0> 1 / a > 0.0
=> true
irb(main):003:0> 1 / a
=> Infinity

2) Failure:
test_SOAPFloat(SOAP::TestSOAP)
[./soap/test_basetype.rb:161:in `test_SOAPFloat'
./soap/test_basetype.rb:160:in `each'
./soap/test_basetype.rb:160:in `test_SOAPFloat']:
<1.4e-45> expected but was
<0.0>.

Hmm...

ok, my theory about single-precision floats was probably wrong:
irb(main):009:0> 1.0/2**256
=> 8.63616855509444e-78

So as long as SOAP doesn't convert between different float
representations, i have no idea where this error comes from.
[3-9, 28-30; socket]
3) Error:
test_charset(SOAP::TestStreamHandler):
SocketError: getaddrinfo: Temporary failure in name resolution

$ ruby -rsocket -e 'p Socket.getaddrinfo("localhost", "http")'

Same error?

Yes, and "unknown host" with "ping localhost", so i added localhost to my
hosts file, which got rid of those errors... ;)
[10 - 27; strscan]
test_s_mustc(TestStringScanner) [./strscan/test_stringscanner.rb:43]:
Exception raised:
Class: <NotImplementedError>
Message: <"strscan is not C version">
---Backtrace---
/usr/local/lib/ruby/site_ruby/1.8/rscan.rb:18:in `must_C_version'
../strscan/test_stringscanner.rb:44:in `test_s_mustc'
../strscan/test_stringscanner.rb:43:in `assert_nothing_raised'
../strscan/test_stringscanner.rb:43:in `test_s_mustc'
---------------

Delete /usr/local/lib/ruby/site_ruby/1.8/rscan.rb and strscan related
file
(/usr/local/lib/ruby/site_ruby/1.8/i686-linux/* or something).
Would you please try it again then?

Ok, now only the four float errors are left:

Loaded suite .
Started
..................................................................................................................................................................................................................................................................................................................................................................................................................F.F..................basic_auth
is not supported under soap4r + net/http for now.
........................................................................................................................................................................................................................................F.F....................................................................
Finished in 271.976239 seconds.

1) Failure:
test_SOAPDouble(SOAP::TestSOAP) [./soap/test_basetype.rb:257]:
<"-0"> expected but was
<"+0">.

2) Failure:
test_SOAPFloat(SOAP::TestSOAP)
[./soap/test_basetype.rb:161:in `test_SOAPFloat'
./soap/test_basetype.rb:160:in `each'
./soap/test_basetype.rb:160:in `test_SOAPFloat']:
<1.4e-45> expected but was
<0.0>.

3) Failure:
test_XSDDouble(XSD::TestXSD) [./xsd/test_xsd.rb:290]:
<"-0"> expected but was
<"+0">.

4) Failure:
test_XSDFloat(XSD::TestXSD)
[./xsd/test_xsd.rb:194:in `test_XSDFloat'
./xsd/test_xsd.rb:193:in `each'
./xsd/test_xsd.rb:193:in `test_XSDFloat']:
<1.4e-45> expected but was
<0.0>.

724 tests, 7262 assertions, 4 failures, 0 errors
 
N

NAKAMURA, Hiroshi

Hi, Dennis,

Last 2 point.
From: "Dennis Ranke" <[email protected]>
Newsgroups: comp.lang.ruby
Sent: Wednesday, December 24, 2003 3:36 AM
[1, 2, 31, 32; floating point]
1) Failure:
test_SOAPDouble(SOAP::TestSOAP) [./soap/test_basetype.rb:257]:
<"-0"> expected but was
<"+0">.

How does this dump?
$ ruby -e 'a = -0.0; p (1 / a > 0.0)'

expecting false..

irb(main):002:0> VERSION
=> "1.8.1"
irb(main):001:0> a=-0.0
=> 0.0
irb(main):002:0> 1 / a > 0.0
=> true
irb(main):003:0> 1 / a
=> Infinity

On your ruby, "-0.0" shoud be interpreted 0.0. Gotoken hacked and
told me that if I expect "-0.0" to be interpreted as negative zero
in ruby,
"echo 'main(){double a = 0; a = -a; puts(1/a < 0 ? "n" : "p");}' |
gcc -xc - && ./a.out"
must dump "n". May be "p" on your system?

I can use "-1.0 / (1.0 / 0.0)" instead of "-0.0" for soap4r test.
How does this dump?

$ ruby -e 'p(-1.0 / (1.0 / 0.0))'
2) Failure:
test_SOAPFloat(SOAP::TestSOAP)
[./soap/test_basetype.rb:161:in `test_SOAPFloat'
./soap/test_basetype.rb:160:in `each'
./soap/test_basetype.rb:160:in `test_SOAPFloat']:
<1.4e-45> expected but was
<0.0>.

Hmm...

ok, my theory about single-precision floats was probably wrong:
irb(main):009:0> 1.0/2**256
=> 8.63616855509444e-78

So as long as SOAP doesn't convert between different float
representations, i have no idea where this error comes from.

"float" in XML Schema Datatypes (and SOAP) is a single float.
Ruby's is double. So I try to "narrow"? the given double float
to single with

d = given_double # e.g. 1.4e-45
f = (/\A\0*\z/ =~ [d].pack("f")) ? 0.0 : d
sprintf("%.10g", f) # use this as a value of "float"

Maybe I misunderstand something...

$ ruby -e 'p([1.4e-45].pack("f"))'

?
[3-9, 28-30; socket]
3) Error:
test_charset(SOAP::TestStreamHandler):
SocketError: getaddrinfo: Temporary failure in name resolution

$ ruby -rsocket -e 'p Socket.getaddrinfo("localhost", "http")'

Same error?

Yes, and "unknown host" with "ping localhost", so i added localhost to my
hosts file, which got rid of those errors... ;)

:) Thanks.

There shoudl be some architecture/settings where "localhost" is
not defined. But I don't know portable way to test server/client.

Regards,
// NaHi
 
N

NAKAMURA, Hiroshi

Hi,
From: "Osuka Adartse" <[email protected]>
Sent: Wednesday, December 24, 2003 1:01 AM
E:\dev\Src\ruby-1.8.1\test>runner.rb
Loaded suite test
Started
..........................................................................................
.....................................E....................................................
..........................................................................................
..........................................................................................
....................basic_auth is not supported under soap4r + net/http
for now.
..........................................................................................
..........................................................................................
..........................................................................................
................................
Finished in 619.08 seconds.

1) Error:
test_ln(TestFileUtils):
Errno::EINVAL: Invalid argument - data/same or tmp/lndest
E:/usr/local/lib/ruby/1.8/fileutils.rb:246:in `link'
E:/usr/local/lib/ruby/1.8/fileutils.rb:246:in `ln'
E:/usr/local/lib/ruby/1.8/fileutils.rb:244:in `fu_each_src_dest0'
E:/usr/local/lib/ruby/1.8/fileutils.rb:244:in `ln'
E:/dev/Src/ruby-1.8.1/test/fileutils/test_fileutils.rb:389:in `test_ln'
E:/dev/Src/ruby-1.8.1/test/fileutils/test_fileutils.rb:388:in `each'
E:/dev/Src/ruby-1.8.1/test/fileutils/test_fileutils.rb:388:in `test_ln'

682 tests, 7955 assertions, 0 failures, 1 errors

but that's ln, it shouldn't work in windows anyway, isn't it?.
Tested in Win200 pro on cmd and msys shell, compiled with mingw, both
results the same in test_fileutils.rb.

Is it FAT32 filesystem you are running test on? Please ignore this
then.
I'm not sure what the soap4r
above means.

Ignore this, too. It is accepted as soap4r + net/http specification
for now yesterday and I removed this warning.

Regards,
// NaHi
 
O

Osuka Adartse

Hi,



Is it FAT32 filesystem you are running test on? Please ignore this
then. Ok!

Ignore this, too. It is accepted as soap4r + net/http specification
for now yesterday and I removed this warning.

Regards,
// NaHi
Hi

it's fat32 indeed.

cheers
Adartse
 
N

NAKAMURA, Hiroshi

Hi, Simon,
From: "Simon Strandgaard" <[email protected]>
Newsgroups: comp.lang.ruby
Sent: Monday, December 22, 2003 11:16 PM
Just installed ruby-1.8.1-preview4, After this failure, it seems to hang
forever. It would be nice when a testcase exceeds a timelimit, say 15
seconds, outputted to the display which method it currently were
evaluating. I had to CTRL-C it.

'ruby runner.rb -v' dumps the test evaluating.
server> rehash
server> ruby -v
ruby 1.8.1 (2003-12-22) [i386-freebsd5.1]
server> ruby runner.rb
Loaded suite .
Started
..................................................................../home/neoneye
/stow/ruby/lib/ruby/1.8/drb/drb.rb:705:in `open': druby://server.neoneye.home:64
149 - #<Errno::ETIMEDOUT: Operation timed out - connect(2)> (DRb::DRbConnError)
from /home/neoneye/stow/ruby/lib/ruby/1.8/drb/drb.rb:698:in `each'
from /home/neoneye/stow/ruby/lib/ruby/1.8/drb/drb.rb:698:in `open'
from /home/neoneye/stow/ruby/lib/ruby/1.8/drb/drb.rb:1084:in `initialize
'
from /home/neoneye/stow/ruby/lib/ruby/1.8/drb/drb.rb:1067:in `new'
from /home/neoneye/stow/ruby/lib/ruby/1.8/drb/drb.rb:1067:in `open'
from /home/neoneye/stow/ruby/lib/ruby/1.8/drb/drb.rb:1014:in `method_mis
sing'
from /home/neoneye/stow/ruby/lib/ruby/1.8/drb/extserv.rb:16:in `initiali
ze'
from /usr/home/neoneye/install/ruby-1.8.1/test/drb/ut_array.rb:12:in `ne
w'
from /usr/home/neoneye/install/ruby-1.8.1/test/drb/ut_array.rb:12

Hmm. Still happens? How does it says?

$ ruby -d runner.rb

$ ruby -d runner.rb -v drb

Regards,
// NaHi
 
S

Simon Strandgaard

From: "Simon Strandgaard" <[email protected]>
Just installed ruby-1.8.1-preview4, After this failure, it seems to hang
forever. It would be nice when a testcase exceeds a timelimit, say 15
seconds, outputted to the display which method it currently were
evaluating. I had to CTRL-C it.
[snip]
Hmm. Still happens? How does it says?

$ ruby -d runner.rb

Still happens, After a few minutes I CTRL-C it.
The output are available here:

ruby -d runner.rb 1> a.stdout 2> a.stderr
http://neoneye.dk/a.stdout
http://neoneye.dk/a.stderr
$ ruby -d runner.rb -v drb

ruby -d runner.rb -v drb 1> b.stdout 2> b.stderr
http://neoneye.dk/b.stdout
http://neoneye.dk/b.stderr


However if I do like this, it completes with failures:
server> mv drb ..
server> ruby -d runner.rb 1> c.stdout 2> c.stderr
616 tests, 6375 assertions, 0 failures, 67 errors
http://neoneye.dk/c.stdout
http://neoneye.dk/c.stderr



server> ruby -v
ruby 1.8.1 (2003-12-22) [i386-freebsd5.1]
server> uname -a
FreeBSD server.neoneye.home 5.1-RELEASE FreeBSD 5.1-RELEASE #0: Thu Jun 5 02:55:42 GMT 2003 (e-mail address removed):/usr/obj/usr/src/sys/GENERIC i386
server> gcc -v
Using built-in specs.
Configured with: FreeBSD/i386 system compiler
Thread model: posix
gcc version 3.2.2 [FreeBSD] 20030205 (release)
server>
 
T

ts

t> nasun% ruby -vrrbconfig -e 'p Config::CONFIG["CC"]'
t> ruby 1.8.1 (2003-12-22) [sparc-solaris2.8]
t> "gcc -m64 -mcpu=ultrasparc"
t> nasun%

t> nasun% ruby c.rb
t> /usr/home/msys/decoux/local/r181/lib/ruby/1.8/drb/drb.rb:553:in `read':
t> Resource temporarily unavailable (DRb::DRbConnError)

Well, if it work on Solaris-32 and don't work on Solaris-64 this is just
because ruby don't use internally the same algorithm for rb_io_fread().

On the first read(), getc() return EAGAIN with (len == n) and
rb_io_fread() return 0 rather than trying to re-read ???. This is why I
think that ruby give an error




Guy Decoux
 
D

Dennis Ranke

Hi NaHi,
On your ruby, "-0.0" shoud be interpreted 0.0. Gotoken hacked and
told me that if I expect "-0.0" to be interpreted as negative zero
in ruby,
"echo 'main(){double a = 0; a = -a; puts(1/a < 0 ? "n" : "p");}' |
gcc -xc - && ./a.out"
must dump "n". May be "p" on your system?

Yes, it's "p".
I can use "-1.0 / (1.0 / 0.0)" instead of "-0.0" for soap4r test.
How does this dump?

$ ruby -e 'p(-1.0 / (1.0 / 0.0))'

-0.0

and '1.0 / (-1.0 / (1.0 / 0.0))' is

-Infinity
"float" in XML Schema Datatypes (and SOAP) is a single float.
Ruby's is double. So I try to "narrow"? the given double float
to single with

d = given_double # e.g. 1.4e-45
f = (/\A\0*\z/ =~ [d].pack("f")) ? 0.0 : d
sprintf("%.10g", f) # use this as a value of "float"

Maybe I misunderstand something...

$ ruby -e 'p([1.4e-45].pack("f"))'

?

That correctly gives "1.4e-45", while [1.4e-45].pack('f') is
"\000\000\000\000".

Now, since the double is indeed converted to a single-precision float, this
is a known limitation of the Playstation 2 hardware which doesn't support
denormalized floats. The smallest (positive, non-zero) normalized float is
2**-126, and all results smaller than that just (silently) underflow to
zero.

The smallest positive non-zero single-precision float is exactly 2**-149,
so you could change your code to:
f = (d.abs < 2**-149) ? 0.0 : d
:) Thanks.

There shoudl be some architecture/settings where "localhost" is
not defined. But I don't know portable way to test server/client.

Well, it seems that I was the only one to stumble across that up to now
(and it was easily solved on my side), so I don't really think it is a big
issue right now.

Oh, it's the 24th... Merry Christmas, everyone :)
 
N

NAKAMURA, Hiroshi

Hi, Simon,
From: "Simon Strandgaard" <[email protected]>
Newsgroups: comp.lang.ruby
Sent: Wednesday, December 24, 2003 8:31 PM

Still happens, After a few minutes I CTRL-C it.
The output are available here:
Thanks.

ruby -d runner.rb 1> a.stdout 2> a.stderr
http://neoneye.dk/a.stdout
http://neoneye.dk/a.stderr


ruby -d runner.rb -v drb 1> b.stdout 2> b.stderr
http://neoneye.dk/b.stdout
http://neoneye.dk/b.stderr

Hmm. Is "server.neoneye.home" the name of your host ifconfig-ed?
In druby, URI of remote object might be generated by IPSocket#peeraddr.
Though I didn't test and reproduce it, network setting or some kind of
firewall possibly blocks a connection to "server.neoneye.home" from
your machine, I think. How do you think?

# No drb callback seems to be established according to your test log.

Anyway, a test should not block other test as you said. Should be
solved but after 1.8.1.
However if I do like this, it completes with failures:
server> mv drb ..
server> ruby -d runner.rb 1> c.stdout 2> c.stderr
616 tests, 6375 assertions, 0 failures, 67 errors
http://neoneye.dk/c.stdout
http://neoneye.dk/c.stderr

Good. These are all known and fixed problems (sorry). Try CVS or 1.8.1.

Regards,
// NaHi
 
N

NAKAMURA, Hiroshi

Hi, Dennis,
From: "Dennis Ranke" <[email protected]>
Newsgroups: comp.lang.ruby
Sent: Wednesday, December 24, 2003 10:01 PM

-0.0

Thanks. Tests in 1.8.1 use this workaround.
Now, since the double is indeed converted to a single-precision float, this
is a known limitation of the Playstation 2 hardware which doesn't support
denormalized floats. The smallest (positive, non-zero) normalized float is
2**-126, and all results smaller than that just (silently) underflow to
zero.
Hmm.

The smallest positive non-zero single-precision float is exactly 2**-149,
so you could change your code to:
f = (d.abs < 2**-149) ? 0.0 : d

Sure. It's intuitive.

Regards,
// NaHi
 
S

Simon Strandgaard

Hmm. Is "server.neoneye.home" the name of your host ifconfig-ed?

server> hostname
server.neoneye.home
server> ifconfig
xl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet 10.0.0.10 netmask 0xffff0000 broadcast 10.0.255.255
inet6 fe80::210:4bff:fe3e:800c%xl0 prefixlen 64 scopeid 0x1
ether 00:10:4b:3e:80:0c
media: Ethernet 100baseTX
status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
inet 127.0.0.1 netmask 0xff000000
server>

The reason why I have a funny netmask, is that I run a VPN network with
some of my friends.

In druby, URI of remote object might be generated by IPSocket#peeraddr.
Though I didn't test and reproduce it, network setting or some kind of
firewall possibly blocks a connection to "server.neoneye.home" from
your machine, I think. How do you think?

I don't run any firewall on the 'server' machine. However I do run a
firewall on my 'gateway' machine. In no network expert.

# No drb callback seems to be established according to your test log.

Anyway, a test should not block other test as you said. Should be
solved but after 1.8.1.
Great.



Good. These are all known and fixed problems (sorry). Try CVS or 1.8.1.

Will install 1.8.1 immediately.
 

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,777
Messages
2,569,604
Members
45,234
Latest member
SkyeWeems

Latest Threads

Top