This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gmtime_r hanging


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







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