Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
strange string-to-float error on ubuntu karmic (alpha)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  13 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Mathijs  
View profile  
 More options Sep 27 2009, 4:19 am
From: Mathijs <bluescreen...@gmail.com>
Date: Sun, 27 Sep 2009 01:19:25 -0700 (PDT)
Local: Sun, Sep 27 2009 4:19 am
Subject: strange string-to-float error on ubuntu karmic (alpha)
Hi,

I just installed ubuntu's upcoming release (which will have a final
release in exactly 1 month).
Just for playing/testing ofcourse, not for anything serious.
I did all updates/upgrades up to today, and installed REE (20090610).
Installation worked, as did installation of all gems I use.
When running a rails app, I noticed some strange behaviour(rails
wanting to return xml for every request), which I traced down to the
way strings are cast into floats:

irb(main):001:0> "0.9".to_f
=> 9.0
irb(main):002:0> "0.901".to_f
=> 901.0
irb(main):003:0> "1.901".to_f
=> 1901.0

Since to_f dives into c code, I'm backing off there.

Now, I know karmic is still alpha, but they did have some freeze for
this release, so this will probably happen to final too.
Ubuntu's bundled ruby packages don't seem to have the problem.
I tried recompiling them again from source too (to make sure the
problem is not related to the compiler/headers installed), but they
still work fine.
So it seems to be something with REE.

Anyone else seen this problem?

Greetings,
Mathijs


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nikolai Lugovoi  
View profile  
 More options Sep 27 2009, 5:24 pm
From: Nikolai Lugovoi <nlugo...@gmail.com>
Date: Sun, 27 Sep 2009 14:24:57 -0700 (PDT)
Local: Sun, Sep 27 2009 5:24 pm
Subject: Re: strange string-to-float error on ubuntu karmic (alpha)

On Sep 27, 11:19 am, Mathijs <bluescreen...@gmail.com> wrote:

Hi,
I encountered same problem compiling old ruby-1.8.6  on Fedora 12,
that also uses GCC 4.4.1, as Karmic

At first I couldn't even believe it :), but then found, it was fixed
in later releases, since r16863.

And, funny, it was enough to set errno = 0 in  util.c/ruby_strtod() to
make parsing work again:

http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_7/util....

@@ -2103,6 +2112,7 @@
     const char *s2;
 #endif

+    errno = 0;
     sign = nz0 = nz = 0;
     dval(rv) = 0.;
     for (s = s00;;s++)

Hope that helps :)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom Zeng  
View profile  
 More options Sep 27 2009, 8:05 pm
From: Tom Zeng <tom.z.z...@gmail.com>
Date: Sun, 27 Sep 2009 20:05:42 -0400
Local: Sun, Sep 27 2009 8:05 pm
Subject: Re: strange string-to-float error on ubuntu karmic (alpha)

I got the same thing few weeks ago on Fedora 10 64bit - on both AMD and
Intel processors, so gave it up.  Works fine on my 32 bit notebook running
Ubuntu 8.04.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nikolai Lugovoi  
View profile  
 More options Sep 27 2009, 10:39 pm
From: Nikolai Lugovoi <nlugo...@gmail.com>
Date: Mon, 28 Sep 2009 05:39:56 +0300
Local: Sun, Sep 27 2009 10:39 pm
Subject: Re: strange string-to-float error on ubuntu karmic (alpha)
Well, it looks like the real origin of problem was from some dtoa.c
code, see http://patrakov.blogspot.com/2009/03/dont-use-old-dtoac.html

And that was fixed(?)  in mainline ruby:
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/util.c?...

As a workaround, adding gcc compilation flag -fno-strict-aliasing ,
should fix it.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mathijs Kwik  
View profile  
 More options Sep 28 2009, 3:00 am
From: Mathijs Kwik <bluescreen...@gmail.com>
Date: Mon, 28 Sep 2009 09:00:31 +0200
Local: Mon, Sep 28 2009 3:00 am
Subject: Re: strange string-to-float error on ubuntu karmic (alpha)
thanks all.
I'll use the CFLAG for now and I hope the next REE will include the patch.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom Zeng  
View profile  
 More options Sep 28 2009, 3:18 am
From: Tom Zeng <tom.z.z...@gmail.com>
Date: Mon, 28 Sep 2009 03:18:51 -0400
Local: Mon, Sep 28 2009 3:18 am
Subject: Re: strange string-to-float error on ubuntu karmic (alpha)

thanks Nikolai for posting the links to the workaround.  I just checked my
problems were all with gcc 4.4.1 on Fedora 11, will try compiling REE again
with flag.

On Sun, Sep 27, 2009 at 10:39 PM, Nikolai Lugovoi <nlugo...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nikolai Lugovoi  
View profile  
 More options Sep 29 2009, 8:56 am
From: Nikolai Lugovoi <nlugo...@gmail.com>
Date: Tue, 29 Sep 2009 05:56:30 -0700 (PDT)
Local: Tues, Sep 29 2009 8:56 am
Subject: Re: strange string-to-float error on ubuntu karmic (alpha)
Ok, so today is released
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-linux], MBARI 0x8770,
Ruby Enterprise Edition 20090928

But, still not friendly for gcc-4.4.1, tried on fc12, and archlinux,
now in more obscure way:

make test-all in source dir just hangs, eating 90% CPU,

GDB backtrace:
#0  b2d (a=<value optimized out>, e=<value optimized out>) at util.c:
1769
#1  0x080cb995 in ratio (b=<value optimized out>, a=<value optimized
out>) at util.c:1946
#2  ruby_strtod (b=<value optimized out>, a=<value optimized out>) at
util.c:2798
#3  0x0809e2c6 in ruby_yylex () at parse.y:4074
#4  ruby_yyparse () at parse.c:4376
#5  0x080a1a8c in yycompile (f=0xbfa674b2 "test/soap/
test_basetype.rb", line=1) a

so, minimal hang test to hang:
ruby -c test/soap/test_basetype.rb

Workaround: add -fno-strict-aliasing to CFLAGS


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joe Damato  
View profile  
 More options Nov 11 2009, 12:51 pm
From: Joe Damato <ice...@gmail.com>
Date: Wed, 11 Nov 2009 09:51:08 -0800 (PST)
Local: Wed, Nov 11 2009 12:51 pm
Subject: Re: strange string-to-float error on ubuntu karmic (alpha)

On Sep 29, 4:56 am, Nikolai Lugovoi <nlugo...@gmail.com> wrote:

dtoa.c should be updated so that no-strict-aliasing can be removed
ASAP. no-strict-aliasing kills performance.

hongli: any word on when you'll be able to pull in the updated
dtoa.c  ?

Joe


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hongli Lai  
View profile  
 More options Dec 16 2009, 1:48 pm
From: Hongli Lai <hon...@phusion.nl>
Date: Wed, 16 Dec 2009 10:48:03 -0800
Local: Wed, Dec 16 2009 1:48 pm
Subject: Re: strange string-to-float error on ubuntu karmic (alpha)
Hi guys.

I'm currently staying in a hotel so I don't have a fast enough
Internet connection to download a Linux distro with GCC 4.4. Can any
of you confirm that applying

http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/util.c?...

fixes the problem even if -fno-strict-aliasing is removed?

Thanks!
- Hongli
--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: i...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hongli Lai  
View profile  
 More options Jan 3 2010, 2:38 pm
From: Hongli Lai <hon...@phusion.nl>
Date: Sun, 3 Jan 2010 20:38:07 +0100
Local: Sun, Jan 3 2010 2:38 pm
Subject: Re: strange string-to-float error on ubuntu karmic (alpha)
Strange, it does not look like I can reproduce the issue. I've tried
REE 2009.10 on:
- Ubuntu 9.10 32-bit
- Ubuntu 9.10 64-bit
GCC 4.4.1 was used to compile it. "0.9".to_f evaluates to 0.9 as
expected. Even if I compile everything with "-fstrict-aliasing", it
still works properly.

It does not look like 2009.10 includes a fixed dtoa which only makes
this observation weirder.

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: i...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mathijs Kwik  
View profile  
 More options Jan 3 2010, 3:10 pm
From: Mathijs Kwik <bluescreen...@gmail.com>
Date: Sun, 3 Jan 2010 21:10:10 +0100
Local: Sun, Jan 3 2010 3:10 pm
Subject: Re: strange string-to-float error on ubuntu karmic (alpha)
indeed strange.
I thought it got fixed, since for me it's working fine now.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hongli Lai  
View profile  
 More options Jan 4 2010, 11:33 am
From: Hongli Lai <hongli...@gmail.com>
Date: Mon, 4 Jan 2010 17:33:23 +0100
Local: Mon, Jan 4 2010 11:33 am
Subject: Re: strange string-to-float error on ubuntu karmic (alpha)
I am merging REE against Ruby 1.8.7-p248. The upstream version
contains the util.c fix.

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: i...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew Roth  
View profile  
 More options Jan 4 2010, 4:23 pm
From: Andrew Roth <andrewr...@gmail.com>
Date: Mon, 4 Jan 2010 13:23:05 -0800 (PST)
Local: Mon, Jan 4 2010 4:23 pm
Subject: Re: strange string-to-float error on ubuntu karmic (alpha)
I got it only with the 1.8.6 version that moonshine installs.
http://assets.railsmachine.com/other/ruby-enterprise-1.8.6-20090610.t...
1.8.7 worked ok.

On Jan 3, 3:10 pm, Mathijs Kwik <bluescreen...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »