From patchwork Sat Aug 1 07:08:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 11695913 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 766EA13B1 for ; Sat, 1 Aug 2020 07:09:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5DBF82072A for ; Sat, 1 Aug 2020 07:09:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596265766; bh=UEdcp71Aq5drK4FDygZhERM5Ax5ZD4Pi1ycYMYSG/oE=; h=From:To:Cc:Subject:Date:List-ID:From; b=xxM3ok2ej4G8vO3FfNcN6vt9IJ1RJnT4RRZtmdy0WS5tpHZI51dqMkmrimXR/ZZbn ZoMUvgiE15OlVDar2cIZ0hVGR9YY1xMVbC+qQI5RZB+In8zQaeKuGj5RYZEA5eNPp1 /x6dtC7VPKoJhnKs2f6OzJ/HDemKvgo2A6Q5N9jk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726062AbgHAHJZ (ORCPT ); Sat, 1 Aug 2020 03:09:25 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:56485 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728309AbgHAHJY (ORCPT ); Sat, 1 Aug 2020 03:09:24 -0400 Received: from oscar.flets-west.jp (softbank126025067101.bbtec.net [126.25.67.101]) (authenticated) by conuserg-08.nifty.com with ESMTP id 07178rlC012084; Sat, 1 Aug 2020 16:08:53 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com 07178rlC012084 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1596265734; bh=+2ZgBhJsxCygCn3H+/vlqw6qc7+LaVpC5dgg+7LYwbQ=; h=From:To:Cc:Subject:Date:From; b=UXCTL46OqvcIoei4c4ngpKOL1RpIpGMvhJyHfpjs3K8NSNF5tDr5JplAzxAAUPPvf 8oO+uZgMIJs/XMh0WjLLZcV/VkoeBrZZD3IPvvjczJtEcJXBR0wMoexJeskiDv0e2l y21QGJdFMzTZtAJ2s5Ch9BqbEQzSMUJezLsCdC48AvAewQIO9QG0MF+MjdAQWC1g1o kIWplSjPE7Pg9iSGJ1OG6efl1sSN7+NjY2fBqTqYYjLkxU7U1hOHST2rfrfwwUDhAS Wg3AEr1R1W/6EVfRQ7/yPajrRTSW43BRL6uFg4izCHrdq+ChoOglSnixYHCOGb/V5D 2vgrj60z29qgQ== X-Nifty-SrcIP: [126.25.67.101] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Mauro Carvalho Chehab , Masahiro Yamada , Maxim Levitsky , linux-kernel@vger.kernel.org Subject: [PATCH 1/2] Revert "kconfig: qconf: don't show goback button on splitMode" Date: Sat, 1 Aug 2020 16:08:49 +0900 Message-Id: <20200801070850.484106-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org This reverts commit cc1c08edccaf5317d99a17a3231fe06381044e83. Maxim Levitsky reports 'make xconfig' crashes since that commit (https://lkml.org/lkml/2020/7/18/411) Or, the following is simple test code that makes it crash: menu "Menu" config FOO bool "foo" default y menuconfig BAR bool "bar" depends on FOO endmenu Select the Split View mode, and double-click "bar" in the right window, then you will see Segmentation fault. When 'last' is not set for symbolMode, the following code in ConfigList::updateList() calls firstChild(). item = last ? last->nextSibling() : firstChild(); However, ConfigList::firstChild() does not seem to return a (ConfigItem *) capable pointer, which seems another bug. Moreover, we should reconsider whether hiding the goback icon is the right thing to do. In the following test code, the Split View shows "Menu2" and "Menu3" in the right window. You can descend into "Menu3", but there is no way to ascend back to "Menu2" from "Menu3". menu "Menu1" config FOO bool "foo" default y menu "Menu2" depends on FOO menu "Menu3" config BAZ bool "baz" endmenu endmenu endmenu It is true that the goback button is currently not functional due to yet another bug, but hiding the problem is not the right way to go. Anyway, Segmentation fault is rather fatal. Revert the offending commit for now, and we should find the right solution. Reported-by: Maxim Levitsky Signed-off-by: Masahiro Yamada --- scripts/kconfig/qconf.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index 4a616128a154..75c7b57fd7a9 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -437,10 +437,9 @@ void ConfigList::updateList(ConfigItem* item) if (rootEntry != &rootmenu && (mode == singleMode || (mode == symbolMode && rootEntry->parent != &rootmenu))) { item = (ConfigItem *)topLevelItem(0); - if (!item && mode != symbolMode) { + if (!item) item = new ConfigItem(this, 0, true); - last = item; - } + last = item; } if ((mode == singleMode || (mode == symbolMode && !(rootEntry->flags & MENU_ROOT))) && rootEntry->sym && rootEntry->prompt) { From patchwork Sat Aug 1 07:08:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 11695911 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0FE6C13B1 for ; Sat, 1 Aug 2020 07:09:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E25012071E for ; Sat, 1 Aug 2020 07:09:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596265762; bh=K3Lsn0SCbNa+DNmwoG0jf43h9fNCON1hEUz6EPmv67E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=AituGjgT0AEXPlOp8KQ9R1mmEPeKy3FPi4F0GZojrbgFlT4SgZB+Oev1tsAPeT9GO oMsLDX7b+ujDy85q3UpJBwlWLP3RpQgqC4tqtlSV/DM9sjf9P5Ax4rDIyWW7XiS0mm XmdZHtMYjA+r4gCOEd2yjY56y4TW7DUOFvWfrSRQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726364AbgHAHJW (ORCPT ); Sat, 1 Aug 2020 03:09:22 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:56395 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726062AbgHAHJU (ORCPT ); Sat, 1 Aug 2020 03:09:20 -0400 Received: from oscar.flets-west.jp (softbank126025067101.bbtec.net [126.25.67.101]) (authenticated) by conuserg-08.nifty.com with ESMTP id 07178rlD012084; Sat, 1 Aug 2020 16:08:54 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com 07178rlD012084 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1596265734; bh=EixGanP6XR3XFr9BeJOupuwmppYAbIcEyHygqrmijpM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xhJvHg2KVTp/4BStnKtzlFKJ+OcEv7l1dxIYA4B3ROslIbUmISJyXzM/RdwTXuacy 9rMPmga+8ZmfebegcMnQyKevhKETjaA1pZkoA0uOZxwVSVei4tiPB8AHlQPiuztnf6 bovjg494pOCuV8Dsq6svjQbFnGNchGe+2vARTfS+KVr1IxgvY7p0MzGbYd6VYoYkkr 7DYYABhxQq+dZ/D8UVdGs1nwREd/2rgswnOi4pyT6ZRP5Sf4TTc+iwL5qmWr0XabgN OzbDFrMkjlXpHNnDKm4mPK/IAJ86iXEO/dbLHIpLh7NEcP9xevbWv6ahnjHhclTcY7 ED26gQLz1Cv0Q== X-Nifty-SrcIP: [126.25.67.101] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Mauro Carvalho Chehab , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 2/2] kconfig: qconf: remove wrong ConfigList::firstChild() Date: Sat, 1 Aug 2020 16:08:50 +0900 Message-Id: <20200801070850.484106-2-masahiroy@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200801070850.484106-1-masahiroy@kernel.org> References: <20200801070850.484106-1-masahiroy@kernel.org> MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org This function returns the first child object, but the returned pointer is not compatible with (ConfigItem *). Commit cc1c08edccaf ("kconfig: qconf: don't show goback button on splitMode") uncovered this because using the pointer from this function would make qconf crash. (https://lkml.org/lkml/2020/7/18/411) This function does not work. Do not use it. Signed-off-by: Masahiro Yamada --- scripts/kconfig/qconf.cc | 2 +- scripts/kconfig/qconf.h | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index 75c7b57fd7a9..80f042a337c2 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -443,7 +443,7 @@ void ConfigList::updateList(ConfigItem* item) } if ((mode == singleMode || (mode == symbolMode && !(rootEntry->flags & MENU_ROOT))) && rootEntry->sym && rootEntry->prompt) { - item = last ? last->nextSibling() : firstChild(); + item = last ? last->nextSibling() : nullptr; if (!item) item = new ConfigItem(this, last, rootEntry, true); else diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h index fb9e9729266f..5eeab4a8bb43 100644 --- a/scripts/kconfig/qconf.h +++ b/scripts/kconfig/qconf.h @@ -92,10 +92,6 @@ public slots: { return this; } - ConfigItem* firstChild() const - { - return (ConfigItem *)children().first(); - } void addColumn(colIdx idx) { showColumn(idx);