Accessing the keyring in a thread make the program crash (was find_credentials segfaults)
Bug #656545 reported by
Alejandro J. Cura
This bug affects 3 people
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Ubuntu Single Sign On Client | Status tracked in Trunk | |||||
Stable-1-0 |
Fix Released
|
High
|
Alejandro J. Cura | |||
Trunk |
Fix Released
|
High
|
Alejandro J. Cura | |||
ubuntu-sso-client (Ubuntu) |
Fix Released
|
High
|
Natalia Bidart | |||
Maverick |
Fix Released
|
High
|
Natalia Bidart | |||
Natty |
Fix Released
|
High
|
Natalia Bidart |
Bug Description
Calling the find_credentials in the /com/ubuntu/
This is caused by accessing the keyring in a thread using functions that are not thread safe.
This also affects the /credentials service since it access the keyring in a thread to store the credentials.
FIX: initialize glib threads on dbus.mainloop.glib
Minimal patch: see linked branch.
TEST CASE: this bug is very difficult to reproduce since involves some thread weirdness. Matt griffin was able to reproduce on a clean maverick install by logging in successfully into Ubuntu One using ussoc. After login, the process died with no much info.
Related branches
lp://staging/~alecu/ubuntu-sso-client/fix-keyring-thread
- Natalia Bidart (community): Approve
-
Diff: 18 lines (+2/-0)1 file modifiedbin/ubuntu-sso-login (+2/-0)
lp://staging/~alecu/ubuntu-sso-client/fix-keyring-thread-stable-1-0
- Natalia Bidart (community): Approve
-
Diff: 18 lines (+2/-0)1 file modifiedbin/ubuntu-sso-login (+2/-0)
lp://staging/~alecu/ubuntu-sso-client/store-keyring-on-main-thread
- John Lenton (community): Approve
- Natalia Bidart (community): Approve
-
Diff: 109 lines (+28/-11)2 files modifiedubuntu_sso/main.py (+20/-8)
ubuntu_sso/tests/test_main.py (+8/-3)
lp://staging/~alecu/ubuntu-sso-client/use-txsecrets
- dobey (community): Approve
- Natalia Bidart (community): Approve
-
Diff: 2349 lines (+1426/-341)10 files modifiedubuntu_sso/credentials.py (+53/-34)
ubuntu_sso/keyring.py (+77/-74)
ubuntu_sso/main.py (+57/-33)
ubuntu_sso/tests/test_credentials.py (+93/-52)
ubuntu_sso/tests/test_keyring.py (+121/-88)
ubuntu_sso/tests/test_main.py (+27/-60)
ubuntu_sso/utils/__init__.py (+19/-0)
ubuntu_sso/utils/tests/__init__.py (+19/-0)
ubuntu_sso/utils/tests/test_txsecrets.py (+696/-0)
ubuntu_sso/utils/txsecrets.py (+264/-0)
Changed in ubuntu-sso-client: | |
status: | New → Confirmed |
importance: | Undecided → High |
Changed in ubuntu-sso-client: | |
assignee: | nobody → Alejandro J. Cura (alecu) |
Changed in ubuntu-sso-client (Ubuntu): | |
status: | New → In Progress |
importance: | Undecided → High |
assignee: | nobody → Alejandro J. Cura (alecu) |
tags: | added: u1-maverick-sru |
Changed in ubuntu-sso-client: | |
status: | In Progress → Fix Committed |
Changed in ubuntu-sso-client (Ubuntu): | |
assignee: | Alejandro J. Cura (alecu) → Naty Bidart (nataliabidart) |
Changed in ubuntu-sso-client (Ubuntu): | |
status: | In Progress → Triaged |
milestone: | none → natty-alpha-1 |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
Changed in ubuntu-sso-client (Ubuntu Maverick): | |
importance: | Undecided → High |
assignee: | nobody → Naty Bidart (nataliabidart) |
tags: |
added: verification-done removed: verification-needed |
tags: |
added: verification-done removed: verification-needed |
tags: | added: testcase |
To post a comment you must log in.
It looks like calling keyring_ get_credentials from a thread is not safe. get_credentials _sync.
I propose renaming the current one keyring_
Also I propose not using a thread in the new find_credentials and using the async way of accessing the keyring instead.