Double-clicking password entry from overview freezes entire system

Bug #1116512 reported by Arjan
74
This bug affects 16 people
Affects Status Importance Assigned to Milestone
keepass2 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I've had this behaviour for months on my Desktop, but I ignored it because I thought it could be because of not correctly installing something, or some side effect because I was running Ubuntu (12.04-amd64) from a CF card.

But now I notice the same behavior on a fresh install of Ubuntu 12.04.2-amd64 on a laptop.

Occasionally the intended behavior occurs - after double-clicking an entry from the password column in the overview, the password is available from clipboard for 12 seconds), but almost always the entire system freezes (KeePass clipboard timer does not appear).

The mouse pointer still works, but clicking has no effect. Pressing the Windows key does bring up the Dash, and Ctrl+alt+del gives a logout popup. But the only way out I've found is to open system monitor and kill the mono process.

I installed with:
sudo apt-get install mono-complete

And keepass from adding ppa:jtaylor/keepass.
Running version: keepass2 2.20.1+dfsg-0ubuntu1~ppa1~precise1.

I actually did two similar installs, one from the Desktop Live CD, where I had trouble from the start, and I did a re-install from Alternate disc, where at first the double-click function seemed to be working, but upon further usage it now freezes all the time.

Arjan (ar-jan)
description: updated
Revision history for this message
Julian Taylor (jtaylor) wrote :

do you have xsel installed?

Revision history for this message
Arjan (ar-jan) wrote :

I had xsel installed, but I went to check in the Software Center, and my installed package was listed as xsel 1.2.0-1. But there is also an xsel:i386 package (not shown by default - because I'm on a 64 bit Ubuntu version?).

The two are not compatible; I removed the first and installed xsel:i386 and now it seems to be working fine.

Revision history for this message
Julian Taylor (jtaylor) wrote :

if its the 32 or 64 bit xsel should not matter
I saw such a hang once when the xsel support was added in 2.20, there is probably a deadlock somewhere when calling the external process
Unfortunately I have not been able to reliably reproduce it for debugging.

A workaround would be to remove xsel then it uses the mono built in copy/pasting which does not work in some applications but at least should not lock the program.

Revision history for this message
Klauspeter (janzomaster) wrote :

I have the same issue - killing mono, xsel or keepass or just logging out seems to be the only current workaround. I stopped using the double-click feature and started copying the passwords manually. This is a minor security risk, as no timeout for clipboard clearing is set, so I would love this to be resolved.

If you need debugging info, I'd be happy to provide it. Just tell me what I need to know, I'm not a developer myself.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in keepass2 (Ubuntu):
status: New → Confirmed
Revision history for this message
Eltair (eltair) wrote :

I have observed the same behavior as Klauspeter.

Revision history for this message
timdaman (timdaman-gmail) wrote :

I have seen the same behavior. Installing the libmono-system-runtime2.0-cil package resolved it for me. I have the 64bit verion of xsel installed.

I got the solution from here
http://sourceforge.net/p/keepass/discussion/329221/thread/5bdb7ee3

Revision history for this message
Martin (ub71-martin) wrote :

same issue here...

Revision history for this message
David Lechner (dlech) wrote :

To everyone who has said "me too". You can help fix this bug by providing some more information...

1. Per comment #7, answer the question: have you installed the libmono-system-runtime2.0-cil package?

2. Provide a list of steps to reliably repeat the lockup.

3. When it locks up, run "kill -QUIT <pid>" where <pid> is the process id of the locked up instance of KeePass. This should produce a stack trace that you can post as an attachment here. (You can type"ps ax | grep KeePass" to find the pid - if you didn't know that already.)

Revision history for this message
Julian Taylor (jtaylor) wrote :

its a deadlock when calling xsel, I unfortunately can't reliably reproduce it.
when it happens go to a terminal (e.g. ctrl + alt + f5) and run killall xsel
that should restore the system

a workaround is to remove xsel.

Revision history for this message
Karsten (karsten-maxi-dsl) wrote :

I'm seeing this issue also, on two machines under 12.04 (one 64, one 32 bit ubuntu installs).

On David's questions in #9:
- 1: libmono-system-runtime2.0-cil package is NOT installed
- 2: I have yet to find a way to intentionally reproduce the issue - actually it's rather sporadic
- 3: I'll try to do that the next time I see the issue..

Revision history for this message
Zach Vickery (zvickery) wrote :

I can confirm this issue exists on 13.04. I can also confirm that installing libmono-system-runtime2.0-cil fixes the issue. Maybe it should be a dependency on the keepass2 package?

Revision history for this message
Julian Taylor (jtaylor) wrote : Re: [Bug 1116512] Re: Double-clicking password entry from overview freezes entire system

I don't see how installing libmono-system-runtime2.0-cil would fix the
issue, keepass doesn't use the 2.0 runtime it uses the 4.0 runtime.
has anyone found a way to reproduce the issue reliably?
I'll most likely drop the recommends on xsel with the new 2.23 upload to
avoid this issue.

On Thu, Jul 25, 2013 at 12:07 AM, Zach Vickery <email address hidden> wrote:

> I can confirm this issue exists on 13.04. I can also confirm that
> installing libmono-system-runtime2.0-cil fixes the issue. Maybe it
> should be a dependency on the keepass2 package?
>
> --
> You received this bug notification because you are subscribed to
> keepass2 in Ubuntu.
> https://bugs.launchpad.net/bugs/1116512
>
> Title:
> Double-clicking password entry from overview freezes entire system
>
> Status in “keepass2” package in Ubuntu:
> Confirmed
>
> Bug description:
> I've had this behaviour for months on my Desktop, but I ignored it
> because I thought it could be because of not correctly installing
> something, or some side effect because I was running Ubuntu
> (12.04-amd64) from a CF card.
>
> But now I notice the same behavior on a fresh install of Ubuntu
> 12.04.2-amd64 on a laptop.
>
> Occasionally the intended behavior occurs - after double-clicking an
> entry from the password column in the overview, the password is
> available from clipboard for 12 seconds), but almost always the entire
> system freezes (KeePass clipboard timer does not appear).
>
> The mouse pointer still works, but clicking has no effect. Pressing
> the Windows key does bring up the Dash, and Ctrl+alt+del gives a
> logout popup. But the only way out I've found is to open system
> monitor and kill the mono process.
>
> I installed with:
> sudo apt-get install mono-complete
>
> And keepass from adding ppa:jtaylor/keepass.
> Running version: keepass2 2.20.1+dfsg-0ubuntu1~ppa1~precise1.
>
> I actually did two similar installs, one from the Desktop Live CD,
> where I had trouble from the start, and I did a re-install from
> Alternate disc, where at first the double-click function seemed to be
> working, but upon further usage it now freezes all the time.
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/keepass2/+bug/1116512/+subscriptions
>

Revision history for this message
Karsten (karsten-maxi-dsl) wrote :

on Julian's comment #13 -
actually I've seen at least one occurence of the issue after I installed libmono-system-runtime2.0-cil (on a 32bit 12.04 machine). So I guess I'll uninstall xsel then.

Revision history for this message
Ben (bhubu) wrote :

Same problem
Ubuntu 13.04
Keepass 2.21

Revision history for this message
ZR (eedebez) wrote :

Similar problem but I can reproduce 100% reliably on my system:
Mint 13 Maya with Mate (downstream distro of Ubuntu Precise)

Slight twist on bug: My Mate Session freezes when i perform a specific copy to clipboard sequence. Double clicking a record per original bug is okay. Regardless, answers to prior questions from Post #9:

1. I did not have libmono-system-runtime2.0-cil installed. I installed it, no difference.

2. To reliably freeze my entire Mate session:
      a. Open keepass, open a password record, select text from a field and right-click / copy.
      b. Go to another window and paste.
      c. Observe that nothing happens - right click paste in context menu is disabled - buffer seems empty.
      d. Go back to keepass and close the password record.
      e. Right click said record and select from context menu "copy password".
      f. Bang. My system is locked.
      g. I can reproduce this 100% of the time. If I religiously avoid manually copying text from within a record, and only use the summary view right click copy feature, then it seems nothing evil happens. Very hard to resist though - i have completely screwed myself half a dozen times and lost large amounts of work due to this bug.

3. I just learned that for some reason mouse/keyboard input is completely blocked (cursor still visible) except for: ctrl-alt-f1 to change run level, and alt-F2 run program.

Thankg god Alt-F2 works, because this has allowed me to sniff around enough to learn that keepass shows up in mint as a process named "cli". If I kill this process - life returns to normal!!!

FYI over the last months, i have tried to find the keepass process but failed - i only discovered the "cli" process from comparing PS outputs before and after running keepass. So i'm very happy now because I will never again lose all my work due to this bug - can kill "cli" now. :) Hope this helps someone out there avoid work loss, and I hope this helps to figure out a solution.

Hondo :)

Revision history for this message
Julian Taylor (jtaylor) wrote :

thanks a lot ZR, I can now reproduce the issue.
copying the text via a selection does not use xsel but monos builtin (broken) copy/paste method. This seems to corrupt something in the selection handling of X(?) which then again causes a future xsel call trying to copy/paste something to block indefinitely.

Revision history for this message
EliCoten (launchpad-elicoten) wrote :

Not sure if this is the same bug but it's certainly related.

On Ubuntu 12.10 I had exactly the same issue described here on two computers, one x64 and one x86.

Now I've upgraded both to Ubuntu 13.04, the issue is similar, except that instead of freezing the whole computer, only KeePass freezes. I have found that if I kill the KeePass process, it will not restart for at least a few minutes not matter how many times I try (I've even tried using the watch command to restart it automatically when it fails - it seems to be a time related delay). But after a few minutes (not sure exactly how long) KeePass will just open again and work normally, until it freezes again.

It always seems to freeze when I attempt to use the Copy to Clipboard features - either by double clicking on the user name and password or by using the CTRL + B or CTRL + C keyboard shortcuts on the entry list.

Revision history for this message
David Lechner (dlech) wrote :

It looks like someone has figured out a fix for this bug. It has been fixed upstream: <https://sourceforge.net/p/keepass/patches/84/?limit=25#0f4b>.

You can find a link there for a test version to verify that the problem is indeed fixed.

@EliCoten: The restart delay is a separate issue and should is fixed in <https://bugs.launchpad.net/ubuntu/+source/keepass2/+bug/1011349>. Perhaps you do not have the latest version?

Revision history for this message
Julian Taylor (jtaylor) wrote :

thanks for the link.
the patch seems rather hackish, it would be better fixed in mono itself.
Though I do not have time to fix mono right now, so I'll add this patch to the package after I verified it works.

This is probably SRU worthy, I can fix the failing start after crash/logout too then.

Revision history for this message
Will Rouesnel (w-rouesnel) wrote :

I'm the author of said patch, and sadly I've since discovered it doesn't actually fix the problem (I wrote it before I had a decent grip on the crash).

Revision history for this message
Will Rouesnel (w-rouesnel) wrote :

Ok, after having spent some time with a dummy app testing the various permutations of this, I think I can implement a tentative (and very hacky) work around.

The basic problem is, any call Clipboard.GetText() or related corrupts the xclipboard for any xsel process trying to read, delete or modify it. xsel hangs, and it can hang the window manager in --input mode for some reason too.

What I've found though is that processes outside the process tree of KeePass can safely xsel --input to the clipboard even after it's been corrupted, and this "repairs" the X clipboard. xsel --delete *does not* work.

I'm just now testing a patch which implements this work around - results are looking promising.

Revision history for this message
Will Rouesnel (w-rouesnel) wrote :

Patch submitted for this issue: https://sourceforge.net/p/keepass/patches/85/

So far from my own testing it resolves it completely.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package keepass2 - 2.24+dfsg-1

---------------
keepass2 (2.24+dfsg-1) unstable; urgency=low

  * New upstream release (LP: #1116512)
  * add xsel recommends again, issue seems to be fixed
  * bump standard to 3.9.5, no changes required
  * build with LC_ALL=C.UTF-8, required with mono 2 due unicode in source

 -- Julian Taylor <email address hidden> Sun, 03 Nov 2013 20:00:42 +0100

Changed in keepass2 (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.