kernel stack overflow

Submitted by prital
on June 28, 2005 - 1:39pm

Hello,
I run the following user application 'test' :
void main()
{
int n=0;
FILE * fp = fopen ("/log_file" , "w");

while(1)
{
fprintf(fp,"\nStart loop %d", n++);
fflush(fp);
sleep(60);
}
fclose(fp);
}

After some hours, I get the following message:

Kernel stack overflow in process c785c000, r1=c785c4c0
NIP: C000FDCC XER: 20000000 LR: C000F404 SP: C785C4C0 REGS: c785c410 TRAP: 0800
Not tainted
MSR: 00009030 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11
DEAR: 206661A7, ESR: 00000000
TASK = c785c000[129] 'test' Last syscall: 54

How can I solve this problem?
Thank you very much.