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.

Submitter:  Yosic <yosic>
Submitted:  Thu 20 Oct 2016 11:53:17 AM UTC
   
 
Category:  Platform ports Severity:  2 - Minor
Item Group:  Crash Error Status:  Invalid
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Planned 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>
Group 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>

 

(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 (Posted a comment)
  • -email is unavailable- added by yosic (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-03 goldsimon StatusNeed Info Invalid
        Open/ClosedOpen Closed
    2016-11-02 goldsimon CategoryTCP Platform ports
        Severity3 - Normal 2 - Minor
        StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code