Bug 662047

Summary: troubleshooter uses D-Bus from two threads
Product: [Fedora] Fedora Reporter: Jiri Popelka <jpopelka>
Component: system-config-printerAssignee: Tim Waugh <twaugh>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 14CC: jpopelka, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:984c54d958369a27389cadefd911db72de27c7e8
Fixed In Version: system-config-printer-1.2.7-2.fc13 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-02-07 20:00:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
File: backtrace
none
another backtrace none

Description Jiri Popelka 2010-12-10 12:27:51 UTC
abrt version: 1.1.14
architecture: x86_64
Attached file: backtrace
cmdline: /usr/bin/python /usr/share/system-config-printer/system-config-printer.py --debug
component: system-config-printer
crash_function: remove_entry
executable: /usr/bin/python
kernel: 2.6.35.9-64.fc14.x86_64
package: system-config-printer-1.2.5-6.fc14
rating: 4
reason: Process /usr/bin/python was killed by signal 11 (SIGSEGV)
release: Fedora release 14 (Laughlin)
time: 1291982895
uid: 500

comment
-----
system-config-printer-1.2.5-6.fc14.x86_64 or system-config-printer-1.2.4-2.fc14.x86_64
cups-1.4.4-11.fc14.x86_64 or cups-1.4.5-1.fc14.x86_64
cups-pk-helper-0.0.4-13.fc14.x86_64
polkit-0.98-4.fc14.x86_64
polkit-kde-0.95.1-6.fc14.x86_64
polkit-qt-0.96.1-4.fc14.x86_64

How to reproduce
-----
1. in troubleshooter evoke some action that requires authentication, like choosing printer and pressing Forward or enabling debug

No PolicyKit1 dialog appears and s-c-p crashes. The last few lines usually are:
Authentication pass: 1
Authentication: password callback set
Segmentation fault (core dumped)

Once I saw this instead of the crash:
ERROR:dbus.connection:Unable to set arguments (0, 0, [], []) according to signature u'iss': <type 'exceptions.TypeError'>: Expected a string or unicode object
DevicesGet API exception; using old signature
PolicyKit call to DevicesGet did not work: PolicyKit communication issue

Comment 1 Jiri Popelka 2010-12-10 12:27:53 UTC
Created attachment 467963 [details]
File: backtrace

Comment 2 Tim Waugh 2010-12-10 12:39:58 UTC
Looks like maybe threads 2 and 3 are both using D-Bus at the same time?  Probably the troubleshooter needs to be using the newer asyncconn module for asynchronous calling instead of timeops.

Comment 3 Jiri Popelka 2010-12-13 13:35:04 UTC
Created attachment 468371 [details]
another backtrace

Comment 4 Tim Waugh 2010-12-13 13:53:56 UTC
In this one, threads 1 and 2 are both using D-Bus at the same time.

One work-around would be to change AuthConnFactory so that it creates a cups.Connection instead of an authconn.Connection -- although the side effect would be that authentication would always be denied.  An alternative would be to adjust authconn.Connection so that the caller can prevent the underlying object being a cupspk.Connection (which uses D-Bus).

The real fix would be to use the proper asynchronous calling interface, asyncconn.

Comment 5 Tim Waugh 2010-12-16 14:36:49 UTC
Should be fixed by this commit actually:

commit 7480e83f04ec73cc1cccbefae440c26b1ba5c5a4
Author: Tim Waugh <twaugh@redhat.com>
Date:   Thu Dec 16 14:31:04 2010 +0000

    Initialise D-Bus threading in timedops module (bug #662047).
    
    Initialise threading for D-Bus.  This is needed as long as it is
    used from two separate threads.  We only do this in a few places
    now, but in particular the troubleshooter does this.

Comment 6 Fedora Update System 2011-01-17 17:39:50 UTC
system-config-printer-1.2.6-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/system-config-printer-1.2.6-1.fc14

Comment 7 Fedora Update System 2011-01-17 17:40:21 UTC
system-config-printer-1.2.6-1.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/system-config-printer-1.2.6-1.fc13

Comment 8 Fedora Update System 2011-01-18 21:28:54 UTC
system-config-printer-1.2.6-2.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update system-config-printer'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/system-config-printer-1.2.6-2.fc13

Comment 9 Fedora Update System 2011-02-07 20:00:06 UTC
system-config-printer-1.2.6-3.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2011-03-15 21:55:18 UTC
system-config-printer-1.2.7-2.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.