This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: strange printf failures


Philip Blundell <Philip.Blundell@pobox.com> writes:

> An example of this is printf(), particularly with floating point arguments.  
> It often seems to output complete garbage (not even digits).

This seems like a problem with the GMP functions.  In
stdio-common/vfprintf.c there is a nested function hack_digit which
generates the digits.  Normally the __mpn_mul_1 function is used to
multiply the number by 10 to get the next digit.  So this would would
be the first function to examine.  The other function involved is
mpn_divmod.

For both functions I'd suggest getting with the debugger down into the
__printf_fp function and find the bits for the long numbers
representing the numbers for with printf fails.  Than construct such a
testcase using the gmp functions and test it.

-- Uli
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]