From patchwork Wed Nov 4 23:16:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 1394560 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=pUa0teGw; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CRMx114TKz9sVS for ; Thu, 5 Nov 2020 10:16:53 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 108A484DBD; Wed, 4 Nov 2020 23:16:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VV2NFvaYuduR; Wed, 4 Nov 2020 23:16:48 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 20DC5848A3; Wed, 4 Nov 2020 23:16:48 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id EB177C0889; Wed, 4 Nov 2020 23:16:47 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id CD633C0051 for ; Wed, 4 Nov 2020 23:16:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C6FE68491C for ; Wed, 4 Nov 2020 23:16:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WCgK71VtHOKK for ; Wed, 4 Nov 2020 23:16:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by whitealder.osuosl.org (Postfix) with ESMTPS id 48958848A3 for ; Wed, 4 Nov 2020 23:16:45 +0000 (UTC) Received: by mail-pg1-f194.google.com with SMTP id f38so162737pgm.2 for ; Wed, 04 Nov 2020 15:16:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=VXJR4Ui3wx/yVKPjnMsvCYepB4xdME7r9HX0WxcQToY=; b=pUa0teGw17oUafU1lEGOOSu6tgR2K/R+wA7m1frwlsZVw76NYKjGX001i+orB36SBS As2rvtu9AnRLP9sUdBVi0xznEk+Uo77UHoryP8ziStt13D2dKClRTUBS/EtuJfo7dgsu tLog4Ky5fKiONXu4ra0FI6uaOMd4kWt+cYsY03gpNmiLc2lEDIIGamsz4Fb6wDrtfAHz aVqKxC5C6Z67UZnL7W/leq1zxTMlZaFpu69N8zmayv/ZE69Nc4B1qxcQKHWgaIpuxjpx j4N8//uzCqsmZgT7P+FYB80Gv1rqxuc7qEivSBBt9+81vM5rwq5cBF3T4B75EsX5n4WD OXsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=VXJR4Ui3wx/yVKPjnMsvCYepB4xdME7r9HX0WxcQToY=; b=cMtpA0pun9+EkdPcBmy9T2MxxOhzUXhJ+96Id3HXnfD+yyY9KAbl7+28rmotRVcUch XaAqxNo3IXXqfpHMcQRHLtrxxjOZqqsiV1a5DDZUwqJjWOfuc3DwQ4YPe7t6Ri767PsS 21LAmWTVGDAwnFwzKNFQkS94G5Sr4vQ0SpXyZg1ID1WDdu0G4D3mjAHI/0c1AQCMckRa eIeoZZwfm/P6H+gtG/xwl/Cy7TU59iNzFgdK6x9rNl66QKndEzSWUsBkKlFFH50w2ofJ 6HjUpYLuUtbNSrUsZIA0mnvQAWrCB9fIp86ctt/DkhhYHHZ+jZMXrGA9inOHvWJPTEL3 RDHA== X-Gm-Message-State: AOAM530mzMFIkLqJysYHc9O4rQ/ez77ZMCl47eJV/Ddk78s5e+gvM1S+ GUjEU9NngYDf6Jjkw1Jy3ReUnJgP8lI= X-Google-Smtp-Source: ABdhPJyd3tQkoZosNBSLgOk9d+jbNcfUj7D9KdbluaEF6tNVoJpVAGSR0wSZHbKCfZdkPVv8dTbXDA== X-Received: by 2002:a17:90a:ca0b:: with SMTP id x11mr209246pjt.155.1604531804481; Wed, 04 Nov 2020 15:16:44 -0800 (PST) Received: from sc9-mailhost1.vmware.com (c-76-21-95-192.hsd1.ca.comcast.net. [76.21.95.192]) by smtp.gmail.com with ESMTPSA id u5sm3124181pjn.15.2020.11.04.15.16.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Nov 2020 15:16:43 -0800 (PST) From: William Tu To: dev@openvswitch.org Date: Wed, 4 Nov 2020 15:16:15 -0800 Message-Id: <1604531775-44045-1-git-send-email-u9012063@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [ovs-dev] [PATCH] ovs-bugtool: Fix crash when enable --ovs. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" When enabling '--ovs' or when not using '-y', ovs-bugtool crashes due to Traceback (most recent call last): File "/usr/local/sbin/ovs-bugtool", line 1410, in sys.exit(main()) File "/usr/local/sbin/ovs-bugtool", line 690, in main for (k, v) in data.items(): RuntimeError: dictionary changed size during iteration The patch fixes it by making a copy of the key and value. VMware-BZ: #2663359 Signed-off-by: William Tu Acked-by: Greg Rose --- utilities/bugtool/ovs-bugtool.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utilities/bugtool/ovs-bugtool.in b/utilities/bugtool/ovs-bugtool.in index ddb5bc8dc54c..3792502e7a0c 100755 --- a/utilities/bugtool/ovs-bugtool.in +++ b/utilities/bugtool/ovs-bugtool.in @@ -687,7 +687,7 @@ exclude those logs from the archive. CAP_OPENVSWITCH_LOGS, CAP_NETWORK_CONFIG] ovs_info_list = ['process-tree'] # We cannot use iteritems, since we modify 'data' as we pass through - for (k, v) in data.items(): + for (k, v) in list(data.items()): cap = v['cap'] if 'filename' in v: info = k[0] @@ -708,7 +708,7 @@ exclude those logs from the archive. # permit the user to filter out data # We cannot use iteritems, since we modify 'data' as we pass through - for (k, v) in data.items(): + for (k, v) in list(data.items()): cap = v['cap'] if 'filename' in v: key = k[0]