bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: %<.prec>d formatting


From: Andrew J. Schorr
Subject: Re: %<.prec>d formatting
Date: Wed, 11 Jan 2006 17:14:45 -0500
User-agent: Mutt/1.4.1i

On Wed, Jan 11, 2006 at 02:03:11PM -0800, John H. DuBois III wrote:
> gawk-printf's memory use seems to go exponential with large values of
> .precision in the %d formatter.
> 
> Observed in gawk 3.1.5 under OpenServer and 3.1.4 under Linux, both on x86
> platforms.
> 
> $ gawk 'BEGIN {printf "%.48d\n",1}'
> gawk: fatal: format_tree: obuf: can't allocate 1073741824 bytes of memory (Not
> enough space)
> 
> $ gawk 'BEGIN {printf "%.51d\n",1}'
> gawk: fatal error: internal error
> Abort

Yes, I found this bug a few weeks ago:

http://lists.gnu.org/archive/html/bug-gnu-utils/2005-12/msg00102.html

A possible patch is attached that fixes a few other issues
as well (but changes some behavior with respect to how
printf "%d" is handled for very large values).

Regards,
Andy

Attachment: format_tree.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]