printf crashes?
Joel Sherrill
joel.sherrill at OARcorp.com
Tue Nov 18 21:03:31 UTC 2008
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.
> 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.
>
--
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherrill at OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
More information about the users
mailing list