gtimelog crashed with SIGSEGV in gtk_style_context_get_valist()

Bug #1016212 reported by Aurimas Fišeras on 2012-06-21
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gtimelog (Ubuntu)
Barry Warsaw

Bug Description

Crashes after latest system updates

ProblemType: Crash
DistroRelease: Ubuntu 12.10
Package: gtimelog 0.7.1-0ubuntu1
ProcVersionSignature: Ubuntu 3.5.0-1.1-generic 3.5.0-rc3
Uname: Linux 3.5.0-1-generic x86_64
ApportVersion: 2.2.3-0ubuntu6
Architecture: amd64
Date: Thu Jun 21 22:40:06 2012
ExecutablePath: /usr/bin/gtimelog
InterpreterPath: /usr/bin/python2.7
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/bin/gtimelog
 Segfault happened at: 0x7f9f42d00c87 <gtk_style_context_get_valist+215>: mov 0x30(%rax),%rdx
 PC (0x7f9f42d00c87) ok
 source "0x30(%rax)" (0x00000030) not located in a known VMA region (needed readable region)!
 destination "%rdx" ok
SegvReason: reading NULL VMA
Signal: 11
SourcePackage: gtimelog
 gtk_style_context_get_valist () from /usr/lib/x86_64-linux-gnu/
 gtk_style_context_get () from /usr/lib/x86_64-linux-gnu/
 gtk_style_context_get_color () from /usr/lib/x86_64-linux-gnu/
 ffi_call_unix64 () from /usr/lib/x86_64-linux-gnu/
 ffi_call () from /usr/lib/x86_64-linux-gnu/
Title: gtimelog crashed with SIGSEGV in gtk_style_context_get_valist()
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm admin cdrom dialout kismet libvirtd lpadmin plugdev sambashare vboxusers

Related branches

 gtk_style_context_get_valist (context=context@entry=0x18654c0, state=state@entry=GTK_STATE_FLAG_NORMAL, args=args@entry=0x7fffb0c593e8) at /build/buildd/gtk+3.0-3.5.4/./gtk/gtkstylecontext.c:1395
 gtk_style_context_get (context=context@entry=0x18654c0, state=state@entry=GTK_STATE_FLAG_NORMAL) at /build/buildd/gtk+3.0-3.5.4/./gtk/gtkstylecontext.c:1430
 gtk_style_context_get_color (context=0x18654c0, state=GTK_STATE_FLAG_NORMAL, color=0x197a7d0) at /build/buildd/gtk+3.0-3.5.4/./gtk/gtkstylecontext.c:3256
 ffi_call_unix64 () at ../src/x86/unix64.S:75
 ffi_call (cif=cif@entry=0x7fffb0c596f0, fn=fn@entry=0x7f9f42d01600 <gtk_style_context_get_color>, rvalue=<optimized out>, rvalue@entry=0x7fffb0c596d0, avalue=<optimized out>, avalue@entry=0x7fffb0c595f0) at ../src/x86/ffi64.c:486

Changed in gtimelog (Ubuntu):
importance: Undecided → Medium
tags: removed: need-amd64-retrace
Marius Gedminas (mgedmin) wrote :

I can reproduce this in testdrive with today's quantal CD image:
- select Try Ubuntu
- open terminal with Ctrl+Alt+T (qemu tablet mouse doesn't work for me in quantal)
- sudo software-properties-gtk: enable universe
- sudo apt-get update
- sudo apt-get install gtimelog
- gtimelog

It crashes on startup after printing a couple of error messages:

    (gtimelog:9287): Gtk-CRITICAL **: gtk_style_context_get_property: assertion `priv->widget != NULL || priv->widget_path != NULL' failed
    /usr/lib/python2.7/dist-packages/gi/ Warning: /build/buildd/glib2.0-2.33.2/./gobject/gtype.c:4206: type id `0' is invalid
      return info.invoke(*args, **kwargs)
    /usr/lib/python2.7/dist-packages/gi/ Warning: can't peek value table for type `<invalid>' which is not currently referenced
      return info.invoke(*args, **kwargs)
    Segmentation fault (core dumped)

lp:gtimelog trunk crashes in the same way

Running gtimelog with python -m trace --trace ./gtimelog tells me that the last line of code executed inside gtimelog itself is, which reads

    color = style.get_color(gtk.StateFlags.NORMAL)

Looks like my panel background color detection hack is broken.

I can reproduce the segfault by doing this:

    $ python
    >>> import gi
    >>> from gi.repository import Gtk
    >>> Gtk.MenuBar().get_style_context().get_color(Gtk.StateFlags.NORMAL)

Marius Gedminas (mgedmin) wrote :

As a quick workaround edit ~/.gtimelog/gtimelogrc and set show_tray_icon to False.

Changed in gtimelog (Ubuntu):
status: New → Confirmed
Changed in gtimelog:
status: New → Confirmed
importance: Undecided → Wishlist
importance: Wishlist → Medium
Martin Pitt (pitti) on 2012-06-22
affects: gtimelog → pygobject
Changed in pygobject:
importance: Medium → Unknown
status: Confirmed → Unknown
Martin Pitt (pitti) wrote :

Simple workaround:

--- src/gtimelog/
+++ src/gtimelog/
@@ -1054,7 +1054,8 @@
         # not necessarily the case! this logic works for, say,
         # Ambiance/Radiance, but it gets New Wave and Dark Room wrong.
         if toolkit == 'gi':
- style = gtk.MenuBar().get_style_context()
+ m = gtk.MenuBar()
+ style = m.get_style_context()
             color = style.get_color(gtk.StateFlags.NORMAL)
             value = ( + + / 3

Marius Gedminas (mgedmin) wrote :

pitti's suggested workaround is in lp:gtimelog trunk now and it works fine with today's quantal CD image.

Changed in gtimelog:
status: New → Fix Committed
importance: Undecided → High

On Jun 22, 2012, at 11:24 AM, Martin Pitt wrote:

>--- src/gtimelog/
>+++ src/gtimelog/
>@@ -1054,7 +1054,8 @@
> # not necessarily the case! this logic works for, say,
> # Ambiance/Radiance, but it gets New Wave and Dark Room wrong.
> if toolkit == 'gi':
>- style = gtk.MenuBar().get_style_context()
>+ m = gtk.MenuBar()
>+ style = m.get_style_context()
> color = style.get_color(gtk.StateFlags.NORMAL)
> value = ( + + / 3
> else:

That's gotta be a reference counting bug in pygi.

Changed in pygobject:
importance: Unknown → High
status: Unknown → Confirmed
Changed in pygobject:
importance: High → Low
Changed in gtimelog (Ubuntu):
status: Confirmed → Triaged
Barry Warsaw (barry) on 2012-08-13
Changed in gtimelog (Ubuntu):
milestone: none → ubuntu-12.10-beta-1
assignee: nobody → Barry Warsaw (barry)
importance: Medium → Critical
status: Triaged → In Progress
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gtimelog - 0.7.1-0ubuntu2

gtimelog (0.7.1-0ubuntu2) quantal; urgency=low

  * Apply upstream patch to work around gobject menu reference counting
    bug. (LP: #1016212)
 -- Barry Warsaw <email address hidden> Mon, 13 Aug 2012 13:30:21 -0400

Changed in gtimelog (Ubuntu):
status: In Progress → Fix Released
Marius Gedminas (mgedmin) wrote :

Fixed in 0.8.0.

Changed in gtimelog:
status: Fix Committed → Fix Released
Changed in pygobject:
status: Confirmed → Expired
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.