gtimelog crashed with SIGSEGV in gtk_style_context_get_valist()

Bug #1016212 reported by Aurimas Fišeras
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
GTimeLog
Fix Released
High
Unassigned
pygobject
Expired
Low
gtimelog (Ubuntu)
Fix Released
Critical
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
SegvAnalysis:
 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
StacktraceTop:
 gtk_style_context_get_valist () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
 gtk_style_context_get () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
 gtk_style_context_get_color () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
 ffi_call_unix64 () from /usr/lib/x86_64-linux-gnu/libffi.so.6
 ffi_call () from /usr/lib/x86_64-linux-gnu/libffi.so.6
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

Revision history for this message
Aurimas Fišeras (aurimas-gmail) wrote :
Revision history for this message
Apport retracing service (apport) wrote :

StacktraceTop:
 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

Revision history for this message
Apport retracing service (apport) wrote : Stacktrace.txt
Revision history for this message
Apport retracing service (apport) wrote : ThreadStacktrace.txt
Changed in gtimelog (Ubuntu):
importance: Undecided → Medium
tags: removed: need-amd64-retrace
Revision history for this message
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/types.py:47: 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/types.py:47: 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 main.py:1116, 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)

Revision history for this message
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
Revision history for this message
Marius Gedminas (mgedmin) wrote :
Martin Pitt (pitti)
affects: gtimelog → pygobject
Changed in pygobject:
importance: Medium → Unknown
status: Confirmed → Unknown
Revision history for this message
Martin Pitt (pitti) wrote :

Simple workaround:

--- src/gtimelog/main.py
+++ src/gtimelog/main.py
@@ -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 = (color.red + color.green + color.blue) / 3
         else:

Revision history for this message
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
Revision history for this message
Barry Warsaw (barry) wrote : Re: [Bug 1016212] Re: gtimelog crashed with SIGSEGV in gtk_style_context_get_valist()

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

>--- src/gtimelog/main.py
>+++ src/gtimelog/main.py
>@@ -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 = (color.red + color.green + color.blue) / 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)
Changed in gtimelog (Ubuntu):
milestone: none → ubuntu-12.10-beta-1
assignee: nobody → Barry Warsaw (barry)
importance: Medium → Critical
status: Triaged → In Progress
Revision history for this message
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
Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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