Bug 685831

Summary: zypp: occasional crashes of packagekitd
Product: [openSUSE] openSUSE 11.4 Reporter: Stanislav Brabec <sbrabec>
Component: BasesystemAssignee: E-mail List <zypp-maintainers>
Status: VERIFIED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Critical    
Priority: P2 - High CC: carlos.e.r, dmacvicar, forgotten_--EoyBps8f, heiko.rommel, linux, lnussel, meissner
Version: Final   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard: maint:released:11.4:41044
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Deadline: 2011-05-26   

Description Stanislav Brabec 2011-04-07 11:32:00 UTC
packagekitd occasionally crashes.

How often it happens: Happened 3 times since installation of 11.4 on one of my machines.

Attaching backtrace from one of core dumps. I am not aware of anything special done in that time.

This is in syslog:
Mar 21 14:31:18 oct kernel: [256761.761708] packagekitd[25577] general protection ip:7f85725abfb8 sp:7f856d8355f0 error:0 in libpk_backend_zypp.so[7f8572574000+43000]

Nothing in zypper.log

I am running GNOME desktop.

Backtrace:

Core was generated by `/usr/lib/packagekitd'.
Program terminated with signal 11, Segmentation fault.
#0  Solvable (backend=<value optimized out>) at /usr/include/zypp/sat/Solvable.h:59
	in /usr/include/zypp/sat/Solvable.h

Thread 3 (Thread 25574):
#0  0x00007f85748f2503 in __poll (fds=<value optimized out>, nfds=<value optimized out>, timeout=<value optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007f8574bdb114 in g_main_context_poll (context=0x6621e0, block=1, dispatch=1, self=<value optimized out>) at gmain.c:3404
#2  g_main_context_iterate (context=0x6621e0, block=1, dispatch=1, self=<value optimized out>) at gmain.c:3086
#3  0x00007f8574bdba35 in g_main_loop_run (loop=0x6ce7f0) at gmain.c:3299
#4  0x000000000040f975 in main (argc=1, argv=0x7fffb40b8f38) at pk-main.c:352

Thread 2 (Thread 25576):
#0  0x00007f85748f2503 in __poll (fds=<value optimized out>, nfds=<value optimized out>, timeout=<value optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007f8574bdb114 in g_main_context_poll (context=0x6e3820, block=1, dispatch=1, self=<value optimized out>) at gmain.c:3404
#2  g_main_context_iterate (context=0x6e3820, block=1, dispatch=1, self=<value optimized out>) at gmain.c:3086
#3  0x00007f8574bdba35 in g_main_loop_run (loop=0x6e3800) at gmain.c:3299
#4  0x00007f857559a244 in gdbus_shared_thread_func (data=<value optimized out>) at gdbusprivate.c:276
#5  0x00007f8574c02466 in g_thread_create_proxy (data=0x6e3900) at gthread.c:1897
#6  0x00007f8575ccaa3f in start_thread (arg=0x7f856e037700) at pthread_create.c:297
#7  0x00007f85748fb67d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#8  0x0000000000000000 in ?? ()

Thread 1 (Thread 25577):
#0  Solvable (backend=<value optimized out>) at /usr/include/zypp/sat/Solvable.h:59
#1  zypp_get_updates (backend=<value optimized out>) at zypp-utils.cpp:796
#2  0x00007f8572593428 in backend_get_updates_thread (backend=0x668010) at pk-backend-zypp.cpp:715
#3  0x00000000004266d2 in pk_backend_thread_setup (thread_data=<value optimized out>) at pk-backend.c:2445
#4  0x00007f8574c02466 in g_thread_create_proxy (data=0x722800) at gthread.c:1897
#5  0x00007f8575ccaa3f in start_thread (arg=0x7f856d836700) at pthread_create.c:297
#6  0x00007f85748fb67d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#7  0x0000000000000000 in ?? ()
Comment 1 Duncan Mac-Vicar 2011-04-27 10:03:40 UTC
I just fixed this crash. This deserves an online update.
Comment 2 Duncan Mac-Vicar 2011-04-27 10:25:17 UTC
created request id 68513

home:dmacvicar:branches:openSUSE:11.4:Update:Test/PackageKit
Comment 3 Bernhard Wiedemann 2011-04-27 11:00:12 UTC
This is an autogenerated message for OBS integration:
This bug (685831) was mentioned in
https://build.opensuse.org/request/show/68513
Comment 4 Christian Dengler 2011-04-27 11:27:41 UTC
As it is a softwaremgmt update, I think we should collect more zypper, libzypp and Packagekit bugs and then start a bundled update. For the moment: -1
Comment 5 Stanislav Brabec 2011-04-27 12:45:49 UTC
I do not agree. This bug is triggered by attempt to call e. g. GNOME updat tool - I see that the GUI tool is checking for updates forever and then update icon disapears, i. e. it blocks all updates for not advanced users.

Update itself may be not as easy as it seems, as the update tool itself crashes. I guess we need not only to update, but we have to find a safe way to update without seing this crash.

(I guess that the GNOME update tool works only if the number of pending updates is very low, say <5. YaST2 online_update works and next day GNOME update tool works as well.)
Comment 6 Marcus Meissner 2011-04-27 12:51:22 UTC
we can of course do it right now. 

but please elaborate, is GNOME updating via the update applet working at all?
or not?
or just failking randomly?
Comment 7 Stanislav Brabec 2011-04-27 13:13:29 UTC
It fails consistently, but only sometimes.

Blindly guessing that it depends on the number of installable updates (and surely depends on updates available on the server and updates installed on the system).

Some day it consistently failed. Then I called YaST2 online_update, installed updates, and next day it worked and was able to install updates.

I did not mention it in the original report, because I found a relation between "GNOME update tool never finishes" and "packagekitd crashes" just today.
Comment 8 Bernhard Wiedemann 2011-04-27 20:00:14 UTC
This is an autogenerated message for OBS integration:
This bug (685831) was mentioned in
https://build.opensuse.org/request/show/68569
Comment 9 Jason Craig 2011-04-27 20:17:48 UTC
I can confirm that this bug is affecting me on KDE as well.  kpackagekit did not report any updates for over a week.  I finally got suspicious and looked with zypper to find that there were indeed updates to be applied.  Once I installed these updates "manually" (with Yast online update), then kpackagekit began to work again.  I saw this bug and now I periodically check dmesg to be sure that kpackagekit isn't getting fooled by the crash.  A couple of days ago the backend was crashing again and I had to do a manual update--which again fixed the crashing.

I don't know what conditions are causing the backend to crash, but it does appear to be blocking all updates by kpackagekit.
Comment 10 Michael Andres 2011-04-28 08:33:09 UTC
(In reply to comment #7)
> Blindly guessing that it depends on the number of installable updates (and
> surely depends on updates available on the server and updates installed on the
> system).

Yes and no, the bug Duncan fixed yesterday is a programming error;  the PKbackend code references temporary objects after they went out of scope.

Thus it's a race between the loop computing the updates and the system reusing the free memory. This is undefined behavior and a crash is probably not the worst case.
Comment 11 Marcus Meissner 2011-04-28 11:11:40 UTC
i would say lets do the update now and hope for the best. +1

it is probably quite impossible to have a always working update scenario here.
Comment 12 Christian Dengler 2011-04-28 15:24:12 UTC
Okay, Update started: SwampID: 40504

Be so kind and submit a patchinfo.
Comment 13 Swamp Workflow Management 2011-04-28 17:26:48 UTC
The SWAMPID for this issue is 40504.
This issue was rated as low.
Please submit fixed packages until 2011-05-26.
Also create a patchinfo file using this link:
https://swamp.suse.de/webswamp/wf/40504
Comment 14 Swamp Workflow Management 2011-04-28 17:26:48 UTC
The SWAMPID for this issue is 40504.
This issue was rated as low.
Please submit fixed packages until 2011-05-26.
Also create a patchinfo file using this link:
https://swamp.suse.de/webswamp/wf/40504
Comment 15 Swamp Workflow Management 2011-04-28 17:27:06 UTC
The SWAMPID for this issue is 40504.
This issue was rated as low.
Please submit fixed packages until 2011-05-26.
Also create a patchinfo file using this link:
https://swamp.suse.de/webswamp/wf/40504
Comment 16 Bernhard Wiedemann 2011-04-29 11:40:44 UTC
This is an autogenerated message for OBS integration:
This bug (685831) was mentioned in
https://build.opensuse.org/request/show/68819
Comment 17 Ludwig Nussel 2011-05-13 13:45:57 UTC
*** Bug 693231 has been marked as a duplicate of this bug. ***
Comment 18 Ludwig Nussel 2011-05-13 13:46:03 UTC
*** Bug 681420 has been marked as a duplicate of this bug. ***
Comment 19 Ludwig Nussel 2011-05-13 14:04:42 UTC
How are users supposed to know that there are updates and how to install them? packagekit reproducibly segfaults here on a fresh install every time. Is there a way to modify the repo data in a way to avoid the segfault so packagekit could at least update itself?
Comment 20 Marcus Meissner 2011-05-16 14:50:46 UTC
according to duncan when using a YOU patch, the crash does not happen.

(perhaps the requirement "just a single YOU patch" thpoiugh?)

nevertheless, we can start.
Comment 21 Guenter Kukkukk 2011-05-21 03:57:24 UTC
(In reply to comment #20)
> according to duncan when using a YOU patch, the crash does not happen.
> 
> (perhaps the requirement "just a single YOU patch" thpoiugh?)
> 
> nevertheless, we can start.

I'm using KDE here.
After initial 11.4 install the KDE "KPackagekit" applet was working when
calling /usr/lib/packagekitd

After some updates had been done (some weeks ago), the packagekitd daemon
started to _always_ (!) segfault when the KDE applet was searching for updates:

May 21 04:48:10 linux300 kernel: [42043.636187] packagekitd[26099]: segfault at b296d00f ip b6f30065 sp b3c31840 error 4 in libzypp.so.810.2.1[b6b5b000+4c2000]

Today- this running box is on the latest update stage from Tumbleweed (21 May 2011):
  - Kernel 2.6.38.6-29-default
  - all other related updates _are_ installed

I did all the updates using zypper inside a konsole.
The segfault still appears!

Cheers, Günter

Btw - it seems to be not related to the number of outstanding updates,
here the segfault is _always_ seen - even with "null" waiting updates.
Comment 22 Duncan Mac-Vicar 2011-05-23 08:36:49 UTC
Thanks Guenter, but we already know that. The point we are focusing right now is if the updater crashes when there is an update marked as "restart suggested" (ie: package manager update), and it looks like it does not.
Comment 25 Swamp Workflow Management 2011-06-07 13:52:17 UTC
Update released for: PackageKit, PackageKit-branding-upstream, PackageKit-browser-plugin, PackageKit-browser-plugin-debuginfo, PackageKit-debuginfo, PackageKit-debugsource, PackageKit-devel, PackageKit-doc, PackageKit-gstreamer-plugin, PackageKit-gstreamer-plugin-debuginfo, PackageKit-gtk-module, PackageKit-gtk-module-debuginfo, PackageKit-gtk3-module, PackageKit-gtk3-module-debuginfo, PackageKit-lang, libpackagekit-glib2-14, libpackagekit-glib2-14-debuginfo, libpackagekit-glib2-devel, libpackagekit-qt-devel, libpackagekit-qt14, libpackagekit-qt14-debuginfo, libpackagekit-qt2-2, libpackagekit-qt2-2-debuginfo, libpackagekit-qt2-devel
Products:
openSUSE 11.4 (debug, i586, x86_64)
Comment 26 Dirk Mueller 2011-06-07 20:14:20 UTC
closing as fixed.