buglwIP - A Lightweight TCP/IP stack - Bugs: bug #49392, TCP leaks memory when...

 
 

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

bug #49392: TCP leaks memory when LWIP_TCPIP_CORE_LOCKING_INPUT disabled.

Submitted by:  Yosic <yosic>
Submitted on:  Thu 20 Oct 2016 11:53:17 AM UTC  
 
Category: Platform portsSeverity: 2 - Minor
Item Group: Crash ErrorStatus: Invalid
Privacy: PublicAssigned to: None
Open/Closed: ClosedPlanned Release: None
lwIP version: Other

Thu 03 Nov 2016 11:12:08 AM UTC, comment #2:

Thanks, Simon. There was no buffer free in case of 'netif->input()' returns != ERR_OK. So the issue is on my side.
Bug can be closed.

Yosic <yosic>
Wed 02 Nov 2016 11:53:29 AM UTC, comment #1:

The only real difference between the LWIP_TCPIP_CORE_LOCKING_INPUT settings is that when it is 0, you pass input messages via a message queue. So I could imagine you lose messages that don't fit into your queue. However, both this and the freeing of RX pbufs that don't get accepted are in the responsibility of your port or netif driver, so I don't think there's much chance in fixing this in our lwIP code...

You'll have to come up with more details: try to find out what's in the leaked memory (RX pbufs or what else)? Also, check what your driver does when 'netif->input()' returns != ERR_OK.

And ensure your port's 'sys_mbox_trypost()' returns != ERR_OK when the mbox is full. Then, there could still be a bug in your port's implementation of that function in that you think entries are written but they aren't.

Simon Goldschmidt <goldsimon>
Project Administrator
Thu 20 Oct 2016 11:53:17 AM UTC, original submission:

I have embedded system that runs simple http server.
Every request(new connection) is served in separated thread and then socket closes. I have about 30kb heap and it get exhausted after about 5000-7000 requests. Especially this reproduces when there are 3-5 or more simultaneous requests to the server at once.
This issue is not reproduced when LWIP_TCPIP_CORE_LOCKING_INPUT is 1. So I think there could be something connected with messages inside the stack since LWIP_TCPIP_CORE_LOCKING_INPUT changes the execution flow to avoid using messages.
I use v2.0.RC2

Yosic <yosic>

 

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

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 03 Nov 2016 11:31:17 AM UTCgoldsimonStatusNeed Info=>Invalid
      Open/ClosedOpen=>Closed
    Wed 02 Nov 2016 11:53:29 AM UTCgoldsimonCategoryTCP=>Platform ports
      Severity3 - Normal=>2 - Minor
      StatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1