Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1jHQ52-0006Ne-P7 for mharc-grub-devel@gnu.org; Thu, 26 Mar 2020 06:49:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56852) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHQ4z-0006NX-1L for grub-devel@gnu.org; Thu, 26 Mar 2020 06:49:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHQ4t-000606-QX for grub-devel@gnu.org; Thu, 26 Mar 2020 06:49:39 -0400 Received: from m9a0014g.houston.softwaregrp.com ([15.124.64.90]:57999) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jHQ4t-0005xr-Il for grub-devel@gnu.org; Thu, 26 Mar 2020 06:49:35 -0400 Received: FROM m9a0014g.houston.softwaregrp.com (15.121.0.191) BY m9a0014g.houston.softwaregrp.com WITH ESMTP; Thu, 26 Mar 2020 10:48:15 +0000 Received: from M9W0068.microfocus.com (2002:f79:bf::f79:bf) by M9W0068.microfocus.com (2002:f79:bf::f79:bf) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Thu, 26 Mar 2020 10:39:09 +0000 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (15.124.72.11) by M9W0068.microfocus.com (15.121.0.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Thu, 26 Mar 2020 10:39:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EftH6nstxGu3VELJiKFS1CLKcGTOPgoKCY9rEV2YFoVyATdQKm59IqIEdgEtn7c4Bvftixx6RM3pOf373Y5kNnB6c9e1siSdIheweAsmvQIBzABRYC7Ba518HmfJVjGi6YhZ9voj8O4/JSryTU3poBWopaQkhfGhSnQRThETcrnCT8KLIIH7KpCk7+hX+FcBXjDiDh3pqC0sMPQ5Js10JrO/51ItAlU3zlabHGukf/E345lwHjLFTnQxNTUADbsx+VGcga+46bDRu0CRwgur2+IcNl6ZINXFHtD9CJdG3F82k32CkZZoR4qWSwPGj29LX0IYhXvlovuMcGoTYGGt+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Rl4HqKXCJsFPtj7uh79P8szA1j/qwKVan/Uk5x+k69E=; b=Igv/goHqNbsMjw6fn+kpJ0NopS84hqTsM6xJ/ZbfekeKCj/U7iRkGPNCdKSp9N5sxFqHcdqAwplIqXDgGaRg75pNQDv1Tzsc89AFJ7zexDwAkhVIN7p6rrbeoJwvg8eMHfBJHcCizpFY4ONZDuXe7pSDR3M4Ebd6Z8GVJzaqtDjgNGyaiwmWZYJ/FglFAca7Td4oA8o3oQ7FIJin0DnQjznM7Su7sxux0BukzJLhk97owLbF29YiU2P2gHOZtpqd0AF4mAQVKGJL6UOgj4L9k2tKUBrsP22fpTVCwEHZx0NyE2340PVR3f68J2fMxm/f6uF6uwcRjDTlGN1wGBTaxw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=MChang@suse.com; Received: from BY5PR18MB3140.namprd18.prod.outlook.com (2603:10b6:a03:1a1::17) by BY5PR18MB3155.namprd18.prod.outlook.com (2603:10b6:a03:1a6::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.20; Thu, 26 Mar 2020 10:39:08 +0000 Received: from BY5PR18MB3140.namprd18.prod.outlook.com ([fe80::a404:f256:fbe8:c2d]) by BY5PR18MB3140.namprd18.prod.outlook.com ([fe80::a404:f256:fbe8:c2d%4]) with mapi id 15.20.2856.019; Thu, 26 Mar 2020 10:39:08 +0000 Date: Thu, 26 Mar 2020 18:39:01 +0800 From: Michael Chang To: The development of GNU GRUB CC: PGNet Dev Subject: Re: fs/ntfscomp.c:82:11: =?utf-8?Q?error?= =?utf-8?B?OiDigJhmbGfigJkgbWF5IGJlIHVzZQ==?= =?utf-8?Q?d?= uninitialized in this function [-Werror=maybe-uninitialized] Message-ID: <20200326103901.GA31860@mercury> References: <67da1ace-cfc0-ac9d-5f65-5aac2ba38ca2@molgen.mpg.de> Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <67da1ace-cfc0-ac9d-5f65-5aac2ba38ca2@molgen.mpg.de> User-Agent: Mutt/1.10.1 (2018-07-13) X-ClientProxiedBy: SN4PR0201CA0048.namprd02.prod.outlook.com (2603:10b6:803:2e::34) To BY5PR18MB3140.namprd18.prod.outlook.com (2603:10b6:a03:1a1::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mercury (36.226.146.226) by SN4PR0201CA0048.namprd02.prod.outlook.com (2603:10b6:803:2e::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.19 via Frontend Transport; Thu, 26 Mar 2020 10:39:06 +0000 X-Originating-IP: [36.226.146.226] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3f05e5e1-080b-4272-ba36-08d7d171e93b X-MS-TrafficTypeDiagnostic: BY5PR18MB3155: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 0354B4BED2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4636009)(39860400002)(346002)(376002)(136003)(366004)(396003)(5660300002)(86362001)(8936002)(66556008)(81166006)(66476007)(956004)(316002)(81156014)(1076003)(9576002)(186003)(16526019)(6916009)(66946007)(4326008)(966005)(52116002)(6496006)(33716001)(6666004)(33656002)(55016002)(9686003)(2906002)(26005)(478600001); DIR:OUT; SFP:1102; SCL:1; SRVR:BY5PR18MB3155; H:BY5PR18MB3140.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; Received-SPF: None (protection.outlook.com: suse.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Df1tmLFhZ6reOx947I6w5612OQpel0Y7LaxViJjFmh+/lA9ofPb27IlJySpwPZ8VNUhYtpM+fXBmf9ytdEDifcgDSwP0nONfmPr+gkUcbW+bbGv5tCPgcnBSANC7ip7u6yJX60k+4WPqafdW2z+Z7fXlJ6U9qePxkNqA3lM/ye13OFDudwEpapkh+ZLzKJkM/siPR7wjZVO5UdtnojxG3bLprqzU28wnG2jU7V4GHqSwdYu4QEiwnyQP5VwtBrBN8X3QiXFbmX2e1pHHqCb8GBJdko9aSWWU0Wzm5dLuORX2aIF3m9Ieq+CD1eclrrOf1/J+aBL/3dPWyRLx8oHeTwY1fXmmavdT+cRYfTYQJVVkrXjvWVbpEdKiqPLzxzZl7ZUGBadKbZ2/AvxF3wtvB10Q5VMWZZ3NW6V7YGyKY890w2jBqQBWdBgwUF+8wqA9JtRoCVf2K9dnGzX5k0km+IM7jJEenw7DY7wW41YXQ3sxSYJnZ7AwZLAgZIxXlVjKsivPjMkzUtH/mUleECeGUQ== X-MS-Exchange-AntiSpam-MessageData: EvXIlxclIr5usSe2elAzCAtUOcDTT3w/xq3ul8il1LizjLmQUOCjvh8/SwWXpw60LHdYRCTENauL0Ahsbh9b1YGAt/f8n0xiPyTk2lLECKEt+0OPf7SwmozOH8OfITKTDF3wSZIF5/eXdrkc3OI+JQ== X-MS-Exchange-CrossTenant-Network-Message-Id: 3f05e5e1-080b-4272-ba36-08d7d171e93b X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Mar 2020 10:39:08.2023 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: EonHCQoq+H/t/ReceGkaI2qQbKIKTv8bWtoPvQ6jDVya4vxJ+x6WmN/PY8BQo0Ms X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR18MB3155 X-OriginatorOrg: suse.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 15.124.64.90 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Mar 2020 10:49:43 -0000 On Thu, Mar 26, 2020 at 09:39:16AM +0100, Paul Menzel wrote: > Dear PGNet Dev, >=20 >=20 > Thank you for your report. >=20 >=20 > Am 26.03.20 um 04:50 schrieb PGNet Dev: > > building > >=20 > > cd grub > > git log | head -n5 > > commit 552c9fd08122a3036c724ce96dfe68aa2f75705f > > Author: Patrick Steinhardt > > Date: Sat Mar 7 17:29:09 2020 +0100 > >=20 > > gnulib: Fix build of base64 when compiling with memory debugging > >=20 > > with > >=20 > > gcc --version > > gcc (SUSE Linux) 10.0.1 20200324 (experimental) [revision 75c24a08d69= 7d6442fe6c26142f0559f803af977] > >=20 > > patched > >=20 > > patch -p1 < /tmp/grub_patches/grub_patches/0001-mdraid1x_linux-Fix-gcc= 10-error-Werror-array-bounds.patch > > patching file grub-core/disk/mdraid1x_linux.c > > patch -p1 < /tmp/grub_patches/grub_patches/0002-zfs-Fix-gcc10-error-We= rror-zero-length-bounds.patch > > patching file grub-core/fs/zfs/zfs.c > > patching file include/grub/zfs/zap_leaf.h > >=20 > > from > >=20 > > https://lists.gnu.org/archive/html/grub-devel/2020-03/msg00222.html > >=20 > > config's ok > >=20 > > unset CC CPP > > ./bootstrap > > ./autogen.sh > > ./configure > >=20 > > build FAILs > >=20 > > make V=3D1 > >=20 > > gcc -DHAVE_CONFIG_H -I. -Wall -W -DGRUB_UTIL=3D1 -D_FILE_OFFSET_BITS= =3D64 -I./include -DGRUB_FILE=3D\"grub-core/fs/ntfscomp.c\" -I. -I. -I. -I.= -I./include -I./include -I./grub-core/lib/libgcrypt-grub/src/ -I./grub-co= re/lib/minilzo -I./grub-core/lib/xzembed -I./grub-core/lib/zstd -DMINILZO_H= AVE_CONFIG_H -O3 -Wall -fstack-protector-strong -funwind-tables -fasynchron= ous-unwind-tables -fmessage-length=3D0 -grecord-gcc-switches -march=3Dnativ= e -mtune=3Dnative -D_FORTIFY_SOURCE=3D2 -D_FILE_OFFSET_BITS=3D64 -Wall -W -= Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -Wcomment -Wdeprecated-de= clarations -Wdisabled-optimization -Wdiv-by-zero -Wfloat-equal -Wformat-ext= ra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-decla= ration -Wimplicit-int -Wmain -Wmissing-braces -Wmissing-format-attribute -W= multichar -Wparentheses -Wreturn-type -Wsequence-point -Wshadow -Wsign-comp= are -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function -Wunu= sed-label -Wunused-parameter -Wunused-value -Wunused-variable -Wwrite-stri= ngs -Wnested-externs -Wstrict-prototypes -Wcast-align -Wextra -Wattributes= -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmissing-f= ield-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict= -aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign -Wmissin= g-include-dirs -Wmissing-prototypes -Wmissing-declarations -Wformat=3D2 -We= rror -fno-builtin -Wno-undef -O3 -Wall -fstack-protector-strong -funwind-t= ables -fasynchronous-unwind-tables -fmessage-length=3D0 -grecord-gcc-switch= es -march=3Dnative -mtune=3Dnative -MT grub-core/fs/libgrubmods_a-ntfscomp.= o -MD -MP -MF grub-core/fs/.deps-util/libgrubmods_a-ntfscomp.Tpo -c -o grub= -core/fs/libgrubmods_a-ntfscomp.o `test -f 'grub-core/fs/ntfscomp.c' || ech= o './'`grub-core/fs/ntfscomp.c > > grub-core/fs/ntfscomp.c: In function =E2=80=98read_block=E2=80=99: > > grub-core/fs/ntfscomp.c:82:11: error: =E2=80=98flg=E2=80=99 may be us= ed uninitialized in this function [-Werror=3Dmaybe-uninitialized] > > 82 | if (flg & 0x8000) > > | ^~~ > > grub-core/fs/ntfscomp.c:74:17: note: =E2=80=98flg=E2=80=99 was declar= ed here > > 74 | grub_uint16_t flg, cnt; > > | ^~~ > > cc1: all warnings being treated as errors > > make[2]: *** [Makefile:7647: grub-core/fs/libgrubmods_a-ntfscomp.o] E= rror 1 > > make[2]: Leaving directory '/usr/local/src/grub' > > make[1]: *** [Makefile:11920: all-recursive] Error 1 > > make[1]: Leaving directory '/usr/local/src/grub' > > make: *** [Makefile:3772: all] Error 2 >=20 > I am unable to reproduce this with >=20 > $ gcc --version > gcc (Debian 10-20200324-1) 10.0.1 20200324 (experimental) [master > revision 596c90d3559:023579257f5:906b3eb9df6c577d3f6e9c3ea5c9d7e4d1e90536= ] Looking into build log, the build option seems to have been overridden with CFLAGS settings like this. CFLAGS=3D"-O3 -Wall -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fmessage-length=3D0 -grecord-gcc-switches -march=3Dnative -mtune=3Dnative" I'm not sure if -O3 is considered as supported since that will result in larger binaries we are striving to reduce all the time. Also the optimization it brings would require careful review if we don't enable it by default. In addition, -fstack-protector-strong breaks the build even harder with a lot of __stack_chk_fail undefined symbol in the modules. If going with default build option, I also don't have this compliation error. >=20 > Here is the code in question: >=20 > `` > static grub_err_t > decomp_get16 (struct grub_ntfs_comp *cc, grub_uint16_t * res) > { > grub_uint8_t c1 =3D 0, c2 =3D 0; >=20 > if ((decomp_getch (cc, &c1)) || (decomp_getch (cc, &c2))) > return grub_errno; > *res =3D ((grub_uint16_t) c2) * 256 + ((grub_uint16_t) c1); > return 0; > } >=20 > [=E2=80=A6] > grub_uint16_t flg, cnt; >=20 > if (decomp_get16 (cc, &flg)) > return grub_errno; > cnt =3D (flg & 0xFFF) + 1; >=20 > if (dest) > { > if (flg & 0x8000) > [=E2=80=A6] > ``` >=20 > In the code, the `if (decomp_get16 (cc, &flg))` ensures, that `flg` is > initialized, doesn=E2=80=99t it? >=20 > Why is it complaining complaining in line 82 and not 78, where `flg` is > already accessed? The code also looks sanity to me. It certainly has things to do with the -O3 optimization, but I couldn't tell more beyond that fact either. :( Regards, Michael >=20 >=20 > Kind regards, >=20 > Paul > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel