lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [lwip-users] Memory corruption problem with NIOS lwip port


From: David Aldrich
Subject: RE: [lwip-users] Memory corruption problem with NIOS lwip port
Date: Thu, 26 Feb 2004 14:23:57 -0000

Hi Kaos

Thanks for your reply. Actually, the fault seems to have been caused by
a call to atoi().  I do not understand it yet, but I commented out that
line and the code now runs fine.

David

> -----Original Message-----
> From: Kaos [mailto:address@hidden 
> Sent: Wednesday, February 25, 2004 3:41 PM
> To: Mailing list for lwIP users
> Subject: Re: [lwip-users] Memory corruption problem with NIOS 
> lwip port
> 
> 
> My experience with printf is that it uses alot of stack 
> (compared to the 
> amount of bytes involved in the resulting buffer). So it 
> might be worth 
> while to verify the stack usage (and const value) before, during and 
> after the printf call.
> 
> Rgds,
> Andreas
> 
> David Aldrich wrote:
> 
> > Hi
> > 
> > I have an application running on an Altera NIOS processor core.  I 
> > have used the Altera PLUGS network stack but it has some 
> deficiencies 
> > and has insufficient performance for my application.
> > 
> > I am now experimenting with a NIOS port of LWIP.  I have a 
> small test 
> > application that demonstrates the port by running a very 
> simple http 
> > server.  This test app works fine, so the port works.
> > 
> > However, when I add to this test application, to migrate it 
> toward my 
> > real application, I run into problems.  I have little to go 
> on except 
> > that my main() starts with a printf statement as follows:
> > 
> > const char * kpszVersion = "1.18";
> > 
> > printf("My app version %s\n\r", kpszVersion);
> > 
> > With just two C++ modules in my application, the message prints 
> > correctly.  When I add a simple, third module, the version 
> number is 
> > incorrect and hundreds of characters spew to the screen.  
> So I believe 
> > the constant kpszVersion is being corrupted yielding a very long 
> > string. This did not happen when linking with PLUGS.
> > 
> > I cannot identify the cause of this behaviour.  It would 
> seem that the 
> > memory allocated to the constant is being corrupted at 
> runtime, or is 
> > never initialised.
> > 
> > Can anyone suggest a reason for what is happening please?
> > 
> > Best regards
> > 
> > David
> > 
> > 
> > _______________________________________________
> > lwip-users mailing list
> > address@hidden 
> http://mail.gnu.org/mailman/listinfo/lwip-> users
> 
> 
> 
> 
> 
> _______________________________________________
> 
> lwip-users mailing list
> address@hidden http://mail.gnu.org/mailman/listinfo/lwip-users
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]