Merge lp:~mterry/unity8/cancel-pam-harder into lp:unity8
Status: | Merged |
---|---|
Approved by: | Albert Astals Cid |
Approved revision: | 1644 |
Merged at revision: | 1780 |
Proposed branch: | lp:~mterry/unity8/cancel-pam-harder |
Merge into: | lp:unity8 |
Diff against target: |
225 lines (+117/-22) 4 files modified
plugins/LightDM/liblightdm/GreeterPrivate.cpp (+29/-5) plugins/LightDM/liblightdm/GreeterPrivate.h (+1/-1) tests/plugins/LightDM/CMakeLists.txt (+35/-16) tests/plugins/LightDM/pam.cpp (+52/-0) |
To merge this branch: | bzr merge lp:~mterry/unity8/cancel-pam-harder |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Albert Astals Cid (community) | Approve | ||
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Michał Sawicz | Needs Fixing | ||
Review via email: mp+251174@code.launchpad.net |
Commit message
Fix a possible crash in our PAM threading code. (LP: #1425362)
So it was possible for a PAM subthread (which does the actual authenticating) to get mismatched state with the main thread. When this happened (i.e. when the subthread tried to use a pam_handle object that the main thread had already closed), a crash occurs. Like LP: #1425362.
So I've done a few cleanups here:
- Use a cancellable QConcurrent method (::mapped instead of ::run). Being able to cancel the thread is a stronger hammer than just hoping we answer all questions from the thread and it will close itself.
- We now block when the subthread sends a prompt request to the main thread. This makes handling those signals more predictable when we're trying to close the thread.
- We will process events while waiting for the subthread to close, so that we can actually process the above signals in the main thread.
I've added a dumb little test that tries to authenticate/
Description of the change
Fix a possible crash in our PAM threading code. (LP: #1425362)
So it was possible for a PAM subthread (which does the actual authenticating) to get mismatched state with the main thread. When this happened (i.e. when the subthread tried to use a pam_handle object that the main thread had already closed), a crash occurs. Like LP: #1425362.
So I've done a few cleanups here:
- Use a cancellable QConcurrent method (::mapped instead of ::run). Being able to cancel the thread is a stronger hammer than just hoping we answer all questions from the thread and it will close itself.
- We now block when the subthread sends a prompt request to the main thread. This makes handling those signals more predictable when we're trying to close the thread.
- We will process events while waiting for the subthread to close, so that we can actually process the above signals in the main thread.
I've added a dumb little test that tries to authenticate/
Users didn't notice this bug, because the timing is tough to reproduce naturally (I would have thought, but then bug 1425362 noticed in a VM... Maybe the slowness of a VM helps surface this).
== Checklist ==
* Are there any related MPs required for this MP to build/function as expected? Please list.
No
* Did you perform an exploratory manual test run of your code change and any related functionality?
Yes... I added a test anyway, that stresses this code
* Did you make sure that your branch does not contain spurious tags?
Yes
* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
NA
* If you changed the UI, has there been a design review?
NA
FAILED: Continuous integration, rev:1636 jenkins. qa.ubuntu. com/job/ unity8- ci/5366/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- vivid-touch/ 1565/console jenkins. qa.ubuntu. com/job/ unity-phablet- qmluitests- vivid/530/ console jenkins. qa.ubuntu. com/job/ unity8- vivid-amd64- ci/531/ console jenkins. qa.ubuntu. com/job/ unity8- vivid-i386- ci/531/ console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-armhf/ 1563/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity8- ci/5366/ rebuild
http://