Bug 15201 - memory leak on temporary of struct imessaging_post_state and struct tevent_immediate on struct imessaging_context (in rpcd_spoolss and maybe others)
Summary: memory leak on temporary of struct imessaging_post_state and struct tevent_im...
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: DCE-RPCs and pipes (show other bugs)
Version: 4.17.0
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Jule Anger
QA Contact: Samba QA Contact
URL: https://gitlab.com/samba-team/samba/-...
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-12 15:06 UTC by Stefan Metzmacher
Modified: 2022-10-19 12:26 UTC (History)
3 users (show)

See Also:


Attachments
Patches for v4-17-test (12.10 KB, text/plain)
2022-10-18 07:36 UTC, Stefan Metzmacher
no flags Details
Patches for v4-16-test (require patches from bug #15159) (11.97 KB, text/plain)
2022-10-18 07:41 UTC, Stefan Metzmacher
no flags Details
Patches for v4-17-test (9.52 KB, text/plain)
2022-10-18 07:45 UTC, Stefan Metzmacher
slow: review+
Details
Patches for v4-16-test (9.52 KB, text/plain)
2022-10-18 07:46 UTC, Stefan Metzmacher
slow: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Metzmacher 2022-10-12 15:06:58 UTC
In many places we use imessaging_init() or imessaging_client_init() to create
a temporary struct imessaging_context and in most places we use a temporary tevent_context.

In that case any message the process receives gets queued up on the
temporary tevent contexts, see imessaging_dgm_recv() and imessaging_post_self().

As these temporary tevent contexts never run tevent_loop_once(), they'll
never reach imessaging_post_handler() and the struct imessaging_post_state
and struct tevent_immediate per message stay forever.
Comment 1 Samba QA Contact 2022-10-13 13:33:20 UTC
This bug was referenced in samba master:

a120fb1c724dfaed5a99e34aaf979502586f17c0
32df5e4961cf064b72bb496157cc6092126d9b8e
266bcedc18efc52e29efde6bad220623a5423e30
Comment 2 Stefan Metzmacher 2022-10-18 07:36:29 UTC
Created attachment 17568 [details]
Patches for v4-17-test
Comment 3 Stefan Metzmacher 2022-10-18 07:41:08 UTC
Created attachment 17569 [details]
Patches for v4-16-test (require patches from bug #15159)
Comment 4 Stefan Metzmacher 2022-10-18 07:43:51 UTC
Comment on attachment 17568 [details]
Patches for v4-17-test

This attachment is for bug #15200 not #15201
Comment 5 Stefan Metzmacher 2022-10-18 07:44:16 UTC
Comment on attachment 17569 [details]
Patches for v4-16-test (require patches from bug #15159)

This attachment is for bug #15200 not #15201
Comment 6 Stefan Metzmacher 2022-10-18 07:45:40 UTC
Created attachment 17570 [details]
Patches for v4-17-test
Comment 7 Stefan Metzmacher 2022-10-18 07:46:40 UTC
Created attachment 17571 [details]
Patches for v4-16-test
Comment 8 Ralph Böhme 2022-10-19 08:10:24 UTC
Reassigning to Jule for inclusion in 4.16 and 4.17.
Comment 9 Jule Anger 2022-10-19 08:40:08 UTC
Pushed to autobuild-v4-{17,16}-test.
Comment 10 Samba QA Contact 2022-10-19 09:46:11 UTC
This bug was referenced in samba v4-16-test:

6ba44033e3869196982e67a8f757f34a5e1f2788
04d0d5a0366ec92a7cafcf56e0cf2c74780c0eed
c28d971b12bab1342d9ad0a8475deef647e5aa1b
Comment 11 Samba QA Contact 2022-10-19 09:52:03 UTC
This bug was referenced in samba v4-17-test:

68a0ef3b5215f37c74e7831db36a0b360ee661ca
28c65ce3e923deaa273e4dabd7c6228c803b03c7
7540755de6a0fcc8b9b34fdcca777c77b8de9402
Comment 12 Jule Anger 2022-10-19 10:51:33 UTC
Closing out bug report.

Thanks!
Comment 13 Samba QA Contact 2022-10-19 12:26:34 UTC
This bug was referenced in samba v4-17-stable (Release samba-4.17.1):

68a0ef3b5215f37c74e7831db36a0b360ee661ca
28c65ce3e923deaa273e4dabd7c6228c803b03c7
7540755de6a0fcc8b9b34fdcca777c77b8de9402