Bug 1663192

Summary: PackageKit often dumps core on install
Product: Red Hat Enterprise Linux 8 Reporter: Katerina Koukiou <kkoukiou>
Component: PackageKitAssignee: Richard Hughes <rhughes>
Status: CLOSED WORKSFORME QA Contact: Desktop QE <desktop-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.0CC: bmilar, jkoten, klember, mpitt, tpelka
Target Milestone: rc   
Target Release: 8.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-01 06:53:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Katerina Koukiou 2019-01-03 12:01:08 UTC
Description of problem:
On latest RHEL 8 image (virt-install from nightly compose), PackageKit started dumping core when installing package that was just removed.

Version-Release number of selected component (if applicable):
PackageKit-1.1.12-2.el8.x86_64

How reproducible:
100%

Steps to Reproduce:

(app-1 is a dummy package we use for testing)

1: Install a package with pkcon

[root@localhost ~]# pkcon install app-1
Resolving                     [=========================]         
Finished                      [                         ] (0%)  
The following packages have to be installed:
 app-1-1.0-1.noarch	dummy app-1
Proceed with changes? [N/y] y

                              [=========================]         
Testing changes               [=========================]         
Installing                    [=========================]         
Installing packages           [=========================]         
Finished                      [=========================]         

2: Remove the package that was just installed

[root@localhost ~]# pkcon -y remove app-1
Resolving                     [=========================]         
Removing                      [=========================]         
Querying                      [=========================]         
Requesting data               [=========================]         
Finished                      [=========================]         


3: Try to install it again

[root@localhost ~]# pkcon install app-1
Resolving                     [=========================]

Here it's crashing, and from the journal we can see the Stack Trace pasted in bellow.

Actual results:
Core dumped

Expected results:
Installation successful


Additional info:
Log from journal:

systemd[1]: Started PackageKit Daemon.
PackageKit[2663]: uid 0 is trying to obtain org.freedesktop.packagekit.system-sources-refresh auth (only_trusted:0)
PackageKit[2663]: uid 0 obtained auth for org.freedesktop.packagekit.system-sources-refresh
dbus-daemon[732]: [system] Activating service name='com.redhat.SubscriptionManager' requested by ':1.88' (uid=0 pid=2708 comm="/usr/li>
dbus-daemon[732]: [system] Successfully activated service 'com.redhat.SubscriptionManager'
kernel: audit: type=1107 audit(1546514278.530:4): pid=732 uid=81 auid=4294967295 ses=4294967295 subj=system_u:system_r:system_dbusd_t:>
         exe="/usr/bin/dbus-daemon" sauid=81 hostname=? addr=? terminal=?'
PackageKit[2663]: refresh-cache transaction /2_caaccacb from uid 0 finished with success after 917ms
PackageKit[2663]: resolve transaction /3_cecaeabb from uid 0 finished with success after 26ms
PackageKit[2663]: uid 0 is trying to obtain org.freedesktop.packagekit.package-install auth (only_trusted:1)
PackageKit[2663]: new install-packages transaction /4_dcdabccd scheduled from uid 0
PackageKit[2663]: uid 0 obtained auth for org.freedesktop.packagekit.package-install
PackageKit[2663]: install-packages transaction /4_dcdabccd from uid 0 finished with need-untrusted after 52ms
PackageKit[2663]: uid 0 is trying to obtain org.freedesktop.packagekit.package-install-untrusted auth (only_trusted:0)
PackageKit[2663]: new install-packages transaction /5_debadcdb scheduled from uid 0
PackageKit[2663]: uid 0 obtained auth for org.freedesktop.packagekit.package-install-untrusted
PackageKit[2663]: in /5_debadcdb for install-packages package appstream-data-test;1.0-1;noarch;updates was installing for uid 0
PackageKit[2663]: install-packages transaction /5_debadcdb from uid 0 finished with success after 1108ms
PackageKit[2663]: resolve transaction /6_ddbcbcba from uid 0 finished with success after 151ms
PackageKit[2663]: uid 0 is trying to obtain org.freedesktop.packagekit.package-install-untrusted auth (only_trusted:0)
PackageKit[2663]: new install-packages transaction /7_dccccbba scheduled from uid 0
PackageKit[2663]: uid 0 obtained auth for org.freedesktop.packagekit.package-install-untrusted
PackageKit[2663]: in /7_dccccbba for install-packages package app-1;1.0-1;noarch;updates was installing for uid 0
PackageKit[2663]: install-packages transaction /7_dccccbba from uid 0 finished with success after 668ms
PackageKit[2663]: search-file transaction /8_ebaaeccb from uid 0 finished with success after 172ms
packagekitd[2663]: free(): invalid pointer
systemd[1]: Created slice system-systemd\x2dcoredump.slice.
systemd[1]: Started Process Core Dump (PID 3547/UID 0).
systemd[1]: packagekit.service: Main process exited, code=dumped, status=6/ABRT
systemd[1]: packagekit.service: Failed with result 'core-dump'.
systemd-coredump[3548]: Process 2663 (packagekitd) of user 0 dumped core.
                        
                        Stack trace of thread 2663:
                        #0  0x00007f435bc8d93f raise (libc.so.6)
                        #1  0x00007f435bc77c95 abort (libc.so.6)
                        #2  0x00007f435bcd0d57 __libc_message (libc.so.6)
                        #3  0x00007f435bcd768c malloc_printerr (libc.so.6)
                        #4  0x00007f435bcd8e84 _int_free (libc.so.6)
                        #5  0x00007f435c748442 g_free (libglib-2.0.so.0)
                        #6  0x00007f435c714b83 ptr_array_free (libglib-2.0.so.0)
                        #7  0x00007f43497be403 _ZL24dnf_transaction_finalizeP8_GObject (libdnf.so.2)
                        #8  0x00007f435ca21f49 g_object_unref (libgobject-2.0.so.0)
                        #9  0x00007f4349f697fd pk_backend_stop_job (libpk_backend_dnf.so)
                        #10 0x0000556a33cd9cbf pk_transaction_finished_cb (packagekitd)
                        #11 0x0000556a33ce61ca pk_backend_job_call_vfunc_idle_cb (packagekitd)
                        #12 0x00007f435c73f14b g_idle_dispatch (libglib-2.0.so.0)
                        #13 0x00007f435c74281d g_main_context_dispatch (libglib-2.0.so.0)
                        #14 0x00007f435c742be8 g_main_context_iterate.isra.21 (libglib-2.0.so.0)
                        #15 0x00007f435c742f12 g_main_loop_run (libglib-2.0.so.0)
                        #16 0x0000556a33cd4629 main (packagekitd)
                        #17 0x00007f435bc79813 __libc_start_main (libc.so.6)
                        #18 0x0000556a33cd48de _start (packagekitd)
                        
                        Stack trace of thread 2672:
                        #0  0x00007f435bd4d2bd syscall (libc.so.6)
                        #1  0x00007f435c78964e g_cond_wait_until (libglib-2.0.so.0)
                        #2  0x00007f435c715071 g_async_queue_pop_intern_unlocked (libglib-2.0.so.0)
                        #3  0x00007f435c76b9d2 g_thread_pool_thread_proxy (libglib-2.0.so.0)
                        #4  0x00007f435c76ae8a g_thread_proxy (libglib-2.0.so.0)
                        #5  0x00007f435c0222de start_thread (libpthread.so.0)
                        #6  0x00007f435bd52a63 __clone (libc.so.6)
                        
                        Stack trace of thread 2668:
                        #0  0x00007f435bd477e1 __poll (libc.so.6)
                        #1  0x00007f435c742b56 g_main_context_iterate.isra.21 (libglib-2.0.so.0)
                        #2  0x00007f435c742c80 g_main_context_iteration (libglib-2.0.so.0)
                        #3  0x00007f435c742cd1 glib_worker_main (libglib-2.0.so.0)
                        #4  0x00007f435c76ae8a g_thread_proxy (libglib-2.0.so.0)
                        #5  0x00007f435c0222de start_thread (libpthread.so.0)
                        #6  0x00007f435bd52a63 __clone (libc.so.6)
                        
                        Stack trace of thread 2669:
                        #0  0x00007f435bd477e1 __poll (libc.so.6)
                        #1  0x00007f435c742b56 g_main_context_iterate.isra.21 (libglib-2.0.so.0)
                        #2  0x00007f435c742f12 g_main_loop_run (libglib-2.0.so.0)
                        #3  0x00007f435cd3270a gdbus_shared_thread_func (libgio-2.0.so.0)
                        #4  0x00007f435c76ae8a g_thread_proxy (libglib-2.0.so.0)
                        #5  0x00007f435c0222de start_thread (libpthread.so.0)
                        #6  0x00007f435bd52a63 __clone (libc.so.6)

Comment 1 Kalev Lember 2019-01-03 12:52:08 UTC
Could you get a backtrace with glib2, libdnf and PackageKit debuginfo installed, please?

'dnf debuginfo-install glib2 libdnf PackageKit' and then 'coredumpctl gdb packagekitd' followed by 't a a bt full'

Comment 5 Martin Pitt 2019-05-01 06:53:24 UTC
We haven't seen this since end of January any more, so I'm closing this for now.