After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 780104 - Gparted crashes when trying to read partitions from disk with unformatted + NTFS partition
Gparted crashes when trying to read partitions from disk with unformatted + N...
Status: RESOLVED DUPLICATE of bug 777973
Product: gparted
Classification: Other
Component: application
GIT HEAD
Other Linux
: Normal normal
: ---
Assigned To: gparted maintainers alias
gparted maintainers alias
Depends on:
Blocks:
 
 
Reported: 2017-03-15 18:42 UTC by dhekir
Modified: 2017-03-16 13:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Backtrace of the segmentation fault, obtained as described in bug #777973 (5.14 KB, text/x-log)
2017-03-15 18:42 UTC, dhekir
Details

Description dhekir 2017-03-15 18:42:37 UTC
Created attachment 348029 [details]
Backtrace of the segmentation fault, obtained as described in bug #777973

I just formatted a new external disk with two partitions: the first one I left unformatted and for the second one I selected NTFS.

After formatting them, Gparted tried to re-read the disk partitions ("Searching /dev/sdc partitions"), but segfault-ed. Trying to start gparted again always results in a segfault when the external disk is connected.

I uninstalled my gparted (0.25.0) and recompiled it from Git. Same result.

The backtrace is attached.
Comment 1 Mike Fleetwood 2017-03-16 09:10:01 UTC
User supplied backtrace pasted for bugzilla to be able to access.


[New LWP 1389]
[New LWP 1404]
[New LWP 1421]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/local/sbin/gpartedbin'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  Glib::ustring_Iterator<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::operator++ (this=0x7ffc61676520) at /usr/include/glibmm-2.4/glibmm/ustring.h:978
978	  pos_ += g_utf8_skip[static_cast<unsigned char>(*pos_)];
[Current thread is 1 (Thread 0x7f3a05dcda00 (LWP 1389))]
  Id   Target Id         Frame 
* 1    Thread 0x7f3a05dcda00 (LWP 1389) Glib::ustring_Iterator<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::operator++ (this=0x7ffc61676520) at /usr/include/glibmm-2.4/glibmm/ustring.h:978
  2    Thread 0x7f39fbf6d700 (LWP 1404) 0x00007f3a0284bb5d in poll () at ../sysdeps/unix/syscall-template.S:84
  3    Thread 0x7f39f89d8700 (LWP 1421) syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38

Thread 3 (Thread 0x7f39f89d8700 (LWP 1421))

  • #0 syscall
    at ../sysdeps/unix/sysv/linux/x86_64/syscall.S line 38
  • #1 g_cond_wait
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #2 GParted::Utils::execute_command
    at Utils.cc line 620
  • #3 GParted::fat16::set_used_sectors
    at fat16.cc line 134
  • #4 GParted::GParted_Core::set_used_sectors
    at GParted_Core.cc line 1755
  • #5 GParted::GParted_Core::set_device_partitions
    at GParted_Core.cc line 1149
  • #6 GParted::GParted_Core::set_device_from_disk
    at GParted_Core.cc line 927
  • #7 GParted::GParted_Core::set_devices_thread
    at GParted_Core.cc line 264
  • #8 ??
    from /usr/lib/x86_64-linux-gnu/libglibmm-2.4.so.1
  • #9 ??
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #10 start_thread
    at pthread_create.c line 333
  • #11 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 109

Thread 1 (Thread 0x7f3a05dcda00 (LWP 1389))

  • #2 GParted::PipeCapture::OnReadable
    at PipeCapture.cc line 63
  • #3 GParted::PipeCapture::_OnReadable
    at PipeCapture.cc line 45
  • #4 g_main_context_dispatch
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #5 ??
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #6 g_main_loop_run
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #7 gtk_main
    from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
  • #8 GParted::GParted_Core::set_devices
    at GParted_Core.cc line 140
  • #9 GParted::Win_GParted::menu_gparted_refresh_devices
    at Win_GParted.cc line 1456
  • #10 GParted::Win_GParted::initial_device_refresh
    at Win_GParted.cc line 1449
  • #11 g_main_context_dispatch
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #12 ??
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #13 g_main_loop_run
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #14 gtk_main
    from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
  • #15 Gtk::Main::run(Gtk::Window&)
    from /usr/lib/x86_64-linux-gnu/libgtkmm-2.4.so.1
  • #16 main
    at main.cc line 57

Comment 2 Mike Fleetwood 2017-03-16 09:28:11 UTC
The backtrace contains function call chain:

Thread 3:
  GParted::fat16::set_used_sectors()
  GParted::Utils::execute_command()

Thread1:
  GParted::PipeCapture::_OnReadable()
  GParted::PipeCapture::OnReadable()
  Glib::ustring_Iterator<...>::operator++()
  Glib::ustring_Iterator<...>::operation++()
  Program terminated with signal SIGSEGV, Segmentation fault.
Comment 3 Mike Fleetwood 2017-03-16 09:38:28 UTC
Thank you for the bug report.

GParted is actually crashing in EXACTLY the same way as in bug 777973.
It is running the command:
    fsck.fat -n -v /dev/PTN
to read the file system usage of a FAT file system and can't handle the
non-valid UTF-8 characters in the output.  (The Glib::ustring iterator
keeps reading past the end of the string until hitting unmapped memory,
causing the segmentation violation).


You say that /dev/sdc contains 2 partitions; one unformatted and one as
NTFS.  However GParted is discovering a FAT file system, likely
corrupted on the disk.  Please provide the output of these commands run
as root:

    parted /dev/sdc print
    blkid | fgrep /dev/sdc

From this we will be able to advise how to clear the old invalid FAT
file system signature and prevent GParted crashing for you.
Comment 4 dhekir 2017-03-16 13:23:59 UTC
Thanks, I actually ended up using KDE partition manager and indeed it showed a FAT partition (it must be the remains of the preexisting one, before I started trying to format them).

I was not sure it was the same bug as the other one so I reported it, so if you know about it already it's fine, I'll mark as a duplicate, I reported mostly to ensure you were aware of it in case it was a new bug.

I had to use the disk earlier today, so I ended up reformatting it with partitionmanager. Thanks a lot for the information!

*** This bug has been marked as a duplicate of bug 777973 ***