[bug #18960] Slow / incomplete HTTP responses.

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[bug #18960] Slow / incomplete HTTP responses.

Ondrej Lufinka

URL:
  <http://savannah.nongnu.org/bugs/?18960>

                 Summary: Slow / incomplete HTTP responses.
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: None
            Submitted on: Monday 02/05/2007 at 05:30 UTC
                Category: TCP
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

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 &&
(gdb)

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.




    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?18960>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



_______________________________________________
lwip-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #18960] Slow / incomplete HTTP responses.

Ondrej Lufinka

Follow-up Comment #1, bug #18960 (project lwip):

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))) {


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?18960>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



_______________________________________________
lwip-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #18960] Slow / incomplete HTTP responses.

Ondrej Lufinka

Follow-up Comment #2, bug #18960 (project lwip):

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?


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?18960>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



_______________________________________________
lwip-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #18960] Slow / incomplete HTTP responses.

Ondrej Lufinka

Follow-up Comment #3, bug #18960 (project lwip):

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  (
www.niktech.com )  ... this is currently running on a Xilinx Spartan 3E
starter kit board
http://www.xilinx.com/xlnx/xebiz/designResources/ip_product_details.jsp?key=HW-SPAR3E-SK-UShttp://www.xilinx.com/xlnx/xebiz/designResources/ip_product_details.jsp?key=HW-SPAR3E-SK-US
 
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)
    _______________________________________________________

Additional Item Attachment:

File name: lwipopts.h                     Size:12 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?18960>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



_______________________________________________
lwip-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #18960] Slow / incomplete HTTP responses.

Ondrej Lufinka

Follow-up Comment #4, bug #18960 (project lwip):

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.

void
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;


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?18960>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



_______________________________________________
lwip-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #18960] Slow / incomplete HTTP responses.

Ondrej Lufinka

Follow-up Comment #5, bug #18960 (project lwip):

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.


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?18960>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



_______________________________________________
lwip-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #18960] Slow / incomplete HTTP responses.

Ondrej Lufinka

Update of bug #18960 (project lwip):

                Severity:              3 - Normal => 2 - Minor              
                  Status:                    None => Need Info              

    _______________________________________________________

Follow-up Comment #6:

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

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?18960>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



_______________________________________________
lwip-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #18960] Slow / incomplete HTTP responses.

Ondrej Lufinka

Follow-up Comment #7, bug #18960 (project lwip):

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


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?18960>

_______________________________________________
  Message posté via/par Savannah
  http://savannah.nongnu.org/



_______________________________________________
lwip-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #18960] Slow / incomplete HTTP responses.

Ondrej Lufinka

Update of bug #18960 (project lwip):

             Open/Closed:                    Open => Closed                


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?18960>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



_______________________________________________
lwip-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-devel