From nobody Sun May 5 22:02:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1574173451; cv=none; d=zoho.com; s=zohoarc; b=S3PcEABPKpDL1YOumnEWep7E/IANfh/BaUmTCWSYkr97JpmtKDQDbYxVlfae2dHu1aA/i2bnWxWtHdTvDwYMrr7cmt7htS0mpgT6x+kf5aDRDztoZ478l5LpRtlI9NBYPtxx1gJ8IlsE/YzJGk940Om124GX2XBP3S27UO4J2ek= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1574173451; 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; bh=apsLUcNAw5Vj7sYKy50dRUeUipRIe1kjAWNTvwBxHqo=; b=NxSXtx1svF1CbI+fDgAsIUPh8tFQbP9wqyelMDDqdWRBWLeWSNqX9wPALRz0uqCcqt8fogOaB82jWH4aT68vk3Zg9AIncnO+p+R4CwIUkUdLGEEyskKccathm05kLNx5dReV1J/8i0xgtczp+bXoEznsFSPUSx3MjZ8RTZxJEig= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1574173451082625.0702723550212; Tue, 19 Nov 2019 06:24:11 -0800 (PST) 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-226-Sau_jbxVNumcUHIu7weyKg-1; Tue, 19 Nov 2019 09:24:07 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8ED5385B6F7; Tue, 19 Nov 2019 14:24:01 +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 40B0410375F1; Tue, 19 Nov 2019 14:24: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 3460018034E9; Tue, 19 Nov 2019 14:24:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xAJBe9u6022001 for ; Tue, 19 Nov 2019 06:40:09 -0500 Received: by smtp.corp.redhat.com (Postfix) id 13D3A2022EB3; Tue, 19 Nov 2019 11:40:09 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 100632064000 for ; Tue, 19 Nov 2019 11:40:06 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CCBD81011A67 for ; Tue, 19 Nov 2019 11:40:06 +0000 (UTC) Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-303-la1O_ZDFP5e8ckc40ODg2w-1; Tue, 19 Nov 2019 06:40:04 -0500 Received: by mail-pl1-f193.google.com with SMTP id ay6so11637206plb.0 for ; Tue, 19 Nov 2019 03:40:04 -0800 (PST) Received: from localhost.localdomain.localdomain (li541-253.members.linode.com. [198.74.49.253]) by smtp.gmail.com with ESMTPSA id c184sm26425933pfc.159.2019.11.19.03.40.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Nov 2019 03:40:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574173449; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=apsLUcNAw5Vj7sYKy50dRUeUipRIe1kjAWNTvwBxHqo=; b=XHZg4RD3AcS26vOA88LXPICufnIzCTiOxh95AC+dnN2DGqZ59bGcZiTEe+a8BowRx+RkIs U4l5IOITHDZ0LHxByrDWEF5v+Dc3LpVMxYnrv5lvmHeamDIVU2pTSfRxqmPFu6yiZbX97L SR/35zc/PMXkH/vsuSaA4+vvhxlPyU8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=z2fp+PDrTfzZ6kjeQaezCud540hGFi0qJn4oBdi67g0=; b=htDp0qCNE0Yw81hqffCqcJYotWff0gcElnYm8dP8cno/15YhoKx8BX/IXDD+OgovpX U+FZBhz0osP7HYir51ekPtuGcZ1e9zJiCCk/3NJ/+S2VY1utt/wdmiICH+UtBE9XQk/h Mx3icOAdUlO3ANsuBIrs76UCf7hA5/G2HhV6KpzHGG++ikDtWILBYljGb+8phJnwBZkR KCPTwgaJc3x1EOaK+fC4BczomQNLIBkwUrBXNWdKCfObIfiSKrIMD9EVMmQJwqAQF5uh fGvpmUcaer+V9RdboJwy7RrsKUZGTnccnRvwhsLIWFKA2UCC1gZae6JKbNpE0tAh8aKH HvfQ== X-Gm-Message-State: APjAAAVvX+2/oI2eiMcioggC0bsjeOXEeivfsUCoh9VNmTUGVp0xyaFc qJa9XIHJLN13SduNzZIqL9Fhbzaume8/eQ== X-Google-Smtp-Source: APXvYqw6p/NTk+N1lgbsUoH/dpD6pqa3jfiHI3Lwd6Xo57P/EaD4RWmf9oqa2ydVnPbnhAybeJ7p3w== X-Received: by 2002:a17:90a:68cc:: with SMTP id q12mr6002116pjj.118.1574163603243; Tue, 19 Nov 2019 03:40:03 -0800 (PST) From: LanceLiu To: libvir-list@redhat.com Date: Tue, 19 Nov 2019 19:39:50 +0800 Message-Id: <1574163590-89218-1-git-send-email-liu.lance.89@gmail.com> X-MC-Unique: la1O_ZDFP5e8ckc40ODg2w-1 X-MC-Unique: Sau_jbxVNumcUHIu7weyKg-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id xAJBe9u6022001 X-loop: libvir-list@redhat.com X-Mailman-Approved-At: Tue, 19 Nov 2019 09:23:59 -0500 Cc: LanceLiu Subject: [libvirt] [PATCH] fix bug libvirt daemon deadlock when another force console break down an existed console client when this deadlock hanppened, libvirtd backtrace as follow, a typical ABBA deadlock circumstance: 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: , MIME-Version: 1.0 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" (gdb) thread 23 [Switching to thread 23 (Thread 0x7fbb54810700 (LWP 296966))] (gdb) bt at rpc/virnetserverclient.c:1503 client=3Dclient@entry=3D0x5641d20e20a0, msg=3D0x7fbb08003ab0, rerr=3Dre= rr@entry=3D0x7fbb5480f7b0, procedure=3D201, type=3Dtype@entry=3D3, serial=3D9) at rpc/virnetserverprogram.c:173 msg=3D, rerr=3Drerr@entry=3D0x7fbb5480f7b0, procedure=3D= , serial=3D) at rpc/virnetserverprogram.c:222 opaque=3Dopaque@entry=3D0x5641d20e20a0) at stream.c:246 force=3Dforce@entry=3Dtrue) at conf/virchrdev.c:386 at qemu/qemu_driver.c:16188 st=3Dst@entry=3D0x7fbb08008fc0, flags=3D1) at libvirt-domain.c:9363 rerr=3D0x7fbb5480fc10, msg=3D, client=3D0x5641d20e4e80) = at remote_dispatch.h:8540 rerr=3D0x7fbb5480fc10, args=3D0x7fbb08005eb0, ret=3D) at= remote_dispatch.h:8505 server=3D0x5641d20be420, prog=3D0x5641d20da580) at rpc/virnetserverprog= ram.c:437 msg=3D0x5641d20e9a20) at rpc/virnetserverprogram.c:307 srv=3D0x5641d20be420) at rpc/virnetserver.c:148 ---Type to continue, or q to quit--- (gdb) thread 26 [Switching to thread 26 (Thread 0x7fbb87a378c0 (LWP 295636))] (gdb) bt at stream.c:286 at rpc/virnetserverclient.c:1247 at rpc/virnetserverclient.c:1457 at util/vireventpoll.c:508 Signed-off-by: LanceLiu --- src/remote/remote_daemon_stream.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/remote/remote_daemon_stream.c b/src/remote/remote_daemon_s= tream.c index 1f6e783..b27348f 100644 --- a/src/remote/remote_daemon_stream.c +++ b/src/remote/remote_daemon_stream.c @@ -284,14 +284,16 @@ daemonStreamEvent(virStreamPtr st, int events, void *= opaque) * -1 on fatal client error */ static int -daemonStreamFilter(virNetServerClientPtr client ATTRIBUTE_UNUSED, +daemonStreamFilter(virNetServerClientPtr client, virNetMessagePtr msg, void *opaque) { daemonClientStream *stream =3D opaque; int ret =3D 0; =20 + virObjectUnlock(client); virMutexLock(&stream->priv->lock); + virObjectLock(client); =20 if (msg->header.type !=3D VIR_NET_STREAM && msg->header.type !=3D VIR_NET_STREAM_HOLE) --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list