buglwIP - A Lightweight TCP/IP stack - Bugs: bug #61592, tcp_free_listen(): assertion...

 
 

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

bug #61592: tcp_free_listen(): assertion condition error, should be: pcb->state == LISTEN

Submitted by:  quanjia <quanjia>
Submitted on:  Wed 01 Dec 2021 01:35:42 AM UTC
 
Category:  TCP Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Invalid
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  None
lwIP version:  * git head
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       No canned response available

 

Thu 02 Dec 2021 12:30:14 AM UTC, comment #2: 

comment #1:

> Have you checked that? From reading the code, you can see there's something wrong because the comment doesn't match the assertion. However, your solution is wrong: pcb->state is CLOSED at that point. I guess we would have found out sooner if this was triggering...
>
> I'll probably change the assert anyway, but your proposed change would make it worse.

----thanks, you are right, from reading the context the pcb state is CLOSED

quanjia <quanjia>
Wed 01 Dec 2021 10:05:08 AM UTC, comment #1: 

Have you checked that? From reading the code, you can see there's something wrong because the comment doesn't match the assertion. However, your solution is wrong: pcb->state is CLOSED at that point. I guess we would have found out sooner if this was triggering...

I'll probably change the assert anyway, but your proposed change would make it worse.

Simon Goldschmidt <goldsimon>
Project Administrator
Wed 01 Dec 2021 01:35:42 AM UTC, original submission:  

/** Free a tcp listen pcb */
static void
tcp_free_listen(struct tcp_pcb *pcb)
{
  LWIP_ASSERT("tcp_free_listen: !LISTEN", pcb->state != LISTEN); <----here it should be pcb->state == LISTEN
#if LWIP_TCP_PCB_NUM_EXT_ARGS
  tcp_ext_arg_invoke_callbacks_destroyed(pcb->ext_args);
#endif
  memp_free(MEMP_TCP_PCB_LISTEN, pcb);
}

this might cause resource leak.

quanjia <quanjia>

 

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

Attach Files:
   
   
Comment:
   

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by quanjia (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.

    Only logged-in users can vote.

     

     

     

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-12-01 goldsimon StatusNone => Invalid
        Assigned toNone => goldsimon
        Open/ClosedOpen => Closed
    2021-12-01 quanjia Attached File- => Added 0001-tcp_free_listen-assertion-condition-error-should-be-.patch, #52394

    Back to the top


    Powered by Savane 3.9