lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #34569] shutdown(SHUT_WR) crashes netconn api


From: Amir Shalem
Subject: [lwip-devel] [bug #34569] shutdown(SHUT_WR) crashes netconn api
Date: Mon, 17 Oct 2011 06:48:14 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1

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

                 Summary: shutdown(SHUT_WR) crashes netconn api
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: amirshalem
            Submitted on: Mon 17 Oct 2011 06:48:13 AM GMT
                Category: sockets
                Severity: 3 - Normal
              Item Group: Crash Error
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 
            lwIP version: CVS Head

    _______________________________________________________

Details:

I'm using the GIT head of lwIP
While developing with lwIP api/sockets.c, I was to able to crash it.

If you open a SOCK_STREAM (tcp) socket, and having it established you
shutdown(SHUT_WR) it
It is still possible to receive data on the TCP connection,
usually you receive the FIN+ACK from the other side.
However, when you shutdown(SHUT_WR) --> netconn_shutdown(conn, shut_rx=0,
shut_tx=1) --> netconn_close_shutdown(conn, NETCONN_SHUT_WR) -->
do_close(NETCONN_SHUT_WR) --> do_close_internal(NETCONN_SHUT_WR)

after do_close_internal successfully calls tcp_shutdown()
it always does conn->pcb.tcp = NULL;
and when our stack receives the FIN+ACK from the other side,
our netconn recv_tcp() is called, and asserts for:
LWIP_ASSERT("recv_tcp: recv for wrong pcb!", conn->pcb.tcp == pcb);

Please note I must use SHUT_WR to inform the other side for connection
termination, and then wait for his RST/FIN response.

I hope to be able to provide an example of this crash in the upcoming week, as
I'm developing a Python bindings for lwIP. My sockets code example is written
completely in Python. Soon you will be able to unit-test lwIP API with
Python.

Thanks,
Amir Shalem




    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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