buglwIP - A Lightweight TCP/IP stack - Bugs: bug #27316, netconn: Possible deadlock in...

 
 

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

bug #27316: netconn: Possible deadlock in err_tcp

Submitter:  Simon Goldschmidt <goldsimon>
Submitted:  Tue 25 Aug 2009 02:25:26 PM UTC
   
 
Category:  TCP Severity:  3 - Normal
Item Group:  Crash Error Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  None
lwIP version:  CVS Head

Tue 19 Jan 2010 06:35:45 PM UTC, comment #2: 

Fixed by using sys_mbox_trypost in err_tcp:
- if recvmbox/acceptmbox is not full, NULL will be added to the mbox,
- if one of them is full, recv/accept will fail the next time as conn->last_err is now fatal

Simon Goldschmidt <goldsimon>
Group administrator
Sun 17 Jan 2010 04:35:39 PM UTC, comment #1: 

Idea: add flag 'closed' to struct netconn and in netconn_recv, use sys_mbox_tryfetch when 'closed' is != 0.

Simon Goldschmidt <goldsimon>
Group administrator
Tue 25 Aug 2009 02:25:26 PM UTC, original submission:  

As reported by Eran Rundstein on lwip-users, there may be a deadlock when err_tcp is called and the recvmbox or acceptmbox is full.

The reason is sys_mbox_post is used instead of sys_mbox_trypost. This might block the tcpip_thread, which should be avoided.

Possible solutions are
- Require the platform port to always allow NULL to be posted at least once, then we could use sys_mbox_trypost
- Use another mechanism to pass the info (that the connection is closed) to the application - could be harder to implement as we may not block reading on the mbox in the application thread (since there might be no more data coming)

Simon Goldschmidt <goldsimon>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-01-19 goldsimon StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code