buglwIP - A Lightweight TCP/IP stack - Bugs: bug #34569, shutdown(SHUT_WR) crashes netconn...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #34569: shutdown(SHUT_WR) crashes netconn api

Submitted by:  Amir Shalem <amirshalem>
Submitted on:  Mon 17 Oct 2011 06:48:13 AM UTC  
 
Category: sockets/netconnSeverity: 3 - Normal
Item Group: Crash ErrorStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: CVS Head

Mon 17 Oct 2011 05:47:16 PM UTC, comment #1:

Fixed, thanks for reporting!

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Mon 17 Oct 2011 06:48:13 AM UTC, original submission:

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

Amir Shalem <amirshalem>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by goldsimon (Posted a comment)
  • -unavailable- added by amirshalem (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 17 Oct 2011 05:47:16 PM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed
      Planned Release=>1.4.1

    Back to the top


    Powered by Savane 3.1-cleanup1