lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Problems with ASSERTION in tcp_in and tcp_out


From: Justin Bayles
Subject: Re: [lwip-users] Problems with ASSERTION in tcp_in and tcp_out
Date: Wed, 16 Jun 2004 14:24:03 +1000

Hello Leon,

interesting. Let me ask a few questions before making false assumptions.
you describe your application as having a read and write process. Do
they share one instance of lwIP or do they each have an instance of lwIP?

Each process has its own instance of lwIP.

> I have narrowed in on the source of my problems.
>
> When processes send tcp packets and receive ACKs at the same time, the
>
What exactly do you mean by "at the same time"? Do you mean the SLIP
receive thread can be pre-empted by the TCP thread and vice versa.?

I mean that it is possible for tcp_in to be removing PCBs from the unacked queue while tcp_enqueue is putting them in. This may not be the problem though because I tried wrapping access to the unacked and unsent queues in a semaphore and still get the assertion.

All threads are fully preemptable.

> pcb->snd_queuelen is being corrupted. tcp_out is busy adding PCBs to the
> send queue in tcp_enqueue() while tcp_in is pulling them out in
> tcp_receive(). It all depends on who changes the pcb->snd_queuelen first
> as to whether the process crashes in tcp_in or tcp_out.
>
Are you directly calling the tcp_*() functions?

No, I am not directly calling the tcp_*() functions.


> Is this a problem that other people have experienced? Am I doing
> something
> wrong with my implementation.
>
Well, at least we should find out what is wrong. In the best case, we
need to document lwIP better.

Regards,

Leon.

Would it be helpful if I sent you a copy of my sys_arch.c file? You might be able to spot an id10t error.
Thanks for persisting with me,
Justin



> Thanks,
> Justin
>
> >From: "Justin Bayles" <address@hidden>
> >Reply-To: Mailing list for lwIP users <address@hidden>
> >To: address@hidden
> >Subject: Re: [lwip-users] Problems with ASSERTION in tcp_in and tcp_out
> >Date: Fri, 11 Jun 2004 10:59:33 +1000
> >
> >Hi Leon,
> >
> >I am using the 0.7.2 release to do a win32 port.
> >
> >I am using the slip interface with Named Pipes as the physical layer. Each
> >netif connects to the Named Pipe Server. The Named Pipe Server is a
> >separate process that creates a thread to listen to each pipe. When a full > >slip packet arrives, the thread transmits the slip packet down every pipe
> >except the pipe that the packet came from. The write is protected by a
> >semaphore so that pipes will only ever receive one slip packet at a time.
> >This has no effect on the lwip stack. It emulates a shared transmission
> >medium.
> >
> >I have a read process that listens for incoming connection requests,
> >connects, receives data and prints it to stdout. The read process has three > >threads running: the tcpip thread, the slipif thread and the main thread. > >The tcpip thread is generated by lwip. The slipif thread reads bytes from > >the serial interface (pipe), and forwards complete slip packets to the ip > >layer. The main thread is an infinite loop on netconn_recv, netbuf_data,
> >netbuf_delete etc.
> >
> >I have a write process that connects to the read process and sends packets > >every half a second using netconn_write. The write process also has three > >threads running: the tcpip thread, the slipif thread and the main thread.
> >
> >Sometime I get up to 250 successful transmissions before the ASSERTION in
> >tcp_out or tcp_in is called. I think I have a re-entrancy problem.
> >
> >Thanks,
> >Justin
> >
> >
> >
> >>From: Leon Woestenberg <address@hidden>
> >>Reply-To: Mailing list for lwIP users <address@hidden>
> >>To: Mailing list for lwIP users <address@hidden>
> >>Subject: Re: [lwip-users] Problems with ASSERTION in tcp_in and tcp_out
> >>Date: Thu, 10 Jun 2004 18:54:00 +0200
> >>
> >>Hello Justin,
> >>
> >>
> >>Justin Bayles wrote:
> >>
> >>>I am having trouble with the following assertions:
> >>>
> >>>"Assertion "tcp_enqueue: valid queue length" failed at line 139 in
> >>>.\src\core\tcp
> >>>_out.c"
> >>>
> >>>"Assertion "tcp_receive: valid queue length" failed at line 801 in
> >>>.\src\core\tcp
> >>>_in.c"
> >>>
> >>>Could people please suggest some possible solutions to these errors? I > >>>have read previous posts from the archive on this topic however they have
> >>>not helped.
> >>>
> >>Could you mention the version of lwIP you are using? As well as some
> >>details on your application.
> >>
> >>Regards,
> >>
> >>Leon.
> >>
> >>
> >>
> >>_______________________________________________
> >>lwip-users mailing list
> >>address@hidden
> >>http://lists.nongnu.org/mailman/listinfo/lwip-users
> >
> >_________________________________________________________________
> >What's your house worth? Click here to find out:
> >http://www.ninemsn.realestate.com.au
> >
> >
> >
> >_______________________________________________
> >lwip-users mailing list
> >address@hidden
> >http://lists.nongnu.org/mailman/listinfo/lwip-users
>
> _________________________________________________________________
> Get a Credit Card - 60 sec online response:
> http://ad.au.doubleclick.net/clk;8097459;9106288;b?http://www.anz.com/aus/promo/qantas5000ninemsn
>    [AU only]
>
>
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users


_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users

_________________________________________________________________
Open an Online Savings Account today & collect a bonus $30*! http://clk.atdmt.com/1DG/go/hsb005000991dg/direct/01/





reply via email to

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