lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] do_writemore: invalid length! assertion


From: Yoav Nissim
Subject: [lwip-users] do_writemore: invalid length! assertion
Date: Sun, 27 Dec 2009 12:34:36 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0

Hello.
I have been using lwIP and its socket layer on a Windows platform for a
while now. Its been used by an HTTP client only (for now).
Recently I have encountered the aforementioned assert (and crash).
Investigating this further has directed me to the following sequence of
events:

1. A TCP socket is initialized and connects to a streaming server
2. Thread A reads data from the socket.
3. Thread B sends data on the socket. This send operation is special as
it sends more than tcp_sndbuf() bytes.
4. do_writemore() does not ACK the waiting Thread B, since it waits for
sent_tcp() to trigger sending the next chunk of data.
5. Received data for the socket is processed, do_recv() is called, and
the op_completed semaphore is signalled to complete *the* operation.
6. Thread B wakes up instead of thread A, destroying the message (a
local variable).
7. tcp_sndbuf() bytes are sent, and tcp_sent() calls do_writemore() with
a pointer to the destroyed message.

Is this sequence plausible or have I missed something?
Assuming the sequence is valid, does lwIP support more than a single
thread handling a socket? If so, wouldn't we need a set of locks for all
netconn operations that can happen simultaneously (if there are any)?

Yoav.




reply via email to

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