Public bug reported:

A couple weeks back I did a dist-upgrade from Xubuntu 12.04 to 14.04. My
preferred desktop environment has always been gnome2 so these days I use
the MATE desktop environment on top of Xubuntu. I still use Thunar
though.

Ever since I upgraded to 14.04.1 LTS I have been having very regular
crashes of any file manager that uses glib2.0. I noticed it first with
Caja so I figured it was a MATE issue. I even went so far as too submit
a bug to the Ubuntu MATE devs on launchpad: https://bugs.launchpad.net
/ubuntu-mate/+bug/1369331 . But it is not just Caja, it also effects
Thunar in exactly the same way.

thunar:
  Installed: 1.6.3-1ubuntu5
  Candidate: 1.6.3-1ubuntu5
  Version table:
 *** 1.6.3-1ubuntu5 0
        500 http://us.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status

The specific Thunar segfault results from memory corruption in the
gslice magazine allocator. That doesn't mean it is a glib bug, really,
as the programs are probably still at fault. The backtraces I get for
every crash all have,

Program received signal SIGSEGV, Segmentation fault.
magazine_chain_pop_head (magazine_chunks=0x555555813eb0) at 
/build/buildd/glib2.0-2.40.0/./glib/gslice.c:539 539 
/build/buildd/glib2.0-2.40.0/./glib/gslice.c: No such file or directory.
#0 magazine_chain_pop_head (magazine_chunks=0x555555813eb0) at 
/build/buildd/glib2.0-2.40.0/./glib/gslice.c:539
#1 thread_memory_magazine1_alloc (tmem=, ix=1) at 
/build/buildd/glib2.0-2.40.0/./glib/gslice.c:842 #2 g_slice_alloc 
(mem_size=mem_size@entry=24) at /build/buildd/glib2.0-2.40.0/./glib/gslice.c:998
#3 0x00007ffff4bbdfd3 in g_string_sized_new (dfl_size=dfl_size@entry=2) at 
/build/buildd/glib2.0-2.40.0/./glib/gstring.c:121 ...

.. as the source of the problem. The full backtrace for Thunar is here (and 
attached as a file):
http://pastebin.com/UiXC1LcX

These segfaults happen at random time intervals but usually can be
counted on to segfault once every 3 hours or so. Sometimes it can be as
often as every tens of minutes.

Sep 16 18:14:18 localhost kernel: [317606.465729] thunar[7798]: segfault at 
12f112bb ip 00007f3141623297 sp 00007fff8e6d6790 error 4 in 
libglib-2.0.so.0.4000.0[7f31415bf000+106000]
Sep 16 18:18:43 localhost whoopsie[1277]: Parsing 
/var/crash/_usr_bin_thunar.1000.crash.
Sep 16 18:18:43 localhost whoopsie[1277]: Uploading 
/var/crash/_usr_bin_thunar.1000.crash.
Sep 16 18:18:44 localhost whoopsie[1277]: Sent; server replied with: No error
Sep 16 18:18:44 localhost whoopsie[1277]: Response code: 200

I have been trying to get more exact information about the memory
corruption in the gslice magazine allocator by using Valgrind. If I just
start Thunar with Valgrind it'll finish it's thing and stop watching
almost instantly before a crash can occur. So I've been trying to use it
with gdb to wait until the segfault,

<terminal1>
$ echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope 
$ gdb -p `pidof thunar` 
(gdb) set logging file ~/oncemoreintothebreach.txt 
(gdb) set logging on    

<terminal2>
$ G_DEBUG=fatal-criticals G_SLICE=always-malloc G_DEBUG=gc-friendly  valgrind 
--track-origins=yes --vgdb=yes --vgdb-error=0 -v --tool=memcheck 
--leak-check=no --num-callers=40 --log-file=valgrind.log --trace-children=yes 
$(which thunar)

<terminal1>
(gdb) target remote | vgdb 
(gdb) continue
... wait for the crash ...
(gdb) backtrace

But so far I've been unsuccessful in gathering anything in valgrind.log
that would be useful. Does anyone have any hints for exploring this
issue with Valgrind? Or perhaps what I can do to fix this? Or links to
other reports similar to mine?

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: thunar 1.6.3-1ubuntu5
ProcVersionSignature: Ubuntu 3.13.0-35.62-generic 3.13.11.6
Uname: Linux 3.13.0-35-generic x86_64
NonfreeKernelModules: fglrx
ApportVersion: 2.14.1-0ubuntu3.4
Architecture: amd64
Date: Sun Sep 21 12:58:00 2014
InstallationDate: Installed on 2013-07-20 (428 days ago)
InstallationMedia: Xubuntu 12.04.2 LTS "Precise Pangolin" - Release amd64 
(20130213)
SourcePackage: thunar
UpgradeStatus: Upgraded to trusty on 2014-09-02 (19 days ago)

** Affects: thunar (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug trusty

** Attachment added: "thunar segfault backtrace"
   https://bugs.launchpad.net/bugs/1372140/+attachment/4210670/+files/thunar.txt

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

Title:
  thunar segfault, memory corruption in the gslice magazine allocator

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

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to