This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: gmtime_r hanging
- From: "Daniel O'Connor" <doconnor at gsoft dot com dot au>
- To: Joel Sherrill <joel dot sherrill at OARcorp dot com>
- Cc: "newlib at sourceware dot org" <newlib at sourceware dot org>
- Date: Tue, 20 Dec 2011 09:31:18 +1030
- Subject: Re: gmtime_r hanging
- References: <2fjtm06n1bo9n66l56krvged.1324300875378@email.android.com>
On 19/12/2011, at 23:51, Joel Sherrill wrote:
> There is always the possibility of a real bug but seeing a 128 byte buffer on the stack makes me wonder if you have blown the stack.
>
> What is the stack address range? Check the stack pointer. You can always fill the stack memory with a pattern and see how much is written to.
Ahh good thinking, but it doesn't appear to be the case :(
I tried using malloc as well as shrinking it to 40 bytes with no change.
I tried the following code (directly in main)..
i = 1;
sprintf(buf, "%d\r\n", i);
printf("bar %d\r\n", i);
a = 10000;
b = 500;
i = a / b;
puts(buf);
printf("foo %d\r\n", i);
and the printf jumps to 0, if i remove i = a / b; then it doesn't.. Colour me confused :(
--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
-- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C