[Bug 559047] Re: "parted print" crash in en_GB.utf8 locale

James Dingwall james-launchpad at dingwall.me.uk
Tue Feb 2 10:05:53 UTC 2016


In my case the partition name is a zero length string but if I change it
then the output is correct.

This patch resolves the issue for me.

# diff -u parted-2.3/parted/parted.c parted-fixed/parted/parted.c
--- parted-2.3/parted/parted.c  2016-02-02 10:01:50.000000000 +0000
+++ parted-fixed/parted/parted.c        2016-02-02 09:56:31.116198000 +0000
@@ -1701,7 +1701,7 @@
                         putchar (':');

                     if (has_name)
-                        printf ("%s:", _(ped_partition_get_name (part)));
+                        printf ("%s:", ped_partition_get_name (part));
                     else
                         putchar (':');

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to parted in Ubuntu.
https://bugs.launchpad.net/bugs/559047

Title:
  "parted print" crash in en_GB.utf8  locale

Status in parted package in Ubuntu:
  Triaged

Bug description:
  Binary package hint: parted

  $ uname -a
  Linux dagobah 2.6.24-27-server #1 SMP Fri Mar 12 01:23:09 UTC 2010 x86_64 GNU/Linux
  $ dpkg -l | grep parted
  ii  libparted1.7-1                              1.7.1-5.1ubuntu9.2                        The GNU Parted disk partitioning shared libr
  ii  libparted1.7-dbg                            1.7.1-5.1ubuntu9.2                        The GNU Parted disk partitioning library deb
  ii  libparted1.7-dev                            1.7.1-5.1ubuntu9.2                        The GNU Parted disk partitioning library dev
  ii  parted                                      1.7.1-5.1ubuntu9.2                        The GNU Parted disk partition resizing progr
  ii  parted-doc                                  1.7.1-5.1ubuntu9.2                        The GNU Parted disk partition resizing progr

  (on hardy amd64)

  $ sudo env LC_ALL=en_US.utf8 parted /dev/sda print

  Disk /dev/sda: 2000GB
  Sector size (logical/physical): 512B/512B
  Partition Table: gpt

  Number  Start   End     Size    File system  Name  Flags
   1      17.4kB  1000MB  1000MB  linux-swap
   2      1000MB  8000MB  7000MB  ext3               raid
   3      8000MB  2000GB  1992GB                     lvm

  Information: Don't forget to update /etc/fstab, if necessary.

  $ sudo env LC_ALL=en_GB.utf8 parted /dev/sda print

  Disk /dev/sda: 2000GB
  Sector size (logical/physical): 512B/512B
  Partition Table: gpt

  *** glibc detected *** parted: realloc(): invalid next size: 0x000000000063bab0 ***
  ======= Backtrace: =========
  /lib/libc.so.6[0x7fb17e2afe02]
  /lib/libc.so.6(realloc+0x130)[0x7fb17e2b1ea0]
  parted[0x40b2b9]
  parted[0x405773]
  parted[0x40a18c]
  parted[0x4083e7]
  /lib/libc.so.6(__libc_start_main+0xf4)[0x7fb17e2581c4]
  parted[0x403ba9]
  ======= Memory map: ========
  00400000-00410000 r-xp 00000000 09:00 153388                             /sbin/parted
  0060f000-00610000 rw-p 0000f000 09:00 153388                             /sbin/parted
  00610000-006e0000 rw-p 00610000 00:00 0                                  [heap]
  7fb178000000-7fb178021000 rw-p 7fb178000000 00:00 0
  7fb178021000-7fb17c000000 ---p 7fb178021000 00:00 0
  7fb17de28000-7fb17de35000 r-xp 00000000 09:00 258064                     /lib/libgcc_s.so.1
  7fb17de35000-7fb17e035000 ---p 0000d000 09:00 258064                     /lib/libgcc_s.so.1
  7fb17e035000-7fb17e036000 rw-p 0000d000 09:00 258064                     /lib/libgcc_s.so.1
  7fb17e036000-7fb17e039000 r-xp 00000000 09:00 258062                     /lib/libuuid.so.1.2
  7fb17e039000-7fb17e239000 ---p 00003000 09:00 258062                     /lib/libuuid.so.1.2
  7fb17e239000-7fb17e23a000 rw-p 00003000 09:00 258062                     /lib/libuuid.so.1.2
  7fb17e23a000-7fb17e392000 r-xp 00000000 09:00 258071                     /lib/libc-2.7.so
  7fb17e392000-7fb17e592000 ---p 00158000 09:00 258071                     /lib/libc-2.7.so
  7fb17e592000-7fb17e595000 r--p 00158000 09:00 258071                     /lib/libc-2.7.so
  7fb17e595000-7fb17e597000 rw-p 0015b000 09:00 258071                     /lib/libc-2.7.so
  7fb17e597000-7fb17e59c000 rw-p 7fb17e597000 00:00 0
  7fb17e59c000-7fb17e5d3000 r-xp 00000000 09:00 258113                     /lib/libncurses.so.5.6
  7fb17e5d3000-7fb17e7d2000 ---p 00037000 09:00 258113                     /lib/libncurses.so.5.6
  7fb17e7d2000-7fb17e7d7000 rw-p 00036000 09:00 258113                     /lib/libncurses.so.5.6
  7fb17e7d7000-7fb17e7d9000 r-xp 00000000 09:00 258074                     /lib/libdl-2.7.so
  7fb17e7d9000-7fb17e9d9000 ---p 00002000 09:00 258074                     /lib/libdl-2.7.so
  7fb17e9d9000-7fb17e9db000 rw-p 00002000 09:00 258074                     /lib/libdl-2.7.so
  7fb17e9db000-7fb17ea12000 r-xp 00000000 09:00 258218                     /lib/libreadline.so.5.2
  7fb17ea12000-7fb17ec12000 ---p 00037000 09:00 258218                     /lib/libreadline.so.5.2
  7fb17ec12000-7fb17ec1a000 rw-p 00037000 09:00 258218                     /lib/libreadline.so.5.2
  7fb17ec1a000-7fb17ec1b000 rw-p 7fb17ec1a000 00:00 0
  7fb17ec1b000-7fb17ec75000 r-xp 00000000 09:00 260438                     /lib/libparted-1.7.so.1.0.0
  7fb17ec75000-7fb17ee74000 ---p 0005a000 09:00 260438                     /lib/libparted-1.7.so.1.0.0
  7fb17ee74000-7fb17ee77000 rw-p 00059000 09:00 260438                     /lib/libparted-1.7.so.1.0.0
  7fb17ee77000-7fb17ee78000 rw-p 7fb17ee77000 00:00 0
  7fb17ee78000-7fb17ee95000 r-xp 00000000 09:00 258065                     /lib/ld-2.7.so
  7fb17ef53000-7fb17ef54000 rw-p 7fb17ef53000 00:00 0
  7fb17ef54000-7fb17ef55000 r--p 00000000 09:00 64708                      /usr/share/locale-langpack/en_GB/LC_MESSAGES/parted.mo
  7fb17ef55000-7fb17ef94000 r--p 00000000 09:00 64517                      /usr/lib/locale/en_GB.utf8/LC_CTYPE
  7fb17ef94000-7fb17ef95000 r--p 00000000 09:00 64518                      /usr/lib/locale/en_GB.utf8/LC_NUMERIC
  7fb17ef95000-7fb17ef96000 r--p 00000000 09:00 64519                      /usr/lib/locale/en_GB.utf8/LC_TIME
  7fb17ef96000-7fb17f077000 r--p 00000000 09:00 64520                      /usr/lib/locale/en_GB.utf8/LC_COLLATE
  7fb17f077000-7fb17f078000 r--p 00000000 09:00 64521                      /usr/lib/locale/en_GB.utf8/LC_MONETARY
  7fb17f078000-7fb17f079000 r--p 00000000 09:00 64523                      /usr/lib/locale/en_GB.utf8/LC_MESSAGES/SYS_LC_MESSAGES
  7fb17f079000-7fb17f07a000 r--p 00000000 09:00 64524                      /usr/lib/locale/en_GB.utf8/LC_PAPER
  7fb17f07a000-7fb17f07b000 r--p 00000000 09:00 64525                      /usr/lib/locale/en_GB.utf8/LC_NAME
  7fb17f07b000-7fb17f07c000 r--p 00000000 09:00 64526                      /usr/lib/locale/en_GB.utf8/LC_ADDRESS
  7fb17f07c000-7fb17f07d000 r--p 00000000 09:00 64527                      /usr/lib/locale/en_GB.utf8/LC_TELEPHONE
  7fb17f07d000-7fb17f07e000 r--p 00000000 09:00 64528                      /usr/lib/locale/en_GB.utf8/LC_MEASUREMENT
  7fb17f07e000-7fb17f085000 r--s 00000000 09:00 42351                      /usr/lib/gconv/gconv-modules.cache
  7fb17f085000-7fb17f086000 r--p 00000000 09:00 64529                      /usr/lib/locale/en_GB.utf8/LC_IDENTIFICATION
  7fb17f086000-7fb17f08a000 rw-p 7fb17f086000 00:00 0
  7fb17f092000-7fb17f095000 rw-p 7fb17f092000 00:00 0
  7fb17f095000-7fb17f097000 rw-p 0001d000 09:00 258065                     /lib/ld-2.7.so
  7fff7b8e9000-7fff7b8fe000 rw-p 7ffffffea000 00:00 0                      [stack]
  7fff7b9fe000-7fff7ba00000 r-xp 7fff7b9fe000 00:00 0                      [vdso]
  ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
  zsh: abort      sudo env LC_ALL=en_GB.utf8 parted /dev/sda print

  After rebuild with debug:

  $ sudo env LD_LIBRARY_PATH=/usr/lib/debug valgrind --db-attach=yes parted-1.7.1/debian/parted/sbin/parted /dev/sda print
  ==31233== Memcheck, a memory error detector.
  ==31233== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
  ==31233== Using LibVEX rev 1804, a library for dynamic binary translation.
  ==31233== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
  ==31233== Using valgrind-3.3.0-Debian, a dynamic binary instrumentation framework.
  ==31233== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
  ==31233== For more details, rerun with: -v
  ==31233==
  ==31233== Warning: noted but unhandled ioctl 0x1261 with no size/direction hints
  ==31233==    This could cause spurious value errors to appear.
  ==31233==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper.
  ==31233== Warning: noted but unhandled ioctl 0x1261 with no size/direction hints
  ==31233==    This could cause spurious value errors to appear.
  ==31233==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper.
  ==31233== Warning: noted but unhandled ioctl 0x1261 with no size/direction hints
  ==31233==    This could cause spurious value errors to appear.
  ==31233==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper.

  Disk /dev/sda: 2000GB
  Sector size (logical/physical): 512B/512B
  Partition Table: gpt

  ==31233== Invalid write of size 4
  ==31233==    at 0x5784266: wcscat (wcscat.c:45)
  ==31233==    by 0x40CAF0: table_render_row (table.c:218)
  ==31233==    by 0x40CBA8: table_render_rows (table.c:245)
  ==31233==    by 0x40CBEB: table_render (table.c:261)
  ==31233==    by 0x406BD8: do_print (parted.c:1364)
  ==31233==    by 0x40403B: command_run (command.c:138)
  ==31233==    by 0x40C518: non_interactive_mode (ui.c:1324)
  ==31233==    by 0x408EA6: main (parted.c:2254)
  ==31233==  Address 0x5f077d0 is 0 bytes after a block of size 472 alloc'd
  ==31233==    at 0x4C23082: realloc (vg_replace_malloc.c:429)
  ==31233==    by 0x40CA25: table_render_row (table.c:200)
  ==31233==    by 0x40CBA8: table_render_rows (table.c:245)
  ==31233==    by 0x40CBEB: table_render (table.c:261)
  ==31233==    by 0x406BD8: do_print (parted.c:1364)
  ==31233==    by 0x40403B: command_run (command.c:138)
  ==31233==    by 0x40C518: non_interactive_mode (ui.c:1324)
  ==31233==    by 0x408EA6: main (parted.c:2254)
  ==31233==
  ==31233== ---- Attach to debugger ? --- [Return/N/n/Y/y/C/c] ----
  (gdb) frame 1
  #1  0x000000000040caf1 in table_render_row (t=0x5f04a38, rownum=1, ncols=7, s=0x7ff000478) at ../../parted/table.c:218
  218                     wcscat (*s, row[i]);
  (gdb) list
  213                     pad[nspaces] = L'\0';
  214     #else
  215                     pad[nspaces] = '\0';
  216     #endif
  217
  218                     wcscat (*s, row[i]);
  219                     wcscat (*s, pad);
  220                     if (i + 1 < ncols)
  221                             wcscat (*s, DELIMITER);
  222
  (gdb) wc *s
  "Number  Start   End     Size    File system  Name  Flags
   1      17.4kB  1000MB  1000MB  linux-swap   Project-Id-Versi"
  (gdb) wc row[i]
  "Project-Id-Version: parted
  Report-Msgid-Bugs-To: FULL NAME <EMAIL at ADDRESS>
  POT-Creation-Date: 2006-05-27 11:54+0200
  PO-Revision-Date: 2006-10-25 12:58+0000
  Last-Translator: Malcolm Parsons <Unknown>
  Language-Team: English (United Kingdom) <en_GB at li.org>
  MIME-Version: 1.0
  Content-Type: text/plain; charset=UTF-8
  Content-Transfer-Encoding: 8bit
  X-Launchpad-Export-Date: 2010-01-18 01:19+0000
  X-Generator: Launchpad (build Unknown)
  "

  Not sure how that ended up here, but it seems it comes from po/uk.po.

  I've stopped the investigation after realising that doing a

  LC_ALL=C parted

  worked around the problem

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/parted/+bug/559047/+subscriptions



More information about the foundations-bugs mailing list