Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 472592 - net-misc/iputils[idn] breaks number parsing of command line flags by using locale-dependent strtod()
Summary: net-misc/iputils[idn] breaks number parsing of command line flags by using lo...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2013-06-07 15:10 UTC by Sergey Fionov
Modified: 2015-04-25 00:46 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
fallback to C locale if strtod() fails (iputils-locale.patch,702 bytes, patch)
2013-06-07 15:51 UTC, Sergey Fionov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Fionov 2013-06-07 15:10:24 UTC
My old script contained "ping -i 0.5 192.168.1.1" command does not work anymore, because new iputils uses locale-dependent strtod().

The commit introduced this is http://www.linux-ipv6.org/gitweb/gitweb.cgi?p=gitroot/iputils.git;a=commit;h=04d3f79834957dc760850b00b8b52efa14e74757

I think that it breaks compatibility and should fallback to C locale or old method when strtod() fails.

Reproducible: Always

Steps to Reproduce:
1. Run "ping -i 0.5 192.168.1.1" with locale that uses "," delimiter for float numbers, e.g. "ru_RU.UTF-8" or "de_DE.UTF-8".

Actual Results:  
ping: bad timing interval


Expected Results:  
ping with 0.5 seconds interval
Comment 1 Sergey Fionov 2013-06-07 15:51:03 UTC
Created attachment 350346 [details, diff]
fallback to C locale if strtod() fails

I also noticed that it happens only with USE="idn", when LC_ALL is not reset.

Proposed patch is in attachment.
Comment 2 David Heidelberg (okias) 2014-04-29 18:06:25 UTC
We couldn't reproduce this on lastest iputils [1]. Could you try iputils from ::ixit overlay [2] and retest?

[1] https://github.com/iputils/iputils
[2] http://gpo.zugaina.org/net-misc/iputils
Comment 3 SpanKY gentoo-dev 2014-04-29 19:31:38 UTC
(In reply to David Heidelberger (okias) from comment #2)

any the commit that fixed it is ... ?  the code in question is fairly simple, so it should be easy to track down what changed.
Comment 4 Sergey Fionov 2014-04-29 21:56:13 UTC
(In reply to David Heidelberger (okias) from comment #2)
> We couldn't reproduce this on lastest iputils [1]. Could you try iputils
> from ::ixit overlay [2] and retest?
The problem persists with latest iputils.

Steps to reproduce with upstream:
1) make USE_IDN=1
2) generate "ru_RU.UTF-8" or "de_DE.UTF-8" locale
3) run LANG="ru_RU.UTF-8" ping -i 0.5 g.co
Comment 5 SpanKY gentoo-dev 2015-04-25 00:46:43 UTC
should be all set now in the tree; thanks for the report!

Commit message: Fix -i number parsing in some locales
http://sources.gentoo.org/net-misc/iputils/files/iputils-20121221-strtod.patch?rev=1.1
http://sources.gentoo.org/net-misc/iputils/iputils-99999999.ebuild?r1=1.15&r2=1.16