upowerd crashed with SIGSEGV in service_client_free()

Bug #1305699 reported by ronin12 on 2014-04-10
280
This bug affects 54 people
Affects Status Importance Assigned to Milestone
upower (Ubuntu)
Medium
Unassigned

Bug Description

it looks like nothing happend. When I switch on the PC and after loging in this window with 'report an error/bug' appeard. so I guess it is minor.
thanks for doing :)

ProblemType: Crash
DistroRelease: Ubuntu 14.04
Package: upower 0.9.23-2ubuntu1
ProcVersionSignature: Ubuntu 3.13.0-23.45-generic 3.13.8
Uname: Linux 3.13.0-23-generic i686
ApportVersion: 2.14.1-0ubuntu1
Architecture: i386
Date: Wed Apr 9 15:37:43 2014
ExecutablePath: /usr/lib/upower/upowerd
InstallationDate: Installed on 2014-04-04 (5 days ago)
InstallationMedia: Ubuntu-Server 14.04 LTS "Trusty Tahr" - Beta i386 (20140326)
ProcCmdline: /usr/lib/upower/upowerd
ProcEnviron:

SegvAnalysis:
 Segfault happened at: 0xb74e9919 <service_client_free+25>: mov (%esi),%eax
 PC (0xb74e9919) ok
 source "(%esi)" (0x302e0000) not located in a known VMA region (needed readable region)!
 destination "%eax" ok
SegvReason: reading unknown VMA
Signal: 11
SourcePackage: upower
StacktraceTop:
 service_client_free () from /usr/lib/i386-linux-gnu/libimobiledevice.so.4
 property_list_service_client_free () from /usr/lib/i386-linux-gnu/libimobiledevice.so.4
 lockdownd_client_free () from /usr/lib/i386-linux-gnu/libimobiledevice.so.4
 ?? ()
 g_object_unref () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0
Title: upowerd crashed with SIGSEGV in service_client_free()
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups:

ronin12 (ronin12) wrote :

StacktraceTop:
 service_client_free (client=0x302e0000) at service.c:159
 property_list_service_client_free (client=0xb8da8b40) at property_list_service.c:103
 lockdownd_client_free_simple (client=0xb8dd1270) at lockdown.c:236
 lockdownd_client_free (client=0xb8dd1270) at lockdown.c:277
 up_device_idevice_finalize (object=0xb8dc2db0) at up-device-idevice.c:264

Changed in upower (Ubuntu):
importance: Undecided → Medium
tags: removed: need-i386-retrace
Iain Lane (laney) on 2014-09-25
information type: Private → Private Security
information type: Private Security → Public
Launchpad Janitor (janitor) wrote :

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

Changed in upower (Ubuntu):
status: New → Confirmed
kolya (mar-kolya) wrote :

I'm able to reproduce this problem when I connect ipad to my laptop via usb.

Attached patch seems to be fixing this problem.

The attachment "0001-upowerd-Fix-cleanup-in-up_device_idevice_coldplug-fi.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Paolo Izzo (paolotherocker) wrote :

I am trying to run the patch with the command:

sudo patch -p1 0001-upowerd-Fix-cleanup-in-up_device_idevice_coldplug-fi.patch

but the terminal get stuck for a long time without giving any output. Am I doing it wrong?

kolya (mar-kolya) wrote :

This is a source code patch, you would need to rebuild the package after you apply it so a source.

patch -p1 < 0001-upowerd-Fix-cleanup-in-up_device_idevice_coldplug-fi.patch

 - this is how you can apply it to the source.

WHK (yan-uniko-102) wrote :

me@machine:~/Escritorio$ patch -p1 < 0001-upowerd-Fix-cleanup-in-up_device_idevice_coldplug-fi.patch
[sudo] password for whk:
can't find file to patch at input line 20
Perhaps you used the wrong -p or --strip option?

Jason Williams (sudojason) wrote :

This was affecting me with my iPhone 6, but I found that installing "libimobiledevice-utils" solved the problem. I already had "libimobiledevice-utils" installed but Apple devices it seem need the other as well. Maybe this library should be a dependency of "libimobiledevice4" ?

sudo apt-get install libimobiledevice-utils

Jason Williams (sudojason) wrote :

Correction: I had "libimobiledevice4" installed but not "libimobiledevice-utils"

libimobiledevice-utils depends on libimobiledevice4
libimobiledevice4 does not depend on libimobiledevice-utils

They should probably be cross-dependent.

kolya (mar-kolya) wrote :

Bug described here has likely nothing to do with libimobiledevice-utils. Patch attached to this bug fixes clearly reproducinble memory handling issue in upowerd. This patch has been accepted by upstream. I think it would be nice if Ubuntu could apply it to LTS packages.

Thanks!

Jason Williams (sudojason) wrote :

After reading the patch, why patch upowerd to compensate for the idevice client libraries not doing their full job in the first place? Of course, upowerd should be able to handle memory handling exceptions regardless, but I'd like to think that it would be bit more abstracted - like for instance: "if mobileclient is not free, then free mobileclient." Are their similar conditionals in the daemon for each individual mobile device type (Android/Windows Phone/Blackberry)?

I do agree that the Ubuntu maintainers should probably have done something before now for an LTS release though - even if it is only applying the daemon patch that plays more nicely with a naughty client library.

In the spirit of sharing, I hope I have at least given some who stumble onto this in their search results a bit of relief. All I know is that before the one package install, this bug was 100% reproducible and 0% afterward. I should also note: I am running in an amd64 environment, so 32-bit user feedback could be helpful.

Potential solutions for end users:
1. Install related package via apt and provide feedback (it may not solve it for you - won't know without feedback)
2. Install developer packages, download upowerd source package, apply patch, compile source, and install new package
3. Wait on the developers to patch upowerd to assist client libraries that are not doing their job, and just ignore that constant core dump pop-up without any feedback

Thanks...

kolya (mar-kolya) wrote :

I'm not sure I would agree that this is idevice library bug.

Yes, it's API might not be perfect, but given that API upowerd was doing clearly wrong thing. Yes, API maybe could be improved. But this is not the reason for upowerd to ignore current state of API contract and do wrong thing.

Jyst my 2 cents.

vicmumo (vmunoz-o) wrote :

Reproduced when I connect an iPhone with USB via docker station

Tried sudo apt-get install libimobiledevice-utils but still get the error on Ubuntu 14.04 LTS x64 / iPhone 4S.

Robert H. Dinah (rhdinah) wrote :

Could someone please be assigned to this bug? If a known fix is out there, please update the 14.04 LTS. Thank you! :-)

tomwgf (tom-wellmadewebsite) wrote :

yesterday i plugged my ipad4 (ios8) into my Ubuntu 14.04 (trusty) laptop. After that i began to get this same message popup at login and exit - though there did not seem to be any actual problem.
I had libimobiledevice4 already installed and installed libimobiledevice-utils this morning.
On Reboot i did not see the message.

goodknight (rememberthehill) wrote :

I get this error too, whenever I boot into my Ubuntu 14.04.

Minh Tran (mobject) wrote :

similar problem when boot into Ubuntu 14.04

Deep Sukhwani (deepsukhwani) wrote :

Error observed each time I connect my iPad with my laptop running Ubuntu 14.04.2 LTS - 64bit.
Attached crash log in txt file.

Martin Pitt (pitti) wrote :

This was applied upstream in http://cgit.freedesktop.org/upower/commit/?id=3a5f3e552 and released in 0.99.2, and thus fixed in Ubuntu 15.04.

Changed in upower (Ubuntu):
status: Confirmed → Fix Committed
status: Fix Committed → Fix Released
Sebastian Geiger (lanoxx) wrote :

Will this be fixed in Ubuntu 14.04? This looks like a reasonably save patch for an SRU.

Sebastian Geiger (lanoxx) wrote :

Dear Martin Pitt,

is there any chance this will be backported to Ubuntu 14.04? Is upowerd not a supported component of Ubuntu?

vonky (bddenhartog) wrote :

Just adding my support for a backport to 14.04LTS.

Kostadin Stoilov (kmstoilov) wrote :

Experiencing this on 14.04 LTS and iPhone 4s with iOS 8.4. Would appreciate a backport to Trusty. I am also happy to help with testing.

Johan Potgieter (6ohan) wrote :

I get this on Xubuntu 14.04 whenever I connect via wifi to my ios personal hotspot. Often it does nothing more than ask to send the report but other times it hangs after a few minutes. I have found it so disruptive that I am unable to get any work done while connected to my phone. I will try some of the remedies and hopefully it will sort out my issue.

I wanted to add this note as I didn't see any mention of this happening while connecting to a personal hotspot, as is the case with me.

Johan Potgieter (6ohan) wrote :

I need to add that I have the latest versions of both libimobiledevice4 and libimobiledevice-utils and I still get this error. I dont get any errors when connecting to any other wifi router or via ethernet cable. Any suggestions would be appreciated.

+1 to ask for a backport to 14.04. It's getting pretty annoying.

It happens every time I plug my iPad Mini 3 to the USB; it gets worst if the system boots with the iPad already plugged ("System problem detected" will show up as soon as I'm logged in, my screen resolution will be wrong, then goes right, and the text is rendered differently, as if missing antialias or using a different font)

kirstin (schoenheit76) wrote :

Same here. Happens randomly regardless of me using an idevice with the computer. Fixing this would be nice.

Bob Briscoe (m-bob-q) wrote :

@pitti
+1 to requests to back-port yr fix into 14.04 LTS
For all of us who are asking, what's the likelihood please?
The no. of people who say they have this problem has reached 42, which is the answer to everything (except knowing whether it will be back-ported)
I guess the number of people with an iPhone or iPod etc who might also be suffering, but in in silence, is more than that.

Andy_D (andy-dempster) wrote :

I've been having this issue at boot and when plugging my phone in for a number of weeks on 14.04 and iPhone 4s.

After suffering in silence I searched and found this thread. Would love to see this fix back-ported but I installed the libimobiledevice-utils and it appears to have gone away.

So my advice to people searching is to try installing libimobiledevice-utils and report back here on your success either way!

Now I'm off to get the Zend SIGSEV fixed in Apache!

Bob Briscoe (m-bob-q) wrote :

@Andy_D, I installed libimobiledevice-utils.
First time I connected my iPhone, the screen froze (except mouse pointer), rather than just crashing upowerd
syslog didn't log an obvious cause:
<http://paste.ubuntu.com/12998627/>
Subsequently, it seemed to be OK (I've tried once).

On the first occasion (when it crashed), my iPhone power was so depleted it had shut down.
The log shows Ubuntu couldn't mount the iPhone's drive and couldn't connect to the iPhones network drivers.
This is the only difference I can think of that might explain the freeze (?) other than that Ubuntu was also pending a restart following a software update. Whereas the subsequent time, it had had the restart.

I'll add to this post if it freezes again. Otherwise, thank you for solving this for me (us?).

Bob Briscoe (m-bob-q) wrote :

Scrub that. Actually it's not solved (for me).
upowerd still crashes when I connect my iPhone. It's just that Ubuntu doesn't complain that it has, but I hadn't checked whether the process was still running - it isn't. Also in syslog there's the following error:

upowerd[10490]: segfault at 3730 ip 00007fe93b16ff8e sp 00007ffd73132880 error 4 in libimobiledevice.so.4.0.1[7fe93b168000+1d000]

Without the iPhone connected, accessing something like the battery history GUI causes dbus-daemon to restart upowerd.
With the iPhone connected, the battery GUI cannot re-start upowerd, so it cannot display the battery history, etc.

Bob Briscoe (m-bob-q) wrote :

Now it's gone back to how it was, with Ubuntu also throwing up an error window asking if I want to report the segfault. Don't know why that didn't happen the last couple of times even tho the segfault was in syslog.

Summary: libimobiledevice-utils has made no difference to this fault for me. I shall uninstall.

bdped (bdped) wrote :

after upgrading from 15.04 to 15.10 I get the same error when I connect my iPhone (5s) to any usb-port of my x220. only the iphone is causing this and the iphone is "locked" (does not connect to anything via usb).
worked fine under 15.04

Erik Auerswald (auerswal) wrote :

For what it is worth, since the powers that be have deemed the bug "fixed"...

iPhone handling on Ubuntu 14.04 LTS is quite broken. You plug in an iPhone, upowerd crashes. You plug it out, then back in, and you get an error message that the iPhone is already mounted. You unplug the iPhone, reboot, and upowerd crashes. Not nice. :-(

The patch from comment #7 is obviously correct. It has been accepted upstream. It is very small. Pretty please with sugar on top, backport this fix (i.e. just apply the patch and rebuild the package!) for 14.04LTS.

Thanks.

Gregory Dearth (gregorydearth) wrote :

Well, it looks like this was hashed out rather well. But as a noob that does a little xterm here and there, how does one apply the patch in comment 7?

0001-upowerd-Fix-cleanup-in-up_device_idevice_coldplug-fi.patch

Looks like a program. Am I supposed to copy paste it into a particular file to fix the issue? What file, where, and at what line?

My issue appeared after messing with my ipad for the first time in ubuntu. Plugged it in, would not mount, so I added some libs per another thread. Then I could indeed mount and unmount it and view the ipad contents. But after getting ubuntu to recognize and read my ipad, I now get the upowerd crash message. I went ahead and did the comment 12 command to add the additional lib.

sudo apt-get install libimobiledevice-utils

I rebooted and no longer get the crash message. Seems fine. Still curious on whether or not I need to apply said patch and how to do that if I need to.

Guilherme (gdnt) wrote :

It seems I'm being affected by this. How can I confirm? I'm using Xubuntu 15.10 on a Dell Inspiron 7348 and every time I connect my iPhone the power manager crashes.

Gumuiyul (gumuiyul) wrote :

I have same problem with Ubuntu-Gnome 15.10 64bit.
Not upgrading but installation.

Gumuiyul (gumuiyul) wrote :

I'm using ubuntu-gnome 15.10 on PC Machine with Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz

Simon West (d-simon-e) wrote :

This is still affecting me on 14.04LTS latest updates to 29/01/2016. Yes it's minor but as this is marked "Fix released" when will it be available?

Rich Fiekowsky (raf55) wrote :

Seems to be the same problem for me.
Running 14.04, up-to-date as of Mar 4 2016.
It started happening when I upgraded from iPhone4 running iOS 7 to iPhone5c with iOS 9.2 .
Noticed another change : iPhone4 used to mount at two different mount points - one had the applications as folders - I think it was named "Documents" - that one no longer appears in Nautilus. The "Username's iPhone" mount point still appears, and works well.
TIA!

Gumuiyul (gumuiyul) wrote :
Steve Arnold (nerdboy) wrote :

Had to find my beaglebone and LTS card, but I went ahead and back-ported the patch to upower_0.9.23 (and did my best to follow the gist of the deb/ubuntu packaging stuff). Attached are the packages.

Steve Arnold (nerdboy) wrote :

Package 2.

Steve Arnold (nerdboy) wrote :

Package 3.

Steve Arnold (nerdboy) wrote :

Package 4.

Steve Arnold (nerdboy) wrote :

Docs package.

Steve Arnold (nerdboy) wrote :

Okay, I decided to go ahead and create a couple of ppas and this seems a bit better than attaching a bunch of bin pkgs: https://launchpad.net/~nerdboy

The fix for this is in the despktop package ppa but it looks like only x86/x86_64 packages are built (even though I did the deb pkg updates on ARM) so you'll probably need to build from source package unless I can find a way to make it build armhf. Using apt-get source and dpkg-deb --build on the ppa source should work...

To post a comment you must log in.