xfce4-power-manager crashed with SIGSEGV in vfprintf()

Bug #1054907 reported by David Gerard
104
This bug affects 13 people
Affects Status Importance Assigned to Milestone
Xfce4 Power Manager
Unknown
Unknown
xfce4-power-manager (Ubuntu)
Fix Released
Medium
Unassigned
Quantal
Fix Released
High
Unassigned
Raring
Fix Released
Medium
Unassigned

Bug Description

[Impact]
* Crash on battery status' changes with en_GB and tr locales.

[Test case]
* Switch to the en_GB locale.
* Unplug (and/or) plug the power cord of your laptop and wait a bit.
* Xfce4-power-manager should crash and its systray icon should disappear.
* Install xfce4-power-manager from -proposed
* Restart your session and repeat the steps above.
* Xfce4-power-manager shouldn't crash and notifications should show.

[Regression Potential]
* Broken en_GB and tr translations.

Started machine (Toshiba Portege R830-13C) after dist-upgrade from 12.04 to 12.10. Plugged in, but power icon showed battery. Unplugged, it went to showing as plugged-in! Then it disappeared and the crash report indicator showed something. I clicked on that, and it asked to send this bug.

ProblemType: Crash
DistroRelease: Ubuntu 12.10
Package: xfce4-power-manager 1.2.0-1ubuntu1
ProcVersionSignature: Ubuntu 3.5.0-15.22-generic 3.5.4
Uname: Linux 3.5.0-15-generic x86_64
ApportVersion: 2.5.2-0ubuntu4
Architecture: amd64
Date: Sun Sep 23 10:16:21 2012
ExecutablePath: /usr/bin/xfce4-power-manager
InstallationMedia: Xubuntu 12.04.1 LTS "Precise Pangolin" - Release amd64 (20120817.3)
ProcCmdline: xfce4-power-manager
ProcEnviron:
 LANGUAGE=en_GB:en
 PATH=(custom, user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SegvAnalysis:
 Segfault happened at: 0x7fb26bda1d7a <vfprintf+10042>: repnz scas %es:(%rdi),%al
 PC (0x7fb26bda1d7a) ok
 source "%es:(%rdi)" (0x00000061) not located in a known VMA region (needed readable region)!
 destination "%al" ok
SegvReason: reading NULL VMA
Signal: 11
SourcePackage: xfce4-power-manager
StacktraceTop:
 vfprintf () from /lib/x86_64-linux-gnu/libc.so.6
 __vasprintf_chk () from /lib/x86_64-linux-gnu/libc.so.6
 g_vasprintf () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
 g_strdup_vprintf () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
 g_strdup_printf () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
Title: xfce4-power-manager crashed with SIGSEGV in vfprintf()
UpgradeStatus: Upgraded to quantal on 2012-09-23 (0 days ago)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo

Revision history for this message
David Gerard (dgerard) wrote :
Revision history for this message
Apport retracing service (apport) wrote : This bug is a duplicate

Thank you for taking the time to report this crash and helping to make this software better. This particular crash has already been reported and is a duplicate of bug #1037455, so is being marked as such. Please look at the other bug report to see if there is any missing information that you can provide, or to see if there is a workaround for the bug. Additionally, any further discussion regarding the bug should occur in the other report. Please continue to report any other bugs you may find.

visibility: private → public
tags: removed: need-amd64-retrace
Revision history for this message
David Gerard (dgerard) wrote :

This is marked duplicate of an apparently nonexistent bug. Is this a bug in the bug tracker?

Revision history for this message
Lionel Le Folgoc (mrpouit) wrote :

Yes: it's marked duplicate of a private bug, and since you don't have enough permissions to view it, launchpad will say that the bug doesn't exist...

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xfce4-power-manager (Ubuntu):
status: New → Confirmed
Revision history for this message
kadi (cppege430-email-9ei9nyjpw) wrote :

same crash here.

If i switch off "Show notifications to notify about the battery state" in xfce4-power-manager-settings then power-manager doesnt crash.

Revision history for this message
David Gerard (dgerard) wrote :

De-duping this so that there exists a public post people can actually comment on.

This bug still exists in the release 12.10. Happens every time the power is plugged in or unplugged.

Revision history for this message
Adrian Bridgett (adrian-bridgett) wrote :

#0 0x00007f71f81fb3b1 in vfprintf () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0 0x00007f71f81fb3b1 in vfprintf () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007f71f82ba1d1 in __vasprintf_chk ()
   from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007f71f926343b in g_vasprintf ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3 0x00007f71f924312d in g_strdup_vprintf ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4 0x00007f71f92431cc in g_strdup_printf ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5 0x00007f71fb4037d0 in xfpm_battery_get_message_from_battery_state (
    battery=0x7f71fd4e8000) at xfpm-battery.c:244
#6 xfpm_battery_notify (battery=0x7f71fd4e8000) at xfpm-battery.c:345
#7 0x00007f71fb403eaf in xfpm_battery_notify_idle (data=<optimised out>)
    at xfpm-battery.c:367
#8 0x00007f71f9226ab5 in g_main_context_dispatch ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#9 0x00007f71f9226de8 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007f71f92271e2 in g_main_loop_run ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#11 0x00007f71faab6c77 in gtk_main ()
   from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#12 0x00007f71fb3fd8da in xfpm_start (bus=bus@entry=0x7f71fd4bed28,
    client_id=0x0, dump=<optimised out>) at xfpm-main.c:238
---Type <return> to continue, or q <return> to quit---
#13 0x00007f71fb3fdeeb in main (argc=1, argv=0x7fffe27cf628) at xfpm-main.c:426

(gdb) frame 5
#5 0x00007f71fb4037d0 in xfpm_battery_get_message_from_battery_state (
    battery=0x7f71fd4e8000) at xfpm-battery.c:244
244 msg = g_strdup_printf (_("%s (%i%%)\nEstimated time left is %s."), tmp, battery->priv->percentage, est_time_str);
(gdb) p tmp
$1 = <optimised out>
(gdb) p battery->priv->percentage
$2 = 77
(gdb) p est_time_str
$3 = <optimised out>

looking further, this _seems_ to be the culprit:
(gdb) print battery->priv->battery_name
$6 = (const gchar *) 0x7f71fb3ee94c <Address 0x7f71fb3ee94c out of bounds>

which is set on line 878.. looking into this a bit more, running it under gdb:
(gdb) print battery->priv->battery_name
$2 = (const gchar *) 0x7ffff7ff894c "battery"
so now I don't know...

Revision history for this message
Lionel Le Folgoc (mrpouit) wrote :

> LANG=en_GB.UTF-8

Are you all using this locale?

Revision history for this message
David Gerard (dgerard) wrote :

I'm using that locale, yes.

Revision history for this message
Lionel Le Folgoc (mrpouit) wrote :

$ msgfmt -c po/en_GB.po
po/en_GB.po:550: number of format specifications in 'msgid' and 'msgstr' does not match
po/en_GB.po:570: number of format specifications in 'msgid' and 'msgstr' does not match

The translation is buggy (the format strings in the original and the translated strings don't match). I had already fixed/reported a bunch of these in the past (Bug #975880), but it seems new ones were introduced for 1.2.0.

Changed in xfce4-power-manager (Ubuntu):
importance: Undecided → High
Changed in xfce4-power-manager (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
David Gerard (dgerard) wrote :

Excellent! Any hope of getting those strings fixed for 12.04 and/or 12.10?

Revision history for this message
Lionel Le Folgoc (mrpouit) wrote :

For 12.04 it's ok, they should be already fixed in 1.0.11-0ubuntu2. For 12.10, I'll prepare a Stable Release Update (in the next few days).

Revision history for this message
kadi (cppege430-email-9ei9nyjpw) wrote :

yes, i am also using that locale.

Revision history for this message
Lionel Le Folgoc (mrpouit) wrote :

Added test case, feel free to improve it (the upload to -proposed hasn't occurred yet, so obviously the second part can't be followed yet ;-).

description: updated
Changed in xfce4-power-manager (Ubuntu Quantal):
status: New → Triaged
importance: Undecided → High
Changed in xfce4-power-manager (Ubuntu Raring):
importance: High → Medium
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello David, or anyone else affected,

Accepted xfce4-power-manager into quantal-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/xfce4-power-manager/1.2.0-1ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in xfce4-power-manager (Ubuntu Quantal):
status: Triaged → Fix Committed
tags: added: verification-needed
Revision history for this message
David Gerard (dgerard) wrote :

Appears fixed \o/ Thank you, Lionel! Anyone else?

tags: added: verification-done
removed: verification-needed
Revision history for this message
Lionel Le Folgoc (mrpouit) wrote :

Uploaded to raring as well (with a great revision number).

Changed in xfce4-power-manager (Ubuntu Raring):
status: Triaged → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xfce4-power-manager - 1.2.0-1ubuntu1.1

---------------
xfce4-power-manager (1.2.0-1ubuntu1.1) quantal-proposed; urgency=low

  * debian/patches:
    - 02_translations-fix-invalid-format-strings.patch: updated to fix
      crashes because of en_GB.po and tr.po. lp: #1054907
 -- Lionel Le Folgoc <email address hidden> Mon, 22 Oct 2012 20:00:24 +0200

Changed in xfce4-power-manager (Ubuntu Quantal):
status: Fix Committed → Fix Released
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.