From patchwork Tue Aug 20 14:49:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 820609 Delivered-To: patch@linaro.org Received: by 2002:adf:e98a:0:b0:367:895a:4699 with SMTP id h10csp264419wrm; Tue, 20 Aug 2024 07:50:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX4E26kro4w2qcqOj5N4R4Y1lpwMYPzJaEYQj1XYWW/5rSY+l2oczFO6cSIZ6ERqdV+ZFwoLyOPqcswH4HV0obM X-Google-Smtp-Source: AGHT+IFd7MOOisrcc0nMRYyrkftfuCKVJrglVb18lQ3pHpnBjtlZBrrw0gmH+F1TYssWxr3k7dk/ X-Received: by 2002:a05:622a:5e16:b0:453:4b61:7e3e with SMTP id d75a77b69052e-453741b54e9mr167996291cf.1.1724165419215; Tue, 20 Aug 2024 07:50:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724165419; cv=none; d=google.com; s=arc-20160816; b=nhppmKkfXRAXwx34xBFyMxcQ7W1oN+RBRI0UIFEh1bhFNXSqnCSLMee7rNgxaWSaEn sFADDk0w01rtm8GRB3o8kz78eJANbu/KgrD13BHvUSJdzF+3LvbqpVzAmQgUOKkhILa0 3lUT9vQJ3QM3tZjEKbU0RRwx4PGjjkW/EiEoZFYESsjB/8PVTu8GnCgoMRonwtrjzw4i ZaKTCRbJorW4To3BdplkdR4r5QeQsj88qwuWQMB3T4c0+aJPuBBQh9NOOZLUbUwmNHT0 fdVmHRjF+JjLOSUi5eaFrXNKw+Yew9z4bqB+6V8TpNlCmwtOasL1M4cfruv3Qw7dGaX0 4Z7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cX04CHrSO6RPXxQ10TYYxqNDsV8QV6DrYzWSCmg9HZE=; fh=E2161ijGZj5YWQ6mDoqZRzgVJNPP9w9b1pumotWVFdc=; b=vG691FD1FCLxGMEu7fJbnC1APBDzZUck0XZUHcUES2Z+KksQNCbAxE/MvRSypU7Ix4 L/IgN0bhfh8NSroTJyiMLEeRtf5JyDAQ05RiOGDgjXpU7s5JWOkmxd0xSO5zhUaRfUX9 IP2CazV5TULe03kERRVh3RbxF3J+pgnxnG9EnAQYhhX996eX2f7K1eJo8KcOxtZM/t11 UkfWJDIpbZlaFME3bL+G1wm9YwX3t9oZ780IWRsgT8lqSFmfvCBOhgO3fnBqabRKmDRa S/Bs8CLjmu95kEOolFZvgpQJb0me61H8fA2cKdChGptrWcaj04X59idYGOxhQz4S8Z8L BXog==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FzJ7wVj2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4536a08f77bsi142983531cf.440.2024.08.20.07.50.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Aug 2024 07:50:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FzJ7wVj2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgQAn-0005F8-Ha; Tue, 20 Aug 2024 10:49:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgQAl-00056l-D7 for qemu-devel@nongnu.org; Tue, 20 Aug 2024 10:49:23 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sgQAj-0006M1-8P for qemu-devel@nongnu.org; Tue, 20 Aug 2024 10:49:23 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-42812945633so49501165e9.0 for ; Tue, 20 Aug 2024 07:49:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724165360; x=1724770160; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cX04CHrSO6RPXxQ10TYYxqNDsV8QV6DrYzWSCmg9HZE=; b=FzJ7wVj2E7IMABY3xTBwuf/0mhtu/9WQR3kAvHQAqoAuc5C5/33yWnDZH7/4e96JhP 8R0FiCu3qfb23441dFbV72hQVjYuc8VZjY59eQkfKPEzmdS+q531tDUxmG2jUrMYxw34 /262iBVpE7CNgQvNfNpik8elsMKidFC/k/akMYYjCb+7xHYlxpxaQQH2/lq43UfLS1wh rIuDDx40INCdfVNb9d3SMcoFuZj9lQhIE/vpz6xV/50oJWM84/+H7RTuE3/qrsF4u2/W 8Ykw7AJayhYx3tjNY26kDLmZEqMmNYgxVlj2PL8BL61squOpjD6j50YG9Mg32DYrEtLI 5tuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724165360; x=1724770160; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cX04CHrSO6RPXxQ10TYYxqNDsV8QV6DrYzWSCmg9HZE=; b=U+UJHY4iQGO3aP/6kWYpyE8Ol783xJ4h3FqvYyXieRiEl8t+edYHkxYenAQiAq7FPA EgBuvMIs1+ldDZk3pm08FvdqmFSxa7GdfoOs2J2uWXKBvA32Yi6zuj+RxQ3I7diDa0SZ +j641uxZxuOez95ewrkg4LeIPp2mhTKZHxgxMSObhoshwARPSZl4zRpRZBNCiiNXvnY0 Gfa37ANKJd87thVCinmZQknzVz5uUh4A/dRP2g3HpXtDn0haJwWexS/4/VrgdK0mOiVC 380JAoJCNOsdZuBYuGke6a3eiicpvG/zG+6mBm2kePh4R1qut0QYInb7hhZRVBrU86Sh Rc6g== X-Gm-Message-State: AOJu0YyKII19Gz/36l4iqRtoiCFQb3svpKohYyuy6UIOTkiFIwBUw65a esxWC5jdy5BmYXZAnAZxXHw4iIIJwFKdOwCfeptTjvbGySknUdczDfblC68jF3IbTbDJDM99LGi 8 X-Received: by 2002:adf:ab18:0:b0:371:8ec6:f2f0 with SMTP id ffacd0b85a97d-3719432dcc3mr8507017f8f.16.1724165359671; Tue, 20 Aug 2024 07:49:19 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3718983a306sm13334672f8f.15.2024.08.20.07.49.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2024 07:49:18 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Peter Xu , Fabiano Rosas , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= Subject: [PATCH for-9.2 9/9] tests/qtest/migration-test: Don't leak QTestState in test_multifd_tcp_cancel() Date: Tue, 20 Aug 2024 15:49:12 +0100 Message-Id: <20240820144912.320744-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240820144912.320744-1-peter.maydell@linaro.org> References: <20240820144912.320744-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org In test_multifd_tcp_cancel() we create three QEMU processes: 'from', 'to' and 'to2'. We clean up (via qtest_quit()) 'from' and 'to2' when we call test_migrate_end(), but never clean up 'to', which results in this leak: Direct leak of 336 byte(s) in 1 object(s) allocated from: #0 0x55e984fcd328 in __interceptor_calloc (/mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/asan/tests/qtest/migration-test+0x22f328) (BuildId: 710d409b68bb04427009e9ca6e1b63ff8af785d3) #1 0x7f0878b39c50 in g_malloc0 debian/build/deb/../../../glib/gmem.c:161:13 #2 0x55e98503a172 in qtest_spawn_qemu tests/qtest/libqtest.c:397:21 #3 0x55e98502bc4a in qtest_init_internal tests/qtest/libqtest.c:471:9 #4 0x55e98502c5b7 in qtest_init_with_env tests/qtest/libqtest.c:533:21 #5 0x55e9850eef0f in test_migrate_start tests/qtest/migration-test.c:857:11 #6 0x55e9850eb01d in test_multifd_tcp_cancel tests/qtest/migration-test.c:3297:9 #7 0x55e985103407 in migration_test_wrapper tests/qtest/migration-helpers.c:456:5 Call qtest_quit() on 'to' to clean it up once it has exited. Signed-off-by: Peter Maydell Reviewed-by: Fabiano Rosas --- tests/qtest/migration-test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 04122120987..169ef0209c7 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -3322,6 +3322,7 @@ static void test_multifd_tcp_cancel(void) /* Make sure QEMU process "to" exited */ qtest_set_expected_status(to, EXIT_FAILURE); qtest_wait_qemu(to); + qtest_quit(to); args = (MigrateStart){ .only_target = true,