[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: test-fprintf-posix3.c:
From: |
Bruce Korb |
Subject: |
Re: test-fprintf-posix3.c: |
Date: |
Fri, 12 Nov 2010 07:57:44 -0800 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.12) Gecko/20100914 SUSE/3.0.8 Thunderbird/3.0.8 |
On 11/11/10 18:51, Bruno Haible wrote:
>> Breakpoint 2, main (argc=2, argv=0x7fffffffdd38)
>> at ../../tests/test-fprintf-posix3.c:97
>> 97 return 1;
>> (gdb) p repeat
>> $1 = 0
>> (gdb) p errno
>> $2 = 12
>> $ egrep ENOMEM $(find /usr/include -type f -name 'err*.h')
>> /usr/include/asm-generic/errno-base.h:#define ENOMEM 12
>>
>> It returned ENOMEM on the first try.
92 d->dir = (DIRECTIVE *) malloc (d_allocated * sizeof (DIRECTIVE));
(gdb) p d_allocated
$3 = 1
(gdb) n
93 if (d->dir == NULL)
(gdb) p *d
$4 = {count = 0, dir = 0x0, max_width_length = 140737488343584,
max_precision_length = 140737349717056}
(gdb) n
95 goto out_of_memory_1;
A "DIRECTIVE" is not very big:
/* A parsed directive. */
typedef struct
{
const char* dir_start;
const char* dir_end;
int flags;
const char* width_start;
const char* width_end;
size_t width_arg_index;
const char* precision_start;
const char* precision_end;
size_t precision_arg_index;
char conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
size_t arg_index;
}
char_directive;