printf crashes?

Neil Mayes neil.mayes at googlemail.com
Wed Nov 19 19:54:16 UTC 2008


> Message: 3
> Date: Tue, 18 Nov 2008 15:03:31 -0600
> From: Joel Sherrill <joel.sherrill at OARcorp.com>
> Subject: Re: printf crashes?
> To: Leon Pollak <leonp at plris.com>
> Cc: "rtems-users at rtems.com" <rtems-users at rtems.com>
> Message-ID: <49232DA3.60204 at oarcorp.com>
> Content-Type: text/plain; charset="us-ascii"; format=flowed
>
> Leon Pollak wrote:
>> Hello, all.
>>
>> For the third day I am fighting with the problem: my rtems 4.8.0, MPC8260
>> application performs "brunch to zero address" (break point is set on address
>> zero) from inside the:
>> ../newlib/libc/stdio/fflush.c:196 (_fflush_r routine)
>> ../newlib/libc/stdio/fvwrite.c:257 (__sfvwrite_r routine)
>> ../newlib/libc/stdio/vfprintf.c:177 (__sprint_r routine)
>> ../newlib/libc/stdio/vfprintf.c:1329 (_vfprintf_r routine)
>> ../newlib/libc/stdio/printf.c:52 (printf routine)
>> and the calling printf is:
>> printf("W=%d P=%d\n", 1, 1);
>>
>> The question is: as I do printf from several tasks (may be simultaneously),
>> may this be the cause of the problem somehow?
>>
>>
> I doubt it but it is possible that you are blowing a stack
> or have a buffer/variable on the stack that is getting overwritten
> so when you return, you find yourself with a bad return address.
Is this an issue after a soft reset? I had an issue with 4.8.0 printf
crashing after a soft reset on the ERC32, however with limited debug
tools and time I was unable to get to the bottom of it. I also had
printf from several tasks but that should be fine. The same code would
run fine with a hard reset.

>> I know that newlib is re-entrant, if some precautions are taken. But are they
>> taken by default, or I need to do something special (never previously used
>> printf extensively)?
>>
>> Many thanks ahead for any advice.
>>
Regards,
Neil Mayes
SSTL



More information about the users mailing list