From nobody Fri May 3 14:07:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1568879772; cv=none; d=zoho.com; s=zohoarc; b=RO13uQROIlBQy0WU2OLfANkXLIFhMGklokGNQP5Ia52S0MvwQjeYoW05YAqprKxn0Meu8vwNtIDb6/GBlAlHFweOeJa8M4LnVBKqmOhDIcHE4+QLdeBZJZ270wnPPCTXwtOI2wKV/1C+RJdrIWYKgt/zlsA0E8H04eLO5SDI7cY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568879772; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=+oYrd0buMzTqiQHcv42H/dedrSKizKMI6GXXMyjHsYU=; b=FfgiVgalFIgNA8EuvgxKX3S/H4gq3O9ZBTfhTM5u3lwPNTpis5+bVVLRW9WTEl5kLZEd/99IFjlHJgIfctmbtswFhFYVopJ+yIEj0Sek9zgQC1FaOpd+50NnA3GklCe1jUN9gy+RI04jIbdERd6lkw0dCYDyEM/l+Z87mRReyvw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1568879772184182.3430992540999; Thu, 19 Sep 2019 00:56:12 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 15AAB10C0939; Thu, 19 Sep 2019 07:56:10 +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 DF242600CC; Thu, 19 Sep 2019 07:56:09 +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 A04D24EA65; Thu, 19 Sep 2019 07:56:09 +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 x8J7u8cl032509 for ; Thu, 19 Sep 2019 03:56:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id 213781001B28; Thu, 19 Sep 2019 07:56:08 +0000 (UTC) Received: from mx1.redhat.com (ext-mx16.extmail.prod.ext.phx2.redhat.com [10.5.110.45]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 19EC01001B23 for ; Thu, 19 Sep 2019 07:56:05 +0000 (UTC) Received: from huawei.com (szxga06-in.huawei.com [45.249.212.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0BA623082B6D for ; Thu, 19 Sep 2019 07:56:04 +0000 (UTC) Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 2CA9A12DAEB8E1D3B867 for ; Thu, 19 Sep 2019 15:55:52 +0800 (CST) Received: from localhost (10.175.124.177) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.439.0; Thu, 19 Sep 2019 15:55:43 +0800 From: Xu Yandong To: Date: Thu, 19 Sep 2019 04:01:07 -0400 Message-ID: <1568880067-87939-1-git-send-email-xuyandong2@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.177] X-CFilter-Loop: Reflected X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Thu, 19 Sep 2019 07:56:05 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Thu, 19 Sep 2019 07:56:05 +0000 (UTC) for IP:'45.249.212.32' DOMAIN:'szxga06-in.huawei.com' HELO:'huawei.com' FROM:'xuyandong2@huawei.com' RCPT:'' X-RedHat-Spam-Score: -2.302 (RCVD_IN_DNSWL_MED, SPF_HELO_PASS, SPF_PASS) 45.249.212.32 szxga06-in.huawei.com 45.249.212.32 szxga06-in.huawei.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.45 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Xu Yandong , zhang.zhanghailiang@huawei.com Subject: [libvirt] [PATCH] qemu: add pointer check in qemuMonitorLastError 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Thu, 19 Sep 2019 07:56:10 +0000 (UTC) Content-Type: text/plain; charset="utf-8" We found a exception when libvirt occurrs segmentation fault. thread 1 is waiting object lock in qemuConnectMonitor, qemu process exits and sends EOF event as well, so thread 2 invokes qemuMonitorLastError but pointer mon is NULL. Signed-off-by: Xu Yandong Reviewed-by: Daniel Henrique Barboza --- src/qemu/qemu_monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index aa230b3306..28f18391a5 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1103,7 +1103,7 @@ qemuMonitorSend(qemuMonitorPtr mon, virErrorPtr qemuMonitorLastError(qemuMonitorPtr mon) { - if (mon->lastError.code =3D=3D VIR_ERR_OK) + if (!mon || mon->lastError.code =3D=3D VIR_ERR_OK) return NULL; =20 return virErrorCopyNew(&mon->lastError); --=20 2.18.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list