From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 27 06:42:30 2019 Received: (at submit) by debbugs.gnu.org; 27 Jan 2019 11:42:30 +0000 Received: from localhost ([127.0.0.1]:47015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gnipZ-0008Pk-VQ for submit@debbugs.gnu.org; Sun, 27 Jan 2019 06:42:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56401) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gnhmB-0006fM-KX for submit@debbugs.gnu.org; Sun, 27 Jan 2019 05:34:57 -0500 Received: from lists.gnu.org ([209.51.188.17]:41884) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gnhm6-00058O-DV for submit@debbugs.gnu.org; Sun, 27 Jan 2019 05:34:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gnhm5-0007r6-KN for bug-parted@gnu.org; Sun, 27 Jan 2019 05:34:50 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gnhm5-00056B-2f for bug-parted@gnu.org; Sun, 27 Jan 2019 05:34:49 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:45157) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gnhm2-00052Q-VS for bug-parted@gnu.org; Sun, 27 Jan 2019 05:34:47 -0500 Received: by mail-wr1-x42d.google.com with SMTP id t6so14674816wrr.12 for ; Sun, 27 Jan 2019 02:34:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=Uly1zGKDetTYaPbv8Onr1IXVuhgLHWgSWEGdaNgMtAM=; b=FtWfZp3F+TRA3eIfT7XSRT6dz8GBsZ4m3+RLIAr3f/g3s1e5ASDzZdRi29IkAq8PAB TjLkyLoRnvHEjBSIgxd4ZRCo3cyfs5RARBTGR420f40He+E5vrHt6aBge+VOXeQ2e8uB sPI2n/QN+K5jm58lRcvgDsS7QemhC/mWNf2sx72WPvXFub+Clhf1CNIhL4H9bH/g/z06 EeHcOUEH2SGe21MWem+MTHBI1QSpsPRpFwWzCfKNJot2mMqqEocYdP4xCGXZDf/UN9Hs jPI/CUbR2l53sMfYd91+RxsjSb4ch67I9NpS01i3n9UjOhlXJR/vcAiCqNFdGS+lyQwU PwIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=Uly1zGKDetTYaPbv8Onr1IXVuhgLHWgSWEGdaNgMtAM=; b=j0yRtBPqh88hyPKe3YC+klBNXGGcj55/OQM4I+rh6NWCmaBCjHZ37Swhng6mebEKSK I3MupQ5QuKuFG1rZIyeOL9p3s4o1W0AjQ3BRdix2+Of4mR2NtT/NRStECjPRl/vNVcyl ut9goABy3k4Oldg3DGaLLyJlXtx6dVvYOwhwCTJlshi04/gRv6KHD26xFxtAQmSIL/yO SKaUWpyBypMc7BTKIydnzaG2wpFqOSpaUDVTZIyLzrpXLh8Dv8enpZ6qnDT7vxykCvPb nUG4whaaqVpCX+nEakmMnjRoBjnS8eg95AM1POTjdzcdaVzXUIIDvrKI2yuy09Q/s35T Rf/A== X-Gm-Message-State: AJcUukcqM5Lnzn7mFF421toeAPpSy0ICtYS/IZA8fZOH/KniLx39k4XF 5LyFdNFiMeWsLC6JhHdAnhgg3LpP X-Google-Smtp-Source: ALg8bN5fz/OPE9Os6d43U6LP4lnKb30ihtACXXJIEVwJu/dUvEsLr/fv3duaakzKCIn4Fw+JejOhBg== X-Received: by 2002:adf:a4d9:: with SMTP id h25mr16867431wrb.167.1548585281601; Sun, 27 Jan 2019 02:34:41 -0800 (PST) Received: from laptop-olli.localdomain ([2a02:8070:78e:5000:39be:dd8a:3a50:bb67]) by smtp.googlemail.com with ESMTPSA id 60sm202047979wrb.81.2019.01.27.02.34.40 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 27 Jan 2019 02:34:40 -0800 (PST) Date: Sun, 27 Jan 2019 11:34:40 +0100 From: Oliver Mangold To: bug-parted@gnu.org Subject: Partition name is not set by mkpart if compiled with --disable-debug Message-ID: <20190127103440.GG2217@laptop-olli.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.11.1 (2018-12-01) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42d X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 27 Jan 2019 06:42:28 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hi, I noticed a long-standing bug, that the 'name' argument of mkpart seems to be ignored. It happens only with debug disabled on compilation '--disable-debug' (as e.g. Arch Linux does for its package). The reason is, that from parted.c the function ped_partition_set_name is called within an assert. I believe the code should be rather something like this (which works for me): --- parted/parted.c.orig 2019-01-27 11:27:54.742081238 +0100 +++ parted/parted.c 2019-01-27 11:28:18.049039748 +0100 @@ -806,7 +806,8 @@ /* set minor attributes */ if (part_name) - PED_ASSERT (ped_partition_set_name (part, part_name)); + if (!ped_partition_set_name (part, part_name)) + goto error; free (part_name); /* avoid double-free upon failure */ part_name = NULL; if (!ped_partition_set_system (part, fs_type)) --- Best regards, Oliver From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 31 14:30:16 2019 Received: (at 34218-done) by debbugs.gnu.org; 31 Jan 2019 19:30:16 +0000 Received: from localhost ([127.0.0.1]:53351 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gpI2S-0003QK-KM for submit@debbugs.gnu.org; Thu, 31 Jan 2019 14:30:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52558) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gpI2Q-0003Q2-7X for 34218-done@debbugs.gnu.org; Thu, 31 Jan 2019 14:30:15 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3BBDF7E439; Thu, 31 Jan 2019 19:30:08 +0000 (UTC) Received: from lister.brianlane.com (ovpn-112-42.phx2.redhat.com [10.3.112.42]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 85CF11864E; Thu, 31 Jan 2019 19:30:07 +0000 (UTC) Date: Thu, 31 Jan 2019 11:30:05 -0800 From: "Brian C. Lane" To: Oliver Mangold Subject: Re: bug#34218: Partition name is not set by mkpart if compiled with --disable-debug Message-ID: <20190131193005.GB11492@lister.brianlane.com> References: <20190127103440.GG2217@laptop-olli.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190127103440.GG2217@laptop-olli.localdomain> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 31 Jan 2019 19:30:08 +0000 (UTC) X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 34218-done Cc: 34218-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) On Sun, Jan 27, 2019 at 11:34:40AM +0100, Oliver Mangold wrote: > Hi, > > I noticed a long-standing bug, that the 'name' argument of mkpart seems to be ignored. It happens only with debug disabled on compilation '--disable-debug' (as e.g. Arch Linux does for its package). The reason is, that from parted.c the function ped_partition_set_name is called within an assert. I believe the code should be rather something like this (which works for me): > > --- parted/parted.c.orig 2019-01-27 11:27:54.742081238 +0100 > +++ parted/parted.c 2019-01-27 11:28:18.049039748 +0100 > @@ -806,7 +806,8 @@ > > /* set minor attributes */ > if (part_name) > - PED_ASSERT (ped_partition_set_name (part, part_name)); > + if (!ped_partition_set_name (part, part_name)) > + goto error; > free (part_name); /* avoid double-free upon failure */ > part_name = NULL; > if (!ped_partition_set_system (part, fs_type)) Thanks, I've applied this to master with a small change, it needs to jump to error_remove_part I'm also not sure it's a good idea to run parted without debug, when I added --disable-debug to my fedora build pretty much all the tests fail with segfaults. But either way, an assert shouldn't be wrapping function calls that have side-effects. -- Brian C. Lane (PST8PDT) From unknown Thu Jun 19 14:29:05 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 01 Mar 2019 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator