GNOME Bugzilla – Bug 780104
Gparted crashes when trying to read partitions from disk with unformatted + NTFS partition
Last modified: 2017-03-16 13:23:59 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.
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
+ Trace 237270
Thread 3 (Thread 0x7f39f89d8700 (LWP 1421))
Thread 1 (Thread 0x7f3a05dcda00 (LWP 1389))
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.
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.
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 ***