buglwIP - A Lightweight TCP/IP stack - Bugs: bug #18960, Slow / incomplete HTTP responses.


You are not allowed to post comments on this tracker with your current authentication level.

bug #18960: Slow / incomplete HTTP responses.

Submitted by:  None
Submitted on:  Mon 05 Feb 2007 05:30:56 AM UTC  
Category:  TCP Severity:  2 - Minor
Item Group:  None Status:  Need Info
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Planned Release:  None
lwIP version:  None

( Jump to the original submission)

Mon 21 May 2007 04:49:56 PM UTC, comment #7: 

I propose to close it as invalid, except if "anonymous" tell us it's really due to lwip code...

Frédéric Bernon <fbernon>
Project Member
Mon 26 Feb 2007 12:58:56 PM UTC, comment #6: 

This looks like a bug in a port, and without further information I'm not sure we can make progress on it.

Kieran Mansley <kieranm>
Project Member
Wed 07 Feb 2007 12:12:03 PM UTC, comment #5: 

Have you tried contacting Niktech for support?  From the sound of it they have ported it to their platform, and without details of how they have ported it it will be very hard to us to get to the bottom of your problem.

Wed 07 Feb 2007 04:08:32 AM UTC, comment #4: 

more information ...

if I declare the struct tcp_pcb *pcb as static ...
as below ...
the problem goes away .. no need for the printf anymore.

maybe the pcb pointer is being optimised away by the compiler or have I got stack problems ? I dont know this code really well so any comments are much appreciated.

tcp_input(struct pbuf p, struct netif inp)
  static struct tcp_pcb pcb, prev;
  struct tcp_pcb_listen *lpcb;
  u8_t hdrlen;
  err_t err;

Wed 07 Feb 2007 03:23:34 AM UTC, comment #3: 

Yes there does seem to be some kind of timing issue going on ....
it seems that sometimes the address of pcb->remote_port resolves to an illegal address and causes gdb to  dump out. If I printf the address of pcb->remote_port the problem is not evident.

I have played with some of the MSS size settings and timing in lwipopts but everything else is as it comes.

Note my printf is directed to a custom crt console output on the gdb connected serial port.

The CPU is a 'soft' FPGA based 32 bit risc called MANIK running at  50 Mhz  ( http://www.niktech.com )  ... this is currently running on a Xilinx Spartan 3E  starter kit board
and utilises the 'easymac' module ( also from Niktech ). The code is compiled with GCC 3.4.4 single thread model crosscompiler for the Manik on an FC6 platform.
Niktech provides all the VHDL sources, and GPL tools to build the  platform.

I am using the LWIP 'easymac' API demo from the Niktech site. I am not entirely sure which version of LWIP the Niktech demo is based on however no changes to LWIP are required to compile. I am using  1.2 

Other than this problem ( pointer and erratic web ) LWIP is excellent. I can ping -f , do a http request and ARP and it seems to work well.

lwip opts attached.

(file #11937)

Tue 06 Feb 2007 10:54:50 AM UTC, comment #2: 

Sounds like you have a software race, which in turn is probably caused by locking problems, and this results in (perhaps) the TCP timers not functioning correctly.  By adding the printf you have changed the timing, and so made one problem go away.

Can you check that you have ensured there is never more than one thread active in the lwIP code at any one time? 

Could you also supply your lwipopts configuration, and giove some details of the hardware and lwIP APIs that you are using?

Kieran Mansley <kieranm>
Project Member
Tue 06 Feb 2007 01:55:37 AM UTC, comment #1: 

Further information ... no longer seems to crash if I put a printf statement as below .... however httpd response times still erratic.

    LWIP_ASSERT("tcp_input: active pcb->state != LISTEN", pcb->state != LISTEN);


printf("pcb->remote_port == tcphdr->src    %X     %X\n", pcb->remote_port, tcphdr->src);

    if (pcb->remote_port == tcphdr->src &&
       pcb->local_port == tcphdr->dest &&
       ip_addr_cmp(&(pcb->remote_ip), &(iphdr->src)) &&
       ip_addr_cmp(&(pcb->local_ip), &(iphdr->dest))) {

Mon 05 Feb 2007 05:30:56 AM UTC, original submission:  

Program received signal SIGBUS, Bus error.
0x04005d36 in tcp_input (p=0x400d248, inp=0x4000000) at ../../../contrib/../lwip/src/core/tcp_in.c:173
173         if (pcb->remote_port == tcphdr->src &&

My LWIP implementation gives me variable mileage with the demo HTTPD.  Sometimes the page loads immediately ... other times incomplete or really slowly.

When a slow load occurs ... gdb always dumps at the same point as above.

Any clues would be useful. Thanks.



Attached Files
file #11937:  lwipopts.h added by None (13KiB - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by fbernon (Posted a comment)
  • -email is unavailable- added by kieranm (Posted a comment)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-05-22 kieranm Open/ClosedOpen => Closed
    2007-02-26 kieranm Severity3 - Normal => 2 - Minor
        StatusNone => Need Info
    2007-02-07 None Attached File- => Added lwipopts.h, #11937

    Back to the top

    Powered by Savane 3.5