From: Louis Chauvet <louis.chauvet@bootlin.com>
To: Mark Yacoub <markyacoub@google.com>, igt-dev@lists.freedesktop.org
Subject: Re: [PATCH 2/3] tests/unigraf: Fix DRM master and heap memory leaks in tests
Date: Thu, 16 Jul 2026 16:54:50 +0200 [thread overview]
Message-ID: <883be072-85f1-4a07-9932-ca135c98e603@bootlin.com> (raw)
In-Reply-To: <20260715192949.1984280-2-markyacoub@google.com>
On 7/15/26 21:29, Mark Yacoub wrote:
> [Why]
> The unigraf_connectivity test allocates connector array buffers dynamically via
> kms_wait_for_new_connectors and get_array_diff without freeing them before test
> exit, leading to severe heap leaks when executed iteratively. Furthermore, neither
> unigraf_connectivity nor unigraf_lt closed drm_fd upon completion, holding the
> DRM Master lock open indefinitely. On platforms with a running display compositor
> (such as Android's SurfaceFlinger), this leaves the DRM device locked and causes
> subsequent graphics tests to fail with resource busy errors.
>
> [How]
> Explicitly call free() on already_connected, newly_connected, and diff buffers
> at the end of unigraf_connectivity. Add an igt_fixture cleanup block to call
> close(drm_fd) when tearing down both unigraf_connectivity and unigraf_lt.
>
> Fixes: c66d08db9177 ("tests/unigraf: Add basic unigraf tests")
> Signed-off-by: Mark Yacoub <markyacoub@google.com>
Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>
> ---
> tests/unigraf/unigraf_connectivity.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/tests/unigraf/unigraf_connectivity.c b/tests/unigraf/unigraf_connectivity.c
> index 927ef2d6f..8ae9a2593 100644
> --- a/tests/unigraf/unigraf_connectivity.c
> +++ b/tests/unigraf/unigraf_connectivity.c
> @@ -134,5 +134,13 @@ int igt_main()
> "Invalid connected connector count, expected %d found %d\n",
> max(i, 1), diff_len);
> }
> +
> + free(already_connected);
> + free(newly_connected);
> + free(diff);
> + }
> +
> + igt_fixture() {
> + close(drm_fd);
> }
> }
next prev parent reply other threads:[~2026-07-16 14:55 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-15 19:29 [PATCH 1/3] android: Implement lightweight GKeyFile INI string parser in glib shim Mark Yacoub
2026-07-15 19:29 ` [PATCH 2/3] tests/unigraf: Fix DRM master and heap memory leaks in tests Mark Yacoub
2026-07-16 14:54 ` Louis Chauvet [this message]
2026-07-15 19:29 ` [PATCH 3/3] tests/unigraf: Enhance link rate support checking and hardware retrain timing Mark Yacoub
2026-07-17 8:13 ` Louis Chauvet
2026-07-20 20:53 ` [PATCH v2] " Mark Yacoub
2026-07-15 20:27 ` ✓ Xe.CI.BAT: success for series starting with [1/3] android: Implement lightweight GKeyFile INI string parser in glib shim Patchwork
2026-07-15 20:54 ` ✓ i915.CI.BAT: " Patchwork
2026-07-15 23:40 ` ✓ Xe.CI.FULL: " Patchwork
2026-07-16 3:27 ` ✓ i915.CI.Full: " Patchwork
2026-07-17 8:20 ` [PATCH 1/3] " Louis Chauvet
2026-07-17 10:18 ` Kamil Konieczny
2026-07-17 19:23 ` Louis Chauvet
2026-07-20 12:25 ` Kamil Konieczny
2026-07-17 10:27 ` Kamil Konieczny
2026-07-20 18:50 ` [PATCH v2] lib/igt_rc: Introduce generic config parser Mark Yacoub
2026-07-21 3:25 ` ✓ Xe.CI.BAT: success for series starting with [v2] lib/igt_rc: Introduce generic config parser (rev3) Patchwork
2026-07-21 3:53 ` ✓ i915.CI.BAT: " Patchwork
2026-07-21 11:48 ` ✓ Xe.CI.FULL: " Patchwork
2026-07-21 17:40 ` ✓ i915.CI.Full: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=883be072-85f1-4a07-9932-ca135c98e603@bootlin.com \
--to=louis.chauvet@bootlin.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=markyacoub@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox