[DTrace-devel] [PATCH 1/6] uprobes: don't leak one fd per uprobe created

Steven Sistare steven.sistare at oracle.com
Tue May 23 16:36:11 UTC 2023


Patches 1-6 work for qemu, thanks!

# qemu-system-x86_64 &
# dtrace -l -P qemu$(pgrep qemu-s) | wc -l
2120

- Steve

On 5/22/2023 4:20 PM, Nick Alcock wrote:
> An unfortunate typo led to us leaking one fd to uprobe_events
> every time we created a uprobe.  (Spotted when creating thousands of
> them, and dtprobed ran out of fds.)
> 
> Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
> ---
>  libcommon/uprobes.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libcommon/uprobes.c b/libcommon/uprobes.c
> index bc430fef05f48..e910b9e6af44c 100644
> --- a/libcommon/uprobes.c
> +++ b/libcommon/uprobes.c
> @@ -289,7 +289,7 @@ uprobe_create_named(dev_t dev, ino_t ino, uint64_t addr, const char *spec, int i
>  		     args ? args : "");
>  
>  out:
> -	if (fd == -1)
> +	if (fd != -1)
>  		close(fd);
>  	free(args);
>  	if (rc < 0) {
> 
> base-commit: f543fa6706c0b31364356c01bf3de63e3cce8ad1
> prerequisite-patch-id: fa667248b7b02e92ee6b3807123ebcf2ac0acc38
> prerequisite-patch-id: 0cec5f1a31d528a493d6143644c1e6b78c7f403b
> prerequisite-patch-id: 1e1ced5fcec01a0c2e38d12f1ae5a124c8f93860
> prerequisite-patch-id: eb290f098e38981181d85240150e1713979dc505
> prerequisite-patch-id: c25b38ab68e815a63f064aff7496408684f94a36
> prerequisite-patch-id: b86eb7e00b5883a586bd4dc7143ab25094912288
> prerequisite-patch-id: 85d3c176dc4a7105e4f04dbcdb4ccbdf18741795
> prerequisite-patch-id: 94206b53a67820bb1c9e828c11e57a0cb36949b6
> prerequisite-patch-id: c5a64d246ff26047723e5e1a9c16b42a1d5fbf87
> prerequisite-patch-id: 89cf4c6b9242525883ac02bb8ef90856ef908d0f
> prerequisite-patch-id: 0992642ac657a1da617588a6d7b28f3669960374
> prerequisite-patch-id: e8a65c309b3eaf3341ceac421ef602bcc3f057fa
> prerequisite-patch-id: 4d38462a4bf2b242f8fcec3bf28f1ad97fa40ca7
> prerequisite-patch-id: 6430030eaa9b5f09eedf6d41b698549096905c56



More information about the DTrace-devel mailing list