From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id f6O2fSt07770 for linux-mips-outgoing; Mon, 23 Jul 2001 19:41:28 -0700 Received: from viditec-netmedia.com.tw (61-220-240-70.HINET-IP.hinet.net [61.220.240.70]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id f6O2fJO07762 for ; Mon, 23 Jul 2001 19:41:19 -0700 Received: from kjlin ([61.220.240.66]) by viditec-netmedia.com.tw (8.10.0/8.10.0) with SMTP id f6O4j0v16641 for ; Tue, 24 Jul 2001 12:45:00 +0800 Message-ID: <01b701c113e7$9cbba1c0$056aaac0@kjlin> From: "kjlin" To: References: <016701c110c6$a371d580$056aaac0@kjlin> Subject: Re: weird printf problem Date: Tue, 24 Jul 2001 10:23:22 +0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_01B4_01C1142A.AA6963A0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Sender: owner-linux-mips@oss.sgi.com Precedence: bulk This is a multi-part message in MIME format. ------=_NextPart_000_01B4_01C1142A.AA6963A0 Content-Type: text/plain; charset="big5" Content-Transfer-Encoding: quoted-printable My kernel version is 2.4.1 and the processor is an MIPS R4000 style = embedded processor. I ues the serial port as my console. I found that the reason why the printf message will not be completely = outputed is the process of my testing program will not be selected again = by the schedular after outputing some message. Its "state" is TASK_INTERRUPTIBLE but the return value of = signal_pending(prev) is zero. Therefore, it is deleted from running queue in schedul() and never wake = up. asmlinkage void schedule(void) { ... ... move_rr_back: switch (prev->state) { case TASK_INTERRUPTIBLE: if (signal_pending(prev)) { prev->state =3D TASK_RUNNING; break; } default: del_from_runqueue(prev); (<---- Be = deleted here!) case TASK_RUNNING: } ... ... } I am not familiar with the machanism of tty_write(). Can any body tell me where should be chceked over? My serial driver is modified based on drivers/char/serial.c Thanks. ----- Original Message -----=20 From: kjlin=20 To: linux-mips@oss.sgi.com=20 Sent: Friday, July 20, 2001 10:49 AM Subject: weird printf problem 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_01B4_01C1142A.AA6963A0 Content-Type: text/html; charset="big5" Content-Transfer-Encoding: quoted-printable
My kernel version is 2.4.1 and the processor is an = MIPS R4000=20 style embedded processor.
I ues the serial port as my console.
I found that the reason why the printf message will = not be=20 completely outputed is the process of my testing program will not be = selected=20 again by the schedular after outputing some message.
Its "state" is TASK_INTERRUPTIBLE but the return = value of=20 signal_pending(prev) is zero.
Therefore, it is deleted from running = queue in=20 schedul() and never wake up.
 
asmlinkage void schedule(void)
{
...
...
move_rr_back:

         = switch=20 (prev->state)=20 {
           &n= bsp;    =20 case=20 TASK_INTERRUPTIBLE:
        &n= bsp;           &nb= sp;   =20 if (signal_pending(prev))=20 {
           &n= bsp;           &nb= sp;        =20 prev->state =3D=20 TASK_RUNNING;
         &n= bsp;           &nb= sp;          =20 break;
          &nbs= p;            = ; =20 }
           &n= bsp;    =20 default:
          &= nbsp;           &n= bsp; =20 del_from_runqueue(prev);       (<--= -- Be=20 deleted=20 here!)
         =        =20 case TASK_RUNNING:
       =20 }
...
...
}
 
I am not familiar with the machanism of=20 tty_write().
Can any body tell me where should be chceked=20 over?
My serial driver is modified based on=20 drivers/char/serial.c
 
Thanks.
----- Original = Message -----
From:=20 kjlin
To: linux-mips@oss.sgi.com
Sent: Friday, = July 20, 2001 10:49 AM
Subject: weird = printf problem

Hi all,
 
I ported linux to my embeded board and = encountered=20 a weird "printf" problem.
The library i used is uClibc.
I made the kernel to run a testing program = directly after=20 boot 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=20 "Hello 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=20 problem?
Can anybody give me some hints?
 
Thanks,
KJ
------=_NextPart_000_01B4_01C1142A.AA6963A0-- From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <01b701c113e7$9cbba1c0$056aaac0@kjlin> From: "kjlin" References: <016701c110c6$a371d580$056aaac0@kjlin> Subject: Re: weird printf problem Date: Tue, 24 Jul 2001 10:23:22 +0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_01B4_01C1142A.AA6963A0" Sender: owner-linux-mips@oss.sgi.com To: linux-mips@oss.sgi.com Message-ID: <20010724022322.E1bztbPswhTA9h2MjcHiJLmfFvK0Wb0yX-qhLoPdCSE@z> This is a multi-part message in MIME format. ------=_NextPart_000_01B4_01C1142A.AA6963A0 Content-Type: text/plain; charset="big5" Content-Transfer-Encoding: quoted-printable My kernel version is 2.4.1 and the processor is an MIPS R4000 style = embedded processor. I ues the serial port as my console. I found that the reason why the printf message will not be completely = outputed is the process of my testing program will not be selected again = by the schedular after outputing some message. Its "state" is TASK_INTERRUPTIBLE but the return value of = signal_pending(prev) is zero. Therefore, it is deleted from running queue in schedul() and never wake = up. asmlinkage void schedule(void) { ... ... move_rr_back: switch (prev->state) { case TASK_INTERRUPTIBLE: if (signal_pending(prev)) { prev->state =3D TASK_RUNNING; break; } default: del_from_runqueue(prev); (<---- Be = deleted here!) case TASK_RUNNING: } ... ... } I am not familiar with the machanism of tty_write(). Can any body tell me where should be chceked over? My serial driver is modified based on drivers/char/serial.c Thanks. ----- Original Message -----=20 From: kjlin=20 To: linux-mips@oss.sgi.com=20 Sent: Friday, July 20, 2001 10:49 AM Subject: weird printf problem 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_01B4_01C1142A.AA6963A0 Content-Type: text/html; charset="big5" Content-Transfer-Encoding: quoted-printable
My kernel version is 2.4.1 and the processor is an = MIPS R4000=20 style embedded processor.
I ues the serial port as my console.
I found that the reason why the printf message will = not be=20 completely outputed is the process of my testing program will not be = selected=20 again by the schedular after outputing some message.
Its "state" is TASK_INTERRUPTIBLE but the return = value of=20 signal_pending(prev) is zero.
Therefore, it is deleted from running = queue in=20 schedul() and never wake up.
 
asmlinkage void schedule(void)
{
...
...
move_rr_back:

         = switch=20 (prev->state)=20 {
           &n= bsp;    =20 case=20 TASK_INTERRUPTIBLE:
        &n= bsp;           &nb= sp;   =20 if (signal_pending(prev))=20 {
           &n= bsp;           &nb= sp;        =20 prev->state =3D=20 TASK_RUNNING;
         &n= bsp;           &nb= sp;          =20 break;
          &nbs= p;            = ; =20 }
           &n= bsp;    =20 default:
          &= nbsp;           &n= bsp; =20 del_from_runqueue(prev);       (<--= -- Be=20 deleted=20 here!)
         =        =20 case TASK_RUNNING:
       =20 }
...
...
}
 
I am not familiar with the machanism of=20 tty_write().
Can any body tell me where should be chceked=20 over?
My serial driver is modified based on=20 drivers/char/serial.c
 
Thanks.
----- Original = Message -----
From:=20 kjlin
To: linux-mips@oss.sgi.com
Sent: Friday, = July 20, 2001 10:49 AM
Subject: weird = printf problem

Hi all,
 
I ported linux to my embeded board and = encountered=20 a weird "printf" problem.
The library i used is uClibc.
I made the kernel to run a testing program = directly after=20 boot 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=20 "Hello 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=20 problem?
Can anybody give me some hints?
 
Thanks,
KJ
------=_NextPart_000_01B4_01C1142A.AA6963A0--