-
Notifications
You must be signed in to change notification settings - Fork 3k
NSAPI/lwIP: Free held netbuf on close #3975
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
mbed_lwip_socket_recv() takes one netbuf at a time from the netconn API, and it holds a partially-read netbuf if necessary in order to present as a stream for TCP. This held netbuf was not being freed when the socket was closed.
One note on this netbuf thing for future consideration - the netbuf API isn't ideal for TCP, as TCP doesn't internally hold netbufs, so netconn_recv() itself allocates a temporary netbuf just to make TCP match UDP and raw. As we know this path is TCP-only, you could use netconn_recv_tcp_pbuf to skip that step, and just work on the pbufs. |
/morph test-nightly |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
Restarted jenkins CI, please look at the result once done The current failures are 3 identified, one of them for instance |
The branch was deliberately created based on an old revision, partly to test whether your CI was correctly testing the merge result with master, or just testing the tip of the branch. It seems it might just be testing the tip. I could rebase the branch, but maybe you want to check your CI configuration? |
@kjbracey-arm The mbed-client part of the jenkins/pr-head build doesn't currently do the merge. There's a task to add it, but I'm not sure what the status of it is at the moment. |
@kjbracey-arm We'll fix it soon (TM). If you're in a hurry with this PR I'd suggest rebasing. |
I'm not personally in a hurry - it's just to address the GitHub issue referenced - a slightly hard-to-cause memory leak. So I'm happy to leave it for the moment as a testcase. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍
@0xc0170 I believe Jenkins has been fiddled with successfully. Could you retrigger? |
@kjbracey-arm @0xc0170 I just restarted the job. |
mbed_lwip_socket_recv() takes one netbuf at a time from the netconn API,
and it holds a partially-read netbuf if necessary in order to present as
a stream for TCP.
This held netbuf was not being freed when the socket was closed.
Fixes issue #3974.