What happened to the profile?

Dirk Hohndel dirk at hohndel.org
Mon Oct 7 07:34:34 UTC 2013


On Mon, 2013-10-07 at 11:44 +0200, Robert Helling wrote:
> On 07.10.2013, at 10:22, Linus Torvalds <torvalds at linux-foundation.org> wrote:
> 
> Linux,

Hehehe :-)

> > On Mon, Oct 7, 2013 at 12:23 AM, Robert Helling <helling at lmu.de> wrote:
> >> 
> >> https://www.dropbox.com/s/3fat0kws2isqzkc/Screenshot%202013-10-07%2009.18.23.png
> >> 
> >> Below is a profile with the binary I compiled on Friday, above the current master. Of course both are showing the same file. Is this intentional?
> > 
> > Looks like something rounds to integer values. It's probably the glib
> > removal code: I suspect ascii_strtod() is buggered. It uses "atof()",
> > and likely re-introduced the bug that caused us to use ascii_strtod()
> > in the first place. I'm guessing you have a german locale, and thus
> > have the decimal point set to ',' and then atof() parses "3.5" as "3".
> > 
> > That "ascii_strtod()" function really looks completely broken. It
> > seems to be missing the whole "ascii" point, and instead does
> > pointless things like "NaN" and "infinity" parsing. I'm guessing Dirk
> > copied it from some odd source..
> 
> indeed, that is the source of the problem. Here is a patch/hack that fixes it:

I don't think it's a hack... it seems like what I should have done, had
I spent the time to think through the code that I copied from Ruby. The
code that I copied was posted in response to the locale confusion, but
clearly is not addressing that at all, now that I read it more
carefully.

Oops.

> It replaces atof by atof_l which takes an additional locale argument
> where I force feed it en_US. If this is considered to be the way to go,
> this locale for numeric values should be allocated once and for all in
> some startup code (where?) and not every time we have to parse a number
> in an xml file as it is now.

That seems like a reasonable approach.

Except that atof_l doesn't appear to exist on Linux. Some googling seems
to imply that this is a BSD-ism that hasn't made its way to Linux. So
back to square 1...

Thiago - I'm sure there is this brilliant easy to use Qt function that
will solve all our problems, correct?

/D




More information about the subsurface mailing list