Message-ID: <016701c110c6$a371d580$056aaac0@kjlin> From: "kjlin" Subject: weird printf problem Date: Fri, 20 Jul 2001 10:49:45 +0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0164_01C11109.B05F54A0" Sender: owner-linux-mips@oss.sgi.com To: linux-mips@oss.sgi.com Message-ID: <20010720024945.nm6moX_IgtctagdllpsFad59ZyRR0vGGyxlVcaU0XY0@z> This is a multi-part message in MIME format. ------=_NextPart_000_0164_01C11109.B05F54A0 Content-Type: text/plain; charset="big5" Content-Transfer-Encoding: quoted-printable Hi all, I ported linux to my embeded board and encountered a weird "printf" = problem. The library i used is uClibc. I made the kernel to run a testing program directly after boot up. In my case, less "printf" work well but more will fail. Here is my testing program: main() { int i=3D0; while(i<200) { printf("Hello World=3D%d\n",i); i++; } } =20 The output message will die at "Hello World=3D10" or "Hello World=3D168" = or "Hello World=3D76" ........ Every times the message dies at different place but it will never = successfully be outputed "200" times. However, if the condition is changed to "while(i<100)", then everything = is fine. It is so weird!! Why too much "printf" will cause the program to die? Is it the problem of uClibc or kernel? Does the compiler for my testing program concern this weird problem? Can anybody give me some hints? Thanks, KJ ------=_NextPart_000_0164_01C11109.B05F54A0 Content-Type: text/html; charset="big5" Content-Transfer-Encoding: quoted-printable
Hi all,
 
I ported linux to my embeded board and = encountered a=20 weird "printf" problem.
The library i used is uClibc.
I made the kernel to run a testing program directly = after boot=20 up.
In my case, less "printf" work well but more = will=20 fail.
Here is my testing program:
 
main()
{
    int i=3D0;
 
   =20 while(i<200)
    {
    &= nbsp;          =20 printf("Hello=20 World=3D%d\n",i);
        &nbs= p;      =20 i++;
    }
}
 
The output message will die at "Hello = World=3D10" or "Hello=20 World=3D168" or "Hello World=3D76" ........
Every times the message dies at different = place but it will never successfully be outputed "200"=20 times.
However, if the condition is changed to = "while(i<100)",=20 then everything is fine.
It is so weird!!
Why too much "printf" will cause the program to=20 die?
Is it the problem of uClibc or kernel?
Does the compiler for my testing program concern this weird = problem?
Can anybody give me some hints?
 
Thanks,
KJ
------=_NextPart_000_0164_01C11109.B05F54A0--