emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#34218: closed (Partition name is not set by mkpart


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#34218: closed (Partition name is not set by mkpart if compiled with --disable-debug)
Date: Thu, 31 Jan 2019 19:31:02 +0000

Your message dated Thu, 31 Jan 2019 11:30:05 -0800
with message-id <address@hidden>
and subject line Re: bug#34218: Partition name is not set by mkpart if compiled 
with --disable-debug
has caused the debbugs.gnu.org bug report #34218,
regarding Partition name is not set by mkpart if compiled with --disable-debug
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
34218: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=34218
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Partition name is not set by mkpart if compiled with --disable-debug Date: Sun, 27 Jan 2019 11:34:40 +0100 User-agent: Mutt/1.11.1 (2018-12-01)
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



--- End Message ---
--- Begin Message --- Subject: Re: bug#34218: Partition name is not set by mkpart if compiled with --disable-debug Date: Thu, 31 Jan 2019 11:30:05 -0800 User-agent: Mutt/1.10.1 (2018-07-13)
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)


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]