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




On 27 May 1998, Ulrich Drepper wrote:

> 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.

Unless this code has changed substantially since 1.09, this routine an
enormous amount of stack space.  I was investigating the use of glibc
1.0[89] for embedded systems use and discovered that printing an FP number
required over 40K of stack space for a simple test case.

This may not be causing you problems but it is something to be aware of
when debugging.

--joel
Joel Sherrill                    Director of Research & Development
joel@OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (205) 722-9985





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