Assertion - tcp_receieve: valid queue length

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

Assertion - tcp_receieve: valid queue length

Prateek Jain
Hello,
 
  I am getting the following assertions.
 
1.
        if (pcb->snd_queuelen != 0) {
          LWIP_ASSERT("tcp_receive: valid queue length", pcb->unacked != NULL ||
                      pcb->unsent != NULL);
        }
 
2.  
 if (queuelen != 0) {
    LWIP_ASSERT("tcp_enqueue: pbufs on queue => at least one queue non-empty",
      pcb->unacked != NULL || pcb->unsent != NULL);
  }
 
I couldn't figure out the reason till now.
 
Based on previous mails on the same topic, I will give some information about my application.
 
I am writing ftp client which will use PPP. This application will run on ARM with uCos OS. 
Iam running three LWIP threads. LWIP version is lwip-1.1.0
 
1. My FTP CLient App
2. PPP thread.
3. TCPIP Thread.
 
I have used tcpip_input in netif_add as follows:
 
  if (netif_add(&pc->netif, &pc->addrs.our_ipaddr, &pc->addrs.netmask, &pc->addrs.his_ipaddr, (void *)pd, pppifNetifInit, tcpip_input)) {
 
Iam using tcp_write API to send the data. This API is called from FTP CLient App context.
 
I have to send a lot of data ( 150 files of size 20 KB). For every file I open a new connection (tcp_connect) and close it once data goes(tcp_close). This is the way FTP server expects(opening and closing new data conn) -PASV mode
 
Any inputs will be highly appreciated.
 
Thanks
Prateek
 

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

Re: Assertion - tcp_receieve: valid queue length

Kieran Mansley
On Fri, 2006-01-06 at 18:16 +0530, Prateek Jain wrote:

> Iam running three LWIP threads. LWIP version is lwip-1.1.0
>  
> 1. My FTP CLient App
> 2. PPP thread.
> 3. TCPIP Thread.
>  

Smells like a locking issue to me.  Make sure you're ensuring all calls
are appropriately protected by locks.

Kieran



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

Re: Assertion - tcp_receieve: valid queue length

Prateek Jain
Hi Kieran,
 
  Iam not sure which calls are you talking about. Do you mean I should lock tcp_write and tcp_process. Becase both will access the same structures.
 
Sorry.........I am still in the learning phase.
 
Prateek

 
On 1/6/06, Kieran Mansley <[hidden email]> wrote:
On Fri, 2006-01-06 at 18:16 +0530, Prateek Jain wrote:

> Iam running three LWIP threads. LWIP version is lwip-1.1.0
>
> 1. My FTP CLient App
> 2. PPP thread.
> 3. TCPIP Thread.
>

Smells like a locking issue to me.  Make sure you're ensuring all calls
are appropriately protected by locks.

Kieran



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


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

Re: Assertion - tcp_receieve: valid queue length

Kieran Mansley
On Fri, 2006-01-06 at 20:41 +0530, Prateek Jain wrote:
> Hi Kieran,
>  
>   Iam not sure which calls are you talking about. Do you mean I should
> lock tcp_write and tcp_process. Becase both will access the same
> structures.
>  

Yes, if you're making calls into the tcp stack from more than one
thread, or from an interrupt handler or similar and the application (for
example), you need to protect the stack with locks.  The higher level
"sequential API" and "sockets API" do this for you, but the raw API that
you're using doesn't.  I think - if anyone knows otherwise (things might
have changed since I last looked!) please correct me.

Kieran



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

Re: Assertion - tcp_receieve: valid queue length

陳 小擁
hi .
i meet the same problem . it am using LwIP 1.0 without OS . when i try to send some data form my platform to the PC . however , when i using tcp_write() . I can't get any data in the PC . and it will print the Assertion like that :
Assertion -- tcp_enquene : valid queue length .
after read the mail-list . i use tcp_output() after the tcp_write();
 
>err = tcp_write(temp_pcb , &abc[j] , sizeof(abc[j]),0) ;
>     tcp_output(temp_pcb) ;
after that , it will print :
Assertion -- tcp_receieve : valid queue length . i can't come up with it . can some tell me how to send data in tcp_write without OS ? 
 
 

_______________________________________
YM - 離線訊息
就算你沒有上網,你的朋友仍可以留下訊息給你,當你上網時就能立即看到,任何說話都冇走失。
http://messenger.yahoo.com.hk
_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users