From patchwork Tue Aug 20 14:49:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 820606 Delivered-To: patch@linaro.org Received: by 2002:adf:e98a:0:b0:367:895a:4699 with SMTP id h10csp264137wrm; Tue, 20 Aug 2024 07:49:42 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWfh5gPyNAxPZsyGF2+YcHoqu2VlX4yzW9uSthnBeKs1jlNnbemho6P/blkjii7aFavxhpcoVbdVlp9tYg51dqh X-Google-Smtp-Source: AGHT+IFRrHZaHLCyRl+T0waDt1Q2irRAIuuxq2s1w7GUkr+Qypv8fpdiTv9BO5qbcFQLgsFxVys4 X-Received: by 2002:a05:6808:1a23:b0:3da:4c28:6697 with SMTP id 5614622812f47-3dd3adea07amr17646294b6e.38.1724165381850; Tue, 20 Aug 2024 07:49:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724165381; cv=none; d=google.com; s=arc-20160816; b=LCsEmkncBMjzKrWqQoEn8p5xYdYjD0JNJrN6G/r7qb8nhd1JV+L18Dmo/n3oil9/1v VZREtKKjbkZAIKEMN3+IWCSvZjbKuK+kArukYtpa6kkgG8QQij9H6cmfNs6LxLBIkgfq sAr+xYBqrx1RhkmrtFrN0+h4lzESsbbKgS93y7onG06Cf228rR4zQO0jGzRMYjIXbcAJ MtFkqsW7eM/Rs20b0d+FSNwBT6yH0nossKqU7zUmWp/fI+i9KuGYxnrix+TSLJS1ljXr 0yyOz1v/XZdKKZwn0VwX0bEC2UlbFn9mWF6SIgQuArBOVFqg+VTMfz4rq87advzcVGhy GUXA== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=hCKwMpRhpzsd7Pv66w1vIFm4SCoH1ZrYAy4xntbqp0g=; fh=E2161ijGZj5YWQ6mDoqZRzgVJNPP9w9b1pumotWVFdc=; b=Dfu/I0Jv/KOzt7ZMMb64nozqOtc5gkfH+7k90oiGsGQKm0tGDB7ebDIeqXwGZ3cUSc pXec0Vln82QLHbTGA2KcRmcGvtM32mCT5/0vGQmi020jg4egHA3ewb0jlncZPgqVfDHA 1ldzx7LxuiEtXrbKyn6hWd5WwFlBxgA3oDOrTP/f1+ovVs7nGyjcy3GdZBMU8featRjX v5gGPghdlBOVwkRlUg7S+pp/5A+AEgnNFSVy/GU2vz2ZSLWNCdHFFYHWDQCRTNk0SO+1 23c/pzf/l3/vr+GokVQi3V6f+ut1G+5fpDzM8//s+RJEfL5/nnuTWEkXdsB2J6OLya4C 6oKA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=s2QFm10u; 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-4536a0f728bsi130683051cf.769.2024.08.20.07.49.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Aug 2024 07:49:41 -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=s2QFm10u; 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 1sgQAh-0004ra-Bs; Tue, 20 Aug 2024 10:49:19 -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 1sgQAf-0004qb-Td for qemu-devel@nongnu.org; Tue, 20 Aug 2024 10:49:17 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sgQAd-0006Kq-VK for qemu-devel@nongnu.org; Tue, 20 Aug 2024 10:49:17 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-42817f1eb1fso45355805e9.1 for ; Tue, 20 Aug 2024 07:49:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724165354; x=1724770154; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=hCKwMpRhpzsd7Pv66w1vIFm4SCoH1ZrYAy4xntbqp0g=; b=s2QFm10ukcCxpSomfZ1v8UA9uDsROrlegxNfyL/vQxrraFQyMWWAPZkQXEqWpzdKRe 6ysG1DKsXcfIDMFlvJALeXqX0xs+XXkQTB9KCXTl+Y1J+pO7WH+qZlEiqnPd7tzwp8e7 aw18FZ2ya9t6BHFIn3SYwHVzlhsZGo6bmmEqlNOyCDwYsSdSxgtCeRQBnnDcdP1zTCki x0dZ1lnPdOz89eOn3zv8N4U8VdZpI3eMCRsz0MrJo0JoJHzyF1b4+GkA2+tLKKP1f+7z mFam0YK3R6tEq5F6yAN+Bq9UuNpOZzBcKVthRYTZQbL92RvzbmswE9wAGZEHbwgbXY5/ XAxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724165354; x=1724770154; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hCKwMpRhpzsd7Pv66w1vIFm4SCoH1ZrYAy4xntbqp0g=; b=cM1+Dne8UVhBFvC7JO8XSc5Dr9BqyUOuRIAnE6ufEq1oau/wRihOPOyp/PGB4ufBtg yA0rON3nItVQTstqk0dzS/IZwk58jKEr50shUrqXt0ay3WaTV/fGkT2S1oclE6zWhmK4 bO8ingxE22h7VEyt9LN7MClS6WwelgXta7w9wBc+UEVvqiEaOUyTfHfepIW8WWzZtYaD +wclYuIV4n5kWJNpoBH9LbsWP0OnyMG3KihSqCQPzNlF4MLoFmLgATAFxzGLPhYo4C6o MLgL3HUM24jqEBNEDwsBge0LFR1GucV11RZ/VmaDiFOpAFIUf/Ln4nXAF2VeP1JhpXmJ Mi7Q== X-Gm-Message-State: AOJu0YwLwIGi2uuIORYGhuUL+hDChTx5gsy3fLH69xb7ZMU7xGMLuknH biawMP/NEcApV7peLh8TeQESyGQ40ATfiSdxTZpkK8+cX2GBRdjbA5FtDcSObuC3oecAOYYz/14 m X-Received: by 2002:a5d:4dce:0:b0:36b:555a:e966 with SMTP id ffacd0b85a97d-3719465fc3amr10863427f8f.35.1724165354007; Tue, 20 Aug 2024 07:49:14 -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.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2024 07:49:13 -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 0/9] tests/qtest/migration-test: Fix various leaks Date: Tue, 20 Aug 2024 15:49:03 +0100 Message-Id: <20240820144912.320744-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x333.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 This patchset fixes various leaks that show up if you run migration-test under the clang leak-sanitizer. Since they're all test code problems, this is 9.2 material. The one leak that was really in the QEMU code I have sent a separate patch for: https://patchew.org/QEMU/20240820144429.320176-1-peter.maydell@linaro.org/ You can repro these leaks by building a QEMU configured with '--cc=clang' '--cxx=clang++' '--enable-debug' '--target-list=x86_64-softmmu' '--enable-sanitizers' and then running the test like: (cd build/asan && \ ASAN_OPTIONS="fast_unwind_on_malloc=0" \ QTEST_QEMU_BINARY=./qemu-system-x86_64 ./tests/qtest/migration-test --tap -k ) thanks -- PMM Peter Maydell (9): tests/qtest/migration-test: Fix bootfile cleanup handling tests/qtest/migration-test: Don't leak resp in multifd_mapped_ram_fdset_end() tests/qtest/migration-test: Fix leaks in calc_dirtyrate_ready() tests/qtest/migration-helpers: Fix migrate_get_socket_address() leak tests/qtest/migration-test: Free QCRyptoTLSTestCertReq objects tests/unit/crypto-tls-x509-helpers: deinit privkey in test_tls_cleanup tests/qtest/migration-helpers: Don't dup argument to qdict_put_str() tests/qtest/migration-test: Don't strdup in get_dirty_rate() tests/qtest/migration-test: Don't leak QTestState in test_multifd_tcp_cancel() tests/unit/crypto-tls-x509-helpers.h | 6 +++++ tests/qtest/migration-helpers.c | 20 +++++++--------- tests/qtest/migration-test.c | 36 ++++++++++++++++++---------- tests/unit/crypto-tls-x509-helpers.c | 13 ++++++++-- 4 files changed, 50 insertions(+), 25 deletions(-)