From nobody Thu May 2 19:13:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1628169101; cv=none; d=zohomail.com; s=zohoarc; b=jtVOE1ZHXJGPZF4P/L+DAeixDZVqC7Q8/86i3BZJpGe+FNPw6YLdSYEOvYC/b/OkTaDLkKbLGRxmvRWM6FH50XTZj5NFO83KX61ZuBt1OJ1dDvVfxS/b05Wx6O77oKs5rKeJpJJUpN/ALdQjjqybV8EAxSq5nm4qvkzVi3RXpNU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628169101; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=f0T0hhba+DNGHpMLsj+gJpZrHRWn1GCHPoGbw9jb/fQ=; b=P5lZFOngb3I1xBC0mpXiosAte7V5b3vNEdEMPDnZCk2uLQv2c2bHdiPWPFJ+FpHBDdenvM4+EVCfQXbpWuMQymeNeDTvVMrESILL4I7JD2buzk2NzZx6Vm5pbvrd5qKpmj5Ge10IhWAW/mabTrCjYgQnf4z51xJw46peRZu4Ims= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 16281691010591014.4232197474716; Thu, 5 Aug 2021 06:11:41 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-12-KXMM_PisOgG0pwm-RfpoZA-1; Thu, 05 Aug 2021 09:11:37 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6EFB38799ED; Thu, 5 Aug 2021 13:11:30 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4EA7860E3A; Thu, 5 Aug 2021 13:11:30 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1A2454A7CD; Thu, 5 Aug 2021 13:11:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 175D8vAF007193 for ; Thu, 5 Aug 2021 09:08:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2662710372C2; Thu, 5 Aug 2021 13:08:57 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.194.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7042F1002D71; Thu, 5 Aug 2021 13:08:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628169100; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=f0T0hhba+DNGHpMLsj+gJpZrHRWn1GCHPoGbw9jb/fQ=; b=eb97qMO7WT/hKxXozBXsHsk5dm0N9N9bY1xiz5ZFtUDdQf39OSHSyIdXfueP1rHM2YVSs3 1iIl4GOuqTLtGg6nmI1UwccNuX5oVgutak6ayxZW/edKtpGwUvphd/0hTAns1bHxLfqMox rLDvJwk7BxfO27p5CzO5TAu5Nol6bIY= X-MC-Unique: KXMM_PisOgG0pwm-RfpoZA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 1/7] tests: qemuMonitorTestFree: Unlock virDomainObj before freeing Date: Thu, 5 Aug 2021 15:08:45 +0200 Message-Id: <20210805130851.55552-2-twiederh@redhat.com> In-Reply-To: <20210805130851.55552-1-twiederh@redhat.com> References: <20210805130851.55552-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1628169103006100003 Content-Type: text/plain; charset="utf-8" virDomainObj contains a mutex. Destroying a locked mutex results in undefined behavior. Signed-off-by: Tim Wiederhake --- tests/qemumonitortestutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c index 143dd954e6..f316fe823f 100644 --- a/tests/qemumonitortestutils.c +++ b/tests/qemumonitortestutils.c @@ -411,7 +411,7 @@ qemuMonitorTestFree(qemuMonitorTest *test) =20 g_object_unref(test->eventThread); =20 - virObjectUnref(test->vm); + virDomainObjEndAPI(&test->vm); =20 if (test->started) virThreadJoin(&test->thread); --=20 2.31.1 From nobody Thu May 2 19:13:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1628169102; cv=none; d=zohomail.com; s=zohoarc; b=RRadfiFmAAMNp1Mr7Jg4VIDkUdf20n6o2SE89HZXb4pCi266JUZCgoNlzwiHsOEm81fXLUrLq8HUG3Wz9XjYijx3smitq6nXdp3Pzu/dQmSO0GnOjB2XFec5Cf4fZhw9wjFXS0KbfN7L9aIveRnbwVf3dQrAfKySCq7i0ZblD4E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628169102; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5bcgmdjaHqhLXg5F34wtqYN8igd9ggY5LwbwndwESN8=; b=V1RoQ+EuyTLGlG+LpgjzWMAQIvjO0L+4MCoZwyfa6dTznaU4/h6+Wi6znr5xa6A7XMuiCyLIn3inA2FnEyGl5zdwTwUscJcDLdNVHZrXk0aoKOsxMmKIU85PaxVtR0De81CZK6X5tae3bLDS3fAqI7lNIH25BDhaPHi9vmYo71Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 162816910269196.6806292444204; Thu, 5 Aug 2021 06:11:42 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-561-qbV-RJUhMqe3auszCU-YrQ-1; Thu, 05 Aug 2021 09:11:40 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 095B78799F3; Thu, 5 Aug 2021 13:11:33 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DC3B260CC9; Thu, 5 Aug 2021 13:11:32 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A97FE4A705; Thu, 5 Aug 2021 13:11:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 175D8wxS007202 for ; Thu, 5 Aug 2021 09:08:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id 307A71000186; Thu, 5 Aug 2021 13:08:58 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.194.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7920510372C4; Thu, 5 Aug 2021 13:08:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628169101; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=5bcgmdjaHqhLXg5F34wtqYN8igd9ggY5LwbwndwESN8=; b=GKeBcHBuZgGGId4/htf4M3vpsACRKHByMAk7Aio4qB+kktcnoHHdC8/XWPjCwxugSEr02+ qUtnNfLoevnH2IWAOC6ZLKxiHI9H0yBwWLJa/P+9Ic7O+T3IOukHkUcMKGRNMrXsAFAYDW ySacw3EKqf89hTq+VQyc/wiWn/7f/2k= X-MC-Unique: qbV-RJUhMqe3auszCU-YrQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 2/7] qemusecuritytest: Unlock virDomainObj before disposal Date: Thu, 5 Aug 2021 15:08:46 +0200 Message-Id: <20210805130851.55552-3-twiederh@redhat.com> In-Reply-To: <20210805130851.55552-1-twiederh@redhat.com> References: <20210805130851.55552-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1628169103259100005 Content-Type: text/plain; charset="utf-8" virDomainObj contains a mutex. Destroying a locked mutex results in undefined behavior. Signed-off-by: Tim Wiederhake --- tests/qemusecuritytest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qemusecuritytest.c b/tests/qemusecuritytest.c index a7e87fdf8f..b14da08f1b 100644 --- a/tests/qemusecuritytest.c +++ b/tests/qemusecuritytest.c @@ -114,7 +114,7 @@ testDomain(const void *opaque) /* Mocking is enabled only when this env variable is set. * See mock code for explanation. */ if (g_setenv(ENVVAR, "1", FALSE) =3D=3D FALSE) - return -1; + goto cleanup; =20 if (qemuSecuritySetAllLabel(data->driver, vm, NULL, false) < 0) goto cleanup; @@ -126,6 +126,7 @@ testDomain(const void *opaque) =20 ret =3D 0; cleanup: + virObjectUnlock(vm); g_unsetenv(ENVVAR); freePaths(); return ret; --=20 2.31.1 From nobody Thu May 2 19:13:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1628169057; cv=none; d=zohomail.com; s=zohoarc; b=dHwkocCy+VvELa/xx0P3WCxQecI1QCq2JCRh7kYtRZFdtU+6wQKkf6fMb2mYioNvuZt2rJss7XgHXGcOc7+sPndIj4JTcWajc869dUI8Dofd/DpftUZwKl60pRMGeHruPy+NPQLcXkHG0FZTALSflT8cw+F2bkKRHksNNO+1SUU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628169057; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=KIbMV1y4ALXQMZZcD457fPzrfrb7V6zByGAvOGNUAZ8=; b=T72H8XpKPVKRtuEaEvCfRM1MjfxMOVQzH44qb8CZxLkpDOII6G/rVHmNWxAy3fgb0ATTX/VmLP8+x0hDqD4C56zarwfmCUeXlP2xJtt305t89Tid8cGI88BBZOO+jZ8+1WrL1Nls30Pbtr4KZmQzHGDJ0yy2FHor1uYVrCd/QbM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1628169057035209.77588125742818; Thu, 5 Aug 2021 06:10:57 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-422-pbSUHFYuPRqtZ22mFSZIyA-1; Thu, 05 Aug 2021 09:10:54 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C28A11006C80; Thu, 5 Aug 2021 13:10:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3F43377708; Thu, 5 Aug 2021 13:10:48 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B7A4E4BB7C; Thu, 5 Aug 2021 13:10:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 175D8xD7007208 for ; Thu, 5 Aug 2021 09:08:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3D0B81000186; Thu, 5 Aug 2021 13:08:59 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.194.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id 872CD10023B0; Thu, 5 Aug 2021 13:08:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628169056; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=KIbMV1y4ALXQMZZcD457fPzrfrb7V6zByGAvOGNUAZ8=; b=NxCZm3DXzIZ65j/G6VTDSJMN4an/MXF71tRs+t72nVgFygO8DbAfQe5wSF3g42A7byBHdB gEtNRn2+4bJ+noSVXAmZQMsFTCSmfgtPvjIzHBX36aNpHaeN0mdUgzjmkuL+6WAkKkuzBO FIdR0A8b8dO92THZx50KHH34MNfY9MA= X-MC-Unique: pbSUHFYuPRqtZ22mFSZIyA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 3/7] qemuxml2argvtest: Unlock virDomainObj before disposal Date: Thu, 5 Aug 2021 15:08:47 +0200 Message-Id: <20210805130851.55552-4-twiederh@redhat.com> In-Reply-To: <20210805130851.55552-1-twiederh@redhat.com> References: <20210805130851.55552-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1628169058957100001 Content-Type: text/plain; charset="utf-8" virDomainObj contains a mutex. Destroying a locked mutex results in undefined behavior. Signed-off-by: Tim Wiederhake --- tests/qemuxml2argvtest.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index b552f5deed..4276f062a2 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -562,8 +562,9 @@ testCompareXMLToArgvValidateSchema(virQEMUDriver *drv, if (virBitmapParse("0-3", &priv->autoNodeset, 4) < 0) return -1; =20 - if (!(cmd =3D testCompareXMLToArgvCreateArgs(drv, vm, migrateURI, info= , flags, - true))) + cmd =3D testCompareXMLToArgvCreateArgs(drv, vm, migrateURI, info, flag= s, true); + virDomainObjEndAPI(&vm); + if (!cmd) return -1; =20 if (virCommandGetArgList(cmd, &args, &nargs) < 0) @@ -767,8 +768,9 @@ testCompareXMLToArgv(const void *data) VIR_FREE(log); virResetLastError(); =20 - if (!(cmd =3D testCompareXMLToArgvCreateArgs(&driver, vm, migrateURI, = info, - flags, false))) { + cmd =3D testCompareXMLToArgvCreateArgs(&driver, vm, migrateURI, info, = flags, false); + virDomainObjEndAPI(&vm); + if (!cmd) { err =3D virGetLastError(); if (!err) { VIR_TEST_DEBUG("no error was reported for expected failure"); @@ -816,7 +818,7 @@ testCompareXMLToArgv(const void *data) cleanup: VIR_FREE(log); virDomainChrSourceDefClear(&monitor_chr); - virObjectUnref(vm); + virDomainObjEndAPI(&vm); virIdentitySetCurrent(NULL); virSetConnectSecret(NULL); virSetConnectStorage(NULL); --=20 2.31.1 From nobody Thu May 2 19:13:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1628169129; cv=none; d=zohomail.com; s=zohoarc; b=F8VCwKwstyF3F7sXL6yZqjaSkR4B0I6xEg8HW2SS+pFBBHpPAaX10yVb0TbsdS+NNTuHVNN66VueVaE8HN3AgVCed+pI6ebsYcr/WG84+uuwXnp6PEtV3aVUpHoOxEcD46tyw0KsSbjjs2+fanv6ucPyFOkHkkn5703gBDP6sDU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628169129; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=lqobmzedYf5M4/HcKA6ILyjVavqeEaYbcWAhv89bhLw=; b=X9fNu89dTKtb8ghTGluG2by9O6Ny6sILnuJudhI9STZnczFVGb7i9nP5PoVmOrXnQJc51zVFQP6oAkS5wl5EYrjUEPREZqH4mSvEQYyc5wJJu9meWaSMvzxJpiDJIamDsnyae3+HcY6k3f6vMbqsDl1bjND9CK/iJKEKrOEYx/g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1628169129484718.0796022751418; Thu, 5 Aug 2021 06:12:09 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-343-evAa70aFPjiOssNQhpbXnA-1; Thu, 05 Aug 2021 09:12:06 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7095018C89E2; Thu, 5 Aug 2021 13:12:01 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5165C60CD1; Thu, 5 Aug 2021 13:12:01 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 207574A70B; Thu, 5 Aug 2021 13:12:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 175D90Zs007213 for ; Thu, 5 Aug 2021 09:09:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4CF0810023B0; Thu, 5 Aug 2021 13:09:00 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.194.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9220D1000186; Thu, 5 Aug 2021 13:08:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628169128; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=lqobmzedYf5M4/HcKA6ILyjVavqeEaYbcWAhv89bhLw=; b=F84GXZdkxpDmlvk1qMwN9zcOQYxivUaFWJXzmk57JAlP3vvDTh5qFMy+Y8ShYLm3fRnj/x Nr2ax0OkEpcXt1QN9GtOUejJNxQAVb6M/QCwnWg91c4Pr3XqE5tFohDqLCGgZMUi2qTgFV 4OQpev7QiMzfEduF76rRim02zDm8nsA= X-MC-Unique: evAa70aFPjiOssNQhpbXnA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 4/7] qemuhotplugtest: Lock reused virDomainObj Date: Thu, 5 Aug 2021 15:08:48 +0200 Message-Id: <20210805130851.55552-5-twiederh@redhat.com> In-Reply-To: <20210805130851.55552-1-twiederh@redhat.com> References: <20210805130851.55552-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1628169130007100001 Content-Type: text/plain; charset="utf-8" If the previous test had `keep =3D=3D 1` set, this function inherits its (unlocked) virDomainObj. Signed-off-by: Tim Wiederhake --- tests/qemuhotplugtest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 57d76845c6..d8d6a3a226 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -280,6 +280,7 @@ testQemuHotplug(const void *data) =20 if (test->vm) { vm =3D test->vm; + virObjectLock(vm); if (!vm->def) { VIR_TEST_VERBOSE("test skipped due to failure of dependent tes= t"); goto cleanup; --=20 2.31.1 From nobody Thu May 2 19:13:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1628169132; cv=none; d=zohomail.com; s=zohoarc; b=Vqglyvwg9JZRJG/O4ULDVAuOc6lxceJWwfTnkyKKYcZzvF30ebWVJPHIlnPphMk31bjt/cp1C3vViNZTCs9TbUXsKvk28jMDjajAvQlarJesj6s3Ay0yaRmKR0+uIZUET92We/KPxvhM25cu5MyqEdkz6swuB/+uUja4bpTmmlM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628169132; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yfGNZKhPJTIW4AudqxtiqJMviKPCCeRSWeTVOVVEXz0=; b=OdHuGCdNtroKqF1BMd3ZLd8EfBqqBap70DJ/XsmazvJVURq/TkKbdZdgRms6EVMoKgg/SvCpdgN8qIeQasVpYH4XStkQ9rYjAuEwgc4ysBUJduQtl+/ZyohOUlZtv4fRdM+skTSlpeBFHXZSD27WPGCeTIw4OTZ1NxKqD9/5VEQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1628169132818528.2600185875648; Thu, 5 Aug 2021 06:12:12 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-586-xEZWXZwmObWSL6nay8NiVQ-1; Thu, 05 Aug 2021 09:12:10 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 322588799E0; Thu, 5 Aug 2021 13:12:05 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0EE114EF70; Thu, 5 Aug 2021 13:12:05 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id AE02B181A3F0; Thu, 5 Aug 2021 13:12:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 175D91WQ007218 for ; Thu, 5 Aug 2021 09:09:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 587391000186; Thu, 5 Aug 2021 13:09:01 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.194.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id A034A1002D71; Thu, 5 Aug 2021 13:09:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628169131; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=yfGNZKhPJTIW4AudqxtiqJMviKPCCeRSWeTVOVVEXz0=; b=D6ZlM2NUfha/GM66D7s70WkXDiqAtJC6FSwjKokvKfMhk6rJ/cOifr2C7YgGzmQ461xP2P 0lV5pcCqXl+4SgHj86fwkGYZ9nQzKhKIYfIM4jf8kPcwiCLSYu6Od7wSr8nAERONeuLteh n8LsxNXfnz5ClTxgGPVvWIH0IPBYvwQ= X-MC-Unique: xEZWXZwmObWSL6nay8NiVQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 5/7] Meson: Define "DYNAMIC_ANALYSIS" if built with sanitizers enabled Date: Thu, 5 Aug 2021 15:08:49 +0200 Message-Id: <20210805130851.55552-6-twiederh@redhat.com> In-Reply-To: <20210805130851.55552-1-twiederh@redhat.com> References: <20210805130851.55552-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1628169134338100001 Content-Type: text/plain; charset="utf-8" This is complementary to the "STATIC_ANALYSIS" macro defined in "internal.h", but not as straight-forward to detect: clang defines "__has_feature(address_sanitizer)" if the address sanitizer is enabled. "__has_feature" is clang specific and does not exist in gcc (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D60512) gcc, depending on the version, defines "__SANITIZE_ADDRESS__ 1" if compiled with the address sanitizer enabled. No similar macro is defined for the undefined behavior sanitizer. Instead, let meson set this symbol. Signed-off-by: Tim Wiederhake --- meson.build | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/meson.build b/meson.build index e25dc17fc8..2c424076ba 100644 --- a/meson.build +++ b/meson.build @@ -224,6 +224,10 @@ alloc_max =3D run_command( 'print(min(2**(@0@ * 8 - 1) - 1, 2**(@1@ * 8) - 1))'.format(ptrdiff_max,= size_max), ) =20 +if (get_option('b_sanitize') !=3D 'none') + conf.set('DYNAMIC_ANALYSIS', 1) +endif + # sanitizer instrumentation may enlarge stack frames stack_frame_size =3D get_option('b_sanitize') =3D=3D 'none' ? 4096 : 8192 =20 --=20 2.31.1 From nobody Thu May 2 19:13:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1628169066; cv=none; d=zohomail.com; s=zohoarc; b=iL11elvK4IGYFPpOmSZiEgIfY2iHnKRtWkYU1IdZ5c0xUUcqfWfqsTOo0h6aV9MXUHHfwG0I/2WjHfdrOxgL38hHfscdxcLltuYYdVWOSdpH/kbKpmT/iuF6jaxdpnJv4IQI6s+C5A8y3baZj0/9tgzg75P4vTNpG8OnlyEDoFA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628169066; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=t9iOjLXZQ6v1dXpI4t47hNZxb0chAc1cenDJLQgjSPE=; b=K2Oma7QkqaiwArXYPZbjK229VPR0KSoCaXeD+ADDE+JiTW/N89KmWmVAQj0R84rBFqxKaacQ/aPgEp4PivnPRzsUWrcxk+oRrNZe9Pum36ZyC43ipS3cFJfCVEK+VfURyZ9LSh9Mg39un+8vgYCDdchgpPsUnZITwny1MhW2r24= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1628169066496508.2285700214526; Thu, 5 Aug 2021 06:11:06 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-373-sPuabFBTNQmnkmDREkcmeQ-1; Thu, 05 Aug 2021 09:11:03 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DC8CC1006C84; Thu, 5 Aug 2021 13:10:57 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 87FE75C25D; Thu, 5 Aug 2021 13:10:57 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 4F3164A7CA; Thu, 5 Aug 2021 13:10:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 175D92dh007223 for ; Thu, 5 Aug 2021 09:09:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id 65FF910016F2; Thu, 5 Aug 2021 13:09:02 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.194.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB9581002D71; Thu, 5 Aug 2021 13:09:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628169065; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=t9iOjLXZQ6v1dXpI4t47hNZxb0chAc1cenDJLQgjSPE=; b=HK784ol4hDoevVUdxtYR8blLJojPKOZKARD89b2+DktveyLAOO9w5GXNIB5642vY3Xz0RU f8lwcFMwy/kOI+yooigsPITImaR8sgIvLbsWY3mw7gYTLCNac0bRlD+KHhljJ/GoTyYIJT mX9EoP9sN0UDuz+i4cpmz6oDpb8iF2I= X-MC-Unique: sPuabFBTNQmnkmDREkcmeQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 6/7] virMutex*: Warn on error Date: Thu, 5 Aug 2021 15:08:50 +0200 Message-Id: <20210805130851.55552-7-twiederh@redhat.com> In-Reply-To: <20210805130851.55552-1-twiederh@redhat.com> References: <20210805130851.55552-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1628169067906100001 Content-Type: text/plain; charset="utf-8" `pthread_mutex_destroy`, `pthread_mutex_lock` and `pthread_mutex_unlock` return an error code that is currently ignored. Add debug information if one of these operations failed, e.g. when there is an attempt to destroy a still locked mutex or unlock and already unlocked mutex. Signed-off-by: Tim Wiederhake --- src/util/virthread.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/util/virthread.c b/src/util/virthread.c index e89c1a09fb..f64dbee9e9 100644 --- a/src/util/virthread.c +++ b/src/util/virthread.c @@ -35,7 +35,10 @@ =20 #include "viralloc.h" #include "virthreadjob.h" +#include "virlog.h" =20 +#define VIR_FROM_THIS VIR_FROM_THREAD +VIR_LOG_INIT("util.thread"); =20 int virOnce(virOnceControl *once, virOnceFunc init) { @@ -83,17 +86,23 @@ int virMutexInitRecursive(virMutex *m) =20 void virMutexDestroy(virMutex *m) { - pthread_mutex_destroy(&m->lock); + if (pthread_mutex_destroy(&m->lock)) { + VIR_WARN("Failed to destroy mutex=3D%p", m); + } } =20 void virMutexLock(virMutex *m) { - pthread_mutex_lock(&m->lock); + if (pthread_mutex_lock(&m->lock)) { + VIR_WARN("Failed to lock mutex=3D%p", m); + } } =20 void virMutexUnlock(virMutex *m) { - pthread_mutex_unlock(&m->lock); + if (pthread_mutex_unlock(&m->lock)) { + VIR_WARN("Failed to unlock mutex=3D%p", m); + } } =20 =20 --=20 2.31.1 From nobody Thu May 2 19:13:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1628169153; cv=none; d=zohomail.com; s=zohoarc; b=NesMtbfmun5qoX3XcAXLWu4RiBSGfzs5TXoQ7lV6VyWfbeVZ8zUJzifHP+/2ND7+vBmD441rkrKANjMCaUhucxncg45CW/kEOHNbFybNRM1YqmXdsiTWFCVLYcR2FJo9dM/h3hgjH69j5eJ4ILW09x0p+ilAfveCNxa4XlpjJqQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628169153; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6xH4Uk/yI2ByNE36+TDMsKjNUg64CY6LgmdiKOh6bhc=; b=kUK7fL7GQRZN3e0DLm4Z8Jj4LQtz1irYEK29j6XQ++dczHHKpgzgwszV6bQerL3Y/X4xPZitWe2mSm4E4CopLr5qvnyd+UdLcVyQTpdWJH9JQ0PMQAp83KiCsUFDWz9EEuLAKeqM/Zfmb/w8MEZVR2SVzj7L1tuXgXNYAvhjTCg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1628169153652467.97908735681756; Thu, 5 Aug 2021 06:12:33 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-241-IHdWuAI8MF-JmbAexdApIg-1; Thu, 05 Aug 2021 09:12:13 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DE26A1006C82; Thu, 5 Aug 2021 13:12:07 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B57D24A66; Thu, 5 Aug 2021 13:12:07 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7FE98181A3F4; Thu, 5 Aug 2021 13:12:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 175D931M007230 for ; Thu, 5 Aug 2021 09:09:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id 70F5B10023B0; Thu, 5 Aug 2021 13:09:03 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.194.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id B909010016F2; Thu, 5 Aug 2021 13:09:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628169152; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=6xH4Uk/yI2ByNE36+TDMsKjNUg64CY6LgmdiKOh6bhc=; b=KXpKZ2uF0gyPOjJOIxV8he2jDvIX3CzM+d1S5n+8YcHNxDKylZaWU08FXy/sbAJiccXuAz uk3oH7tk5jUy3Yz8do/YM9H5Unhopp3E7gznqVDsgunrGnSqID2z56T1voAihY3JMEMy6g a4LtnxSJx4FdIONyPk0A9nMMLF3V87s= X-MC-Unique: IHdWuAI8MF-JmbAexdApIg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 7/7] virMutex*: Fail loudly Date: Thu, 5 Aug 2021 15:08:51 +0200 Message-Id: <20210805130851.55552-8-twiederh@redhat.com> In-Reply-To: <20210805130851.55552-1-twiederh@redhat.com> References: <20210805130851.55552-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1628169155392100001 Content-Type: text/plain; charset="utf-8" Make failure to lock, unlock or destroy mutexes visible in the CI. As "abort()" is quite a harsh treatment and pthread generally speaking "does the right thing" regardless, limit this to analysis builds in the CI as to not bother users but still make developers aware of issues. Signed-off-by: Tim Wiederhake --- src/util/virthread.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/util/virthread.c b/src/util/virthread.c index f64dbee9e9..95213bd511 100644 --- a/src/util/virthread.c +++ b/src/util/virthread.c @@ -88,6 +88,9 @@ void virMutexDestroy(virMutex *m) { if (pthread_mutex_destroy(&m->lock)) { VIR_WARN("Failed to destroy mutex=3D%p", m); +#if DYNAMIC_ANALYSIS + abort(); +#endif } } =20 @@ -95,6 +98,9 @@ void virMutexLock(virMutex *m) { if (pthread_mutex_lock(&m->lock)) { VIR_WARN("Failed to lock mutex=3D%p", m); +#if DYNAMIC_ANALYSIS + abort(); +#endif } } =20 @@ -102,6 +108,9 @@ void virMutexUnlock(virMutex *m) { if (pthread_mutex_unlock(&m->lock)) { VIR_WARN("Failed to unlock mutex=3D%p", m); +#if DYNAMIC_ANALYSIS + abort(); +#endif } } =20 --=20 2.31.1