gnome-power-manager crashed with SIGSEGV in free()

Bug #397248 reported by Arnaud Faucher on 2009-07-09
This bug affects 18 people
Affects Status Importance Assigned to Milestone
Fix Released
gnome-power-manager (Ubuntu)

Bug Description

Binary package hint: gnome-power-manager

Using a laptop, the screen turns black for less than 1 second. It happens when the battery reaches a full charge.

ProblemType: Crash
Architecture: i386
CrashCounter: 1
Date: Wed Jul 8 21:48:06 2009
DistroRelease: Ubuntu 9.10
ExecutablePath: /usr/bin/gnome-power-manager
NonfreeKernelModules: ndas_core nvidia
Package: gnome-power-manager 2.27.2-0ubuntu1
ProcCmdline: gnome-power-manager
ProcVersionSignature: Ubuntu 2.6.31-2.16-generic
 Segfault happened at: 0xd8a701 <free+129>: cmpxchg %ecx,(%esi)
 PC (0x00d8a701) ok
 source "%ecx" ok
 destination "(%esi)" (0x26b48dff) not located in a known VMA region (needed writable region)!
SegvReason: writing unknown VMA
Signal: 11
SourcePackage: gnome-power-manager
#0 0x00d8a701 in free () from /lib/tls/i686/cmov/
#1 0x00c94f16 in g_free () from /usr/lib/
#2 0x0805e0fe in gpm_engine_fully_charged_cb (engine=0xa074cb0, device=0x0,
    manager=0xa071010) at gpm-manager.c:1051
        type = 2161259
        native_path = 0x998b2c "G_VALUE_HOLDS_UINT (value)"
        ret = <value optimized out>
        plural = <value optimized out>
        __FUNCTION__ = "gpm_engine_fully_charged_cb"

Title: gnome-power-manager crashed with SIGSEGV in free()
Uname: Linux 2.6.31-2-generic i686
UserGroups: adm admin cdrom dialout libvirtd lpadmin plugdev sambashare

Arnaud Faucher (arnaud-faucher) wrote :
visibility: private → public

StacktraceTop:?? ()

tags: added: apport-failed-retrace
tags: removed: need-i386-retrace
Scott Howard (showard314) wrote :

Thanks for the stack trace (the complete one is here:

How repeatable is the crash? Are there steps you can do to recreate it? When you say "the screen turns black" - is it because of GPM screen blanking, screen saver, or this crash?

description: updated
tags: removed: apport-failed-retrace
Changed in gnome-power-manager (Ubuntu):
importance: Undecided → Medium
status: New → Incomplete
Arnaud Faucher (arnaud-faucher) wrote :

Thanks for your care.

Immediately before the crash, there is a very brief screen blanking. It is definitely not due to the screen saver because it happens when I work.

Don't know if it's of interest, but in order to keep my battery in good condition, I always use it whenever possible, down to ~ 10% then I recharge it fully. I'm going to be careful in order to gather more precise conditions to reproduce this bug.

Chris Gregan (cgregan) wrote :

I have just seen this issue. No steps to reproduce as far as I could tell. System was idle and then notified me that power-manager had crashed triggering apport.

Scott Howard (showard314) wrote :

Thanks for the confirmation.
Could one of you please attach the resulting log file of: /usr/share/gnome-power-manager/gnome-power-bugreport &> gpm.log to the report?

Also, the backtrace isn't complete yet. Could you follow the instructions at:
to get a backtrace. The apport trace is failing, so we have to use the manual gdb trace.

Arnaud Faucher (arnaud-faucher) wrote :

Please find the gpm.log file as per your request. I'm now backtracing using gdb. Chris, can you also make this procedure, we'll have more chance triggering the crash.

Arnaud Faucher (arnaud-faucher) wrote :

Here is the gdb backtrace. I have also added dbgsym in libglib and libdbus. There are still "??" from libdbus-glib. I'll add dbgsym in this package too in my next attempt to reproduce the bug.

I think the bug triggers when reaching full charge, with a screensaver enabled (I'm using GLCells). I was not able to reproduce the bug yesterday with screensaver disabled (though it is not a certitude).

Confirming, this bug triggers when reaching full charge (was able to reproduce it 3 times).

Here is the *very* full gdb trace with dbgsym in all libraries.

Scott Howard (showard314) wrote :

Phenomenal work! Thanks for putting this together and going through the extra steps for the manual backtrace.

This bug has been reported to the developers of the software. You can track it and make comments at:

Changed in gnome-power-manager (Ubuntu):
status: Incomplete → Triaged
Changed in gnome-power:
status: Unknown → New
Scott Howard (showard314) wrote :

The upstream author, Richard Hughes has committed the fix upstream:

------- Comment #3 from Richard Hughes 2009-07-11 08:00 UTC -------
Excellent bug, thanks for reporting this. I've fixes this in git master, it was
a typo in the signal setup.

We'll either have to wait to get this merged into ubuntu, or someone here can make the patch.

tags: added: bitesize
summary: - gnome-power-manager crashed with SIGSEGV in free()
+ gnome-power-manager crashed when battery reaches full charge
summary: - gnome-power-manager crashed when battery reaches full charge
+ gnome-power-manager crashed crashed with SIGSEGV in free()
description: updated
summary: - gnome-power-manager crashed crashed with SIGSEGV in free()
+ gnome-power-manager crashed with SIGSEGV in free()

Here is a patch.

tags: added: metabug
Changed in gnome-power-manager (Ubuntu):
importance: Medium → High

Here is a debdiff patch fixing this bug.

Scott Howard (showard314) wrote :

Thanks a lot Arnaud.

This package uses a patching system [1,2] so you'll have to change your debdiff a bit:

1) rename LP397248.patch to something more descriptive like "crash-when-battery-charge-full.patch"
2) move it to debian/patches
3) build and test
4) get the debdiff

I can't tell when the next GPM revision will be released upstream, but this is something worth doing.


Also, you can go onto IRC (freenode) and ask someone from #ubuntu-motu to sponsor your patch when your done.

Here is a proposed bzr branch to merge to main branch lp:~gnome-power-manager-team/gnome-power/trunk.

This bug made me learn a lot about the Ubuntu bug patching system !

Martin Pitt (pitti) wrote :

Merged, thanks!

Changed in gnome-power-manager (Ubuntu):
status: Triaged → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-power-manager - 2.27.2-0ubuntu2

gnome-power-manager (2.27.2-0ubuntu2) karmic; urgency=low

  [ Martin Pitt ]
  * Add crash-when-battery-charge-full.patch: Fix crash when battery gets
    fully charged. Thanks to Arnaud Faucher! (LP: #397248)

  [ Scott Howard ]
  * debian/local/ Add
    output. Upstream uses this script for triaging. (LP: #397993)

 -- Martin Pitt <email address hidden> Mon, 13 Jul 2009 10:10:56 +0200

Changed in gnome-power-manager (Ubuntu):
status: Fix Committed → Fix Released
Changed in gnome-power:
status: New → Fix Released
Changed in gnome-power:
importance: Unknown → Critical
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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