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

Submitted by:  Simon Goldschmidt <goldsimon>
Submitted on:  Tue 25 Aug 2009 02:25:26 PM UTC  
 
Category: TCPSeverity: 3 - Normal
Item Group: Crash ErrorStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned 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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.

 

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 (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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 19 Jan 2010 06:35:45 PM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1