All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t v2] tests/kms_atomic_transition: Fix dynamic subtest
@ 2025-10-30 19:15 Ngai-Mint Kwan
  2025-10-30 19:33 ` Gustavo Sousa
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Ngai-Mint Kwan @ 2025-10-30 19:15 UTC (permalink / raw)
  To: gustavo.sousa, igt-dev; +Cc: Ngai-Mint Kwan

Fix Segmentation Fault when calling igt_pipe_crc_free() due to double-freeing a
dangling pointer.

This occurs when a system connected to multiple displays executes a test with
"1x-outputs" dynamic subtest.

Example:
kms_atomic_transition --run-subtest modeset-transition --dynamic-subtest 1x-outputs

v2:
 - Move test cleanup inside run_modeset_tests().

Signed-off-by: Ngai-Mint Kwan <ngai-mint.kwan@linux.intel.com>
---
 tests/kms_atomic_transition.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/tests/kms_atomic_transition.c b/tests/kms_atomic_transition.c
index e1387bd89..419afe4dd 100644
--- a/tests/kms_atomic_transition.c
+++ b/tests/kms_atomic_transition.c
@@ -899,6 +899,7 @@ static void run_modeset_tests(data_t *data, int howmany, bool nonblocking, bool
 	unsigned iter_max;
 	igt_output_t *output;
 	uint16_t width = 0, height = 0;
+	enum pipe pipe_enum;
 
 retry:
 	unset_output_pipe(&data->display);
@@ -1033,6 +1034,18 @@ retry:
 			}
 		}
 	}
+
+	/* Cleanup */
+	unset_output_pipe(&data->display);
+	igt_display_commit2(&data->display, COMMIT_ATOMIC);
+
+	if (is_intel_device(data->drm_fd)) {
+		for_each_pipe(&data->display, pipe_enum)
+			igt_pipe_crc_free(data->pipe_crcs[pipe_enum]);
+	}
+
+	igt_remove_fb(data->drm_fd, &data->fbs[0]);
+	igt_remove_fb(data->drm_fd, &data->fbs[1]);
 }
 
 static void run_modeset_transition(data_t *data, int requested_outputs, bool nonblocking, bool fencing)
@@ -1067,18 +1080,6 @@ static void run_modeset_transition(data_t *data, int requested_outputs, bool non
 
 	igt_dynamic_f("%ix-outputs", requested_outputs)
 		run_modeset_tests(data, requested_outputs, nonblocking, fencing);
-
-	/* Cleanup */
-	unset_output_pipe(&data->display);
-	igt_display_commit2(&data->display, COMMIT_ATOMIC);
-
-	if (is_intel_device(data->drm_fd)) {
-		for_each_pipe(&data->display, pipe)
-			igt_pipe_crc_free(data->pipe_crcs[pipe]);
-	}
-
-	igt_remove_fb(data->drm_fd, &data->fbs[0]);
-	igt_remove_fb(data->drm_fd, &data->fbs[1]);
 }
 
 static bool pipe_output_combo_valid(igt_display_t *display,
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-11-05 17:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-30 19:15 [PATCH i-g-t v2] tests/kms_atomic_transition: Fix dynamic subtest Ngai-Mint Kwan
2025-10-30 19:33 ` Gustavo Sousa
2025-10-30 20:00   ` Ngai-Mint Kwan
2025-10-30 20:02     ` Ngai-Mint Kwan
2025-10-31  2:52       ` Gustavo Sousa
2025-10-30 23:09 ` ✓ Xe.CI.BAT: success for tests/kms_atomic_transition: Fix dynamic subtest (rev2) Patchwork
2025-10-30 23:18 ` ✓ i915.CI.BAT: " Patchwork
2025-10-31  6:59 ` ✓ Xe.CI.Full: " Patchwork
2025-10-31 12:18 ` ✗ i915.CI.Full: failure " Patchwork
2025-11-05 17:39   ` Matt Roper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.