Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 472592

Summary: net-misc/iputils[idn] breaks number parsing of command line flags by using locale-dependent strtod()
Product: Gentoo Linux Reporter: Sergey Fionov <fionov>
Component: [OLD] Core systemAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: normal Keywords: PATCH
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: fallback to C locale if strtod() fails

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