-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
bgpd: rfapi: fix mem leak when killed #18045
base: master
Are you sure you want to change the base?
bgpd: rfapi: fix mem leak when killed #18045
Conversation
…ng timer Signed-off-by: G. Paul Ziemba <[email protected]>
d8bea53
to
125a480
Compare
as a note for something that needs exploration in the rfapi code -> There is a pattern of setting the vnc.import.timer thread pointer to NULL and then calling event_add_timer. This pattern has caused problems in the past where memory allocated and pointed to by the event/thread get's leaked or worse when that event hasn't expired but the data structures that are used by that event/thread get yanked out from underneath it(say some form of no command) and the underlying code has no way to get ahold of that event/thread since the pointer to it in it's space is gone. This will cause crashes! I don't necessarily think this should hold up this memory leak problem but it is a pattern that the rfapi code should be aware of and fix. |
here is the code I am talking about |
Interesting. Even the original code from 2009 had an equivalent pattern |
I've definately fixed a few bugs from code using that pattern from taht time period. |
does this need the same fix? |
I think this will be a different fix, because the allocation here didn't occur while shutting down. But I suspect that both this case as well as the case addressed by this PR were triggered by some change in the ordering of FRR infrastructure cleanup during shutdown (which revealed some latent omission in the rfapi cleanup routine). |
ci:rerun |
Something changed in the bgpd termination sequence, leading to rfapi objects not being freed via their usual timed expiration pathway. This change frees rfapi peer BPIs immediately instead of expiring via timer when bgp is terminating.