buglwIP - A Lightweight TCP/IP stack - Bugs: bug #27955, netconn_close may nether return...

 
 

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

bug #27955: netconn_close may nether return when LWIP_TCPIP_CORE_LOCKING enabled

Submitted by:  Dmirti Snejko <dsnejko>
Submitted on:  Fri 06 Nov 2009 02:10:19 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: 1.3.1

Sun 22 Nov 2009 04:09:45 PM UTC, comment #1:

Totally right. Thanks for reporting this.

Fixed by directly calling sys_sem_signal instead of TCPIP_APIMSG_ACK.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Fri 06 Nov 2009 02:10:19 AM UTC, original submission:

When received RST from a remote side TCPIP core sets netconn->err to ERR_RST and netconn->pcb.tcp to NULL.
Closing the connection with netconn_close(netconn) finally makes the core to call do_close callback:
void
do_close(struct api_msg_msg *msg)
{
#if LWIP_TCP
if ((msg->conn->pcb.tcp != NULL) && (msg->conn->type == NETCONN_TCP)) {
msg->conn->state = NETCONN_CLOSE;
do_close_internal(msg->conn);
/* for tcp netconns, do_close_internal ACKs the message */
} else
#endif /* LWIP_TCP */
{
msg->conn->err = ERR_VAL;
TCPIP_APIMSG_ACK(msg); // <- the bug
}
}

which in this case supposed to call macro TCPIP_APIMSG_ACK(msg) to release the application layer. With LWIP_TCPIP_CORE_LOCKING enabled macro TCPIP_APIMSG_ACK(msg) is defined empty. As result the application layer blocks on waiting conn->op_completed semaphore, netconn_close nether returns.

Instead calling TCPIP_APIMSG_ACK(msg) it should be replaced with :
if (msg->conn->op_completed != SYS_SEM_NULL) {
sys_sem_signal(msg->conn->op_completed);

as do_delconn(struct api_msg_msg *msg) does.

Dmirti Snejko <dsnejko>

 

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 dsnejko (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
    Sun 22 Nov 2009 04:09:45 PM UTCgoldsimonOpen/ClosedOpen=>Closed
      StatusNone=>Fixed
      Assigned toNone=>goldsimon

    Back to the top


    Powered by Savane 3.1-cleanup1