Bug 16991 - Packagekit-Applications (gpk-*) doesn't work with having libtrash installed
Summary: Packagekit-Applications (gpk-*) doesn't work with having libtrash installed
Alias: None
Product: PackageKit
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium blocker
Assignee: Richard Hughes
QA Contact:
Depends on:
Reported: 2008-08-05 04:04 UTC by Michael Schönitzer
Modified: 2008-08-06 04:51 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:

Output of strace when running gpk-update-viewer (31.86 KB, text/plain)
2008-08-05 04:04 UTC, Michael Schönitzer
Output of ltrace when running gpk-update-viewer (1.11 KB, text/plain)
2008-08-05 04:05 UTC, Michael Schönitzer

Description Michael Schönitzer 2008-08-05 04:04:18 UTC
Created attachment 18136 [details]
Output of strace when running gpk-update-viewer


When Packagekit doesn't work on my system, I searched for the reason and found it:
PackageKit doesn't work when libtrash is installed (and running) an a system. Libtrash is an popular application, preventing the user form deleting files irreversible. It ca be found here: http://pages.stern.nyu.edu/~marriaga/software/libtrash/
For getting libtrash work, you need to add the following line to the .bashrc-file:
   export LD_PRELOAD=/usr/local/lib/libtrash.so

But having this line in your .bashrc will inhibit Packagekit from running. Libtrash has also an option to disable libtrash temporarily, doing "export TRASH_OFF=YES". This works fine for other applications having problems with libtrash - but it doesn't change anything with Packagekit. The only possibility, to get Packagekit working it to remove upon line form .bashrc and restart the X-Server (or log-out & -in completely new?).

When libtrash is enabled and I'm running Packagekit, I'm getting a segmentation fault.
The strace an ltrace are attached.
Comment 1 Michael Schönitzer 2008-08-05 04:05:20 UTC
Created attachment 18137 [details]
Output of ltrace when running gpk-update-viewer
Comment 2 Michael Schönitzer 2008-08-05 04:11:39 UTC
Cause Libtrash is very popular and very, very usefull when working on the bash, I hope you can fix this bug in near future.

My System:
Fedora 9
libtrash 3.0
packagekit 2.3-6 installed by yum
gnome-packagekit 0.2.3-9. installed by yum

Best regards,
Michael Schönitzer
Comment 3 Richard Hughes 2008-08-05 04:47:58 UTC
Does it stop packagekitd or gpk-update-viewer from running? If it's the latter,
can you grab a backtrace using gdb after installing the needed debuginfo's.
Comment 4 Michael Schönitzer 2008-08-05 06:51:29 UTC
(In reply to comment #3)
> Does it stop packagekitd or gpk-update-viewer from running? If it's the latter,
> can you grab a backtrace using gdb after installing the needed debuginfo's.
> Thanks.
It stops all gpk-*-applications.
I've installed all the debuginfos:
$ debuginfo-install GConf2.i386 ORBit2.i386 PackageKit.i386 PolicyKit-gnome.i386 PolicyKit.i386 atk.i386 cairo.i386 dbus-glib.i386 dbus.i386 expat.i386 fontconfig.i386 freetype-freeworld.i386 glib2.i386 glibc.i686 gtk2.i386 libX11.i386 libXau.i386 libXcomposite.i386 libXcursor.i386 libXdmcp.i386 libXext.i386 libXfixes.i386 libXi.i386 libXinerama.i386 libXrandr.i386 libXrender.i386 libcap.i386 libglade2.i386 libnotify.i386 libpng.i386 libselinux.i386 libxcb.i386 libxml2.i386 pango.i386 pixman.i386 sqlite.i386 unique.i386 zlib.i386 gtk2.i386

Then I did:
$ gdb gpk-update-viewer
GNU gdb Fedora (6.8-12.fc9)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...
(gdb) run --verbose
Starting program: /usr/bin/gpk-update-viewer --verbose
[Thread debugging using libthread_db enabled]
[New Thread 0xb7f64710 (LWP 17788)]

Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) quit
The program is running.  Exit anyway? (y or n) y
[michi|15:50:34 ~ ]$

That's all what I got!? What shall I do?
Comment 5 Richard Hughes 2008-08-06 02:16:08 UTC
Okay, this is showing that gpk-application is segfaulting as soon as it calls into the libpackagekit library. There's something wrong with libtrash I think, as I can reproduce using:

export LD_PRELOAD="/home/hughsie/Code/libtrash-3.2/src/libtrash.so.3.2"
gpk-appication --verbose

(gdb) bt
#0  0x00000000 in ?? ()
#1  0x00000001 in ?? ()
#2  0x00000720 in ?? ()
#3  0x0055abac in pk_package_list_new () at pk-package-list.c:563
#4  0x08050d8d in gpk_application_init (application=0x848c020) at gpk-application.c:2588
#5  0x00a484e3 in IA__g_type_create_instance (type=<value optimized out>) at gtype.c:1575
#6  0x00a2d8a5 in g_object_constructor (type=<value optimized out>, n_construct_properties=<value optimized out>, construct_params=<value optimized out>) at gobject.c:1046
#7  0x00a2e0de in IA__g_object_newv (object_type=<value optimized out>, n_parameters=<value optimized out>, parameters=<value optimized out>) at gobject.c:937
#8  0x00a2eca7 in IA__g_object_new_valist (object_type=<value optimized out>, first_property_name=<value optimized out>, var_args=<value optimized out>) at gobject.c:986
#9  0x00a2ee1e in IA__g_object_new (object_type=<value optimized out>, first_property_name=Could not find the frame base for "IA__g_object_new".
) at gobject.c:795
#10 0x0804e84e in gpk_application_new () at gpk-application.c:3135
#11 0x0804e51d in main (argc=1, argv=0xbfbb6634) at gpk-application-main.c:123

I can't debug this any further, so maybe cc'ing in the libttrash author would help. gnome-packagekit doesn't do anything funcky with loading libraries, it's a pretty much standard GTK application. I don't know how to debug this, sorry.
Comment 6 Richard Hughes 2008-08-06 04:51:02 UTC
Okay, I've been playing with ld during lunch and it seems that libtrash can be used if libpackagekit is compiled with -export-dynamic. I've made this change in master and 0.2.x -- so this will be fixed when I release 0.2.5 which should be in about three weeks time. Not using -export-dynamic also exposes a bug in gnome-packagekit, which I've also fixed.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.