Bug 775651

Summary: packagekitd crashes when installing EULA packages
Product: [openSUSE] openSUSE 12.2 Reporter: Will Stephenson <wstephenson>
Component: GNOMEAssignee: E-mail List <gnome-bugs>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: dimstar, glin, ismail, meissner, mlin
Version: RC 2   
Target Milestone: ---   
Hardware: Other   
OS: openSUSE 12.2   
See Also: https://bugs.freedesktop.org/show_bug.cgi?id=53532
Whiteboard:
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: packagekitd --verbose output
patch to ignore "accept-eula" in pk-transaction-run

Description Will Stephenson 2012-08-13 08:59:39 UTC
libzypp-11.6.2-2.1.2.x86_64 * Fri Jun 08 2012 ma@suse.de
PackageKit-0.7.4-2.7.1.x86_64 * Wed Jul 18 2012 dimstar@opensuse.org

While trying to install a package with a EULA, packagekitd crashes.  gnome-packagekit and Apper are also affected.  Packages without EULA install normally.

linux-a7oe:~ # pkcon install flash-player
Simulating install            [=========================]         
Waiting in queue              [=========================]         
Starting                      [=========================]         
Refreshing software list      [=========================]         
Querying                      [=========================]         
Resolving dependencies        [=========================]         
Installing packages           [=========================]         
The following packages have to be installed:
 flash-player-11.2.202.236-2.1.3.i586   Adobe Flash Plugin and Standalone Player

Proceed with changes? [N/y] y

                              [=========================]         
Installing                    [=========================]         
Waiting in queue              [=========================]         
Waiting for authentication    [=========================]         
Waiting in queue              [=========================]         
Starting                      [=========================]         
Refreshing software list      [=========================]         
Querying                      [=========================]         
Resolving dependencies        [=========================]         
Installing packages           [                         ] (0%)  
End user licence agreement required
 Package: flash-player-11.2.202.236-2.1.3.i586
 Vendor: openSUSE
 Agreement: ADOBE SYSTEMS INCORPORATED
Personal Computer Software License Agreement


PlatformClients_PC_WWEULA-en_US-20100108_1657
Do you accept this agreement? [N/y] y

                              [=========================]         
Accepting EULA                [=========================]         
Waiting in queue              [=========================]         
Waiting for authentication    [=========================]         
Waiting in queue              [=========================]         
Installing                    [                         ] (0%)  The daemon crashed mid-transaction!
Comment 1 Will Stephenson 2012-08-14 10:23:36 UTC
Created attachment 502235 [details]
packagekitd --verbose output

It's erroring out because pk_run_transaction doesn't handle accept-role transactions in our version.
This error is set at pk-transaction.c line 2429, see below:

03:46:48        PackageKit          setting transaction role to accept-eula
03:46:48        PackageKit          setting role to accept-eula
03:46:48        PackageKit          setting role for /28_aaaeaecd_data to accept-eula
03:46:48        PackageKit          no plugins provided pk_plugin_transaction_started
03:46:48        PackageKit          emitting changed

(packagekitd:19287): PackageKit-ERROR **: failed to run as role not assigned

Program received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffff6c46541 in g_logv () from /usr/lib64/libglib-2.0.so.0
Missing separate debuginfos, use: zypper install cyrus-sasl-debuginfo-2.1.25-21.1.1.x86_64 glibc-debuginfo-2.15-22.6.1.x86_64 gvfs-debuginfo-1.12.3-3.1.1.x86_64 krb5-debuginfo-1.10.2-3.4.1.x86_64 libacl1-debuginfo-2.2.51-8.1.2.x86_64 libarchive2-debuginfo-2.8.5-5.1.1.x86_64 libattr1-debuginfo-2.4.46-9.1.2.x86_64 libbluray1-debuginfo-0.2.2-2.1.1.x86_64 libbz2-1-debuginfo-1.0.6-20.1.4.x86_64 libcap2-debuginfo-2.22-5.1.1.x86_64 libcom_err2-debuginfo-1.42.4-2.1.1.x86_64 libcurl4-debuginfo-7.25.0-2.1.1.x86_64 libdbus-1-3-debuginfo-1.5.12-4.1.1.x86_64 libelf1-debuginfo-0.153-2.1.4.x86_64 libexpat1-debuginfo-2.1.0-2.1.2.x86_64 libfam0-debuginfo-2.7.0-159.1.2.x86_64 libffi46-debuginfo-4.6.2_20111026-1.1.2.x86_64 libgcc46-debuginfo-4.6.2_20111026-1.1.4.x86_64 libgio-2_0-0-debuginfo-2.32.3-4.1.1.x86_64 libglib-2_0-0-debuginfo-2.32.3-4.1.1.x86_64 libgmodule-2_0-0-debuginfo-2.32.3-4.1.1.x86_64 libgobject-2_0-0-debuginfo-2.32.3-4.1.1.x86_64 libgvfscommon0-debuginfo-1.12.3-3.1.1.x86_64 libicu49-debuginfo-49.1-2.1.1.x86_64 libidn-debuginfo-1.25-2.1.1.x86_64 libjavascriptcoregtk-3_0-0-debuginfo-1.8.1-2.2.1.x86_64 libkdecore4-debuginfo-4.8.4-2.2.1.x86_64 libkeyutils1-debuginfo-1.5.3-7.1.1.x86_64 libldap-2_4-2-debuginfo-2.4.31-2.1.2.x86_64 liblua5_1-debuginfo-5.1.4-20.1.3.x86_64 liblzma5-debuginfo-5.0.3-12.2.1.x86_64 libmodman1-debuginfo-2.0.1-9.1.1.x86_64 libopenssl1_0_0-debuginfo-1.0.1c-2.1.2.x86_64 libpackagekit-glib2-14-debuginfo-0.7.4-2.2.1.x86_64 libpcre1-debuginfo-8.30-3.1.1.x86_64 libpolkit0-debuginfo-0.104-6.1.1.x86_64 libpopt0-debuginfo-1.16-14.1.1.x86_64 libproxy1-config-gnome3-debuginfo-0.4.7-14.1.1.x86_64 libproxy1-config-kde4-debuginfo-0.4.7-14.1.1.x86_64 libproxy1-debuginfo-0.4.7-14.1.1.x86_64 libproxy1-networkmanager-debuginfo-0.4.7-14.1.1.x86_64 libproxy1-pacrunner-webkit-debuginfo-0.4.7-14.1.1.x86_64 libqt4-debuginfo-4.8.1-2.1.1.x86_64 libselinux1-debuginfo-2.0.91-19.1.8.x86_64 libsqlite3-0-debuginfo-3.7.12.1-2.1.1.x86_64 libssh2-1-debuginfo-1.4.0-4.1.1.x86_64 libstdc++46-debuginfo-4.6.2_20111026-1.1.4.x86_64 libudev0-debuginfo-182-4.15.1.x86_64 libxml2-2-debuginfo-2.7.8+git20120223-8.4.1.x86_64 libzypp-debuginfo-11.6.2-2.1.2.x86_64 rpm-debuginfo-4.9.1.2-18.2.1.x86_64 zlib-debuginfo-1.2.7-2.1.1.x86_64
(gdb) bt
#0  0x00007ffff6c46541 in g_logv () from /usr/lib64/libglib-2.0.so.0
#1  0x00007ffff6c466d2 in g_log () from /usr/lib64/libglib-2.0.so.0
#2  0x0000000000417147 in pk_transaction_run (transaction=0x6fc7c0) at pk-transaction.c:2429
#3  0x00000000004309a6 in pk_transaction_list_run_idle_cb (item=0x712040) at pk-transaction-list.c:288
#4  0x00007ffff6c3f405 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#5  0x00007ffff6c3f738 in ?? () from /usr/lib64/libglib-2.0.so.0
#6  0x00007ffff6c3fb32 in g_main_loop_run () from /usr/lib64/libglib-2.0.so.0
#7  0x000000000040e54f in main (argc=1, argv=0x7fffffffe3f8) at pk-main.c:283
(gdb) GG
Comment 2 Gary Ching-Pang Lin 2012-08-15 07:32:36 UTC
I think the code trace in comment#1 is different from the original description, i.e. there are 2 places that could crash packagekitd.

As for "Accept-Eula" transaction, I think it's a race condition. "Accept-Eula" is supposed to be finished right after the DBus method, "AcceptEula", is done, but the translation list callback was called before the finish callback. We probably could avoid this by ignoring "Accept-Eula" in pk_transaction_run().
Comment 3 Gary Ching-Pang Lin 2012-08-15 08:43:43 UTC
Created attachment 502362 [details]
patch to ignore "accept-eula" in pk-transaction-run
Comment 4 Ismail Dönmez 2012-08-22 10:04:09 UTC
Patch merged for 12.2. Gary please send an SR to Factory too if you already didn't.
Comment 5 Gary Ching-Pang Lin 2012-08-23 02:13:48 UTC
Submitted the patch to GNOME:Factory. sr id 131386
Comment 6 Bernhard Wiedemann 2012-08-23 20:00:08 UTC
This is an autogenerated message for OBS integration:
This bug (775651) was mentioned in
https://build.opensuse.org/request/show/131451 Factory / PackageKit
Comment 7 Dominique Leuenberger 2012-09-05 21:12:11 UTC
Is there anything left on this bug to be done? This was merged into Factory and 12.2 release... so from where I stand, with the info presented here, this seems completed.
Comment 8 Gary Ching-Pang Lin 2012-09-06 02:32:19 UTC
Close this bug since the patch was checked-in