FS#56103 - [keepass] Crashes under i3 when hitting the mod key

Attached to Project: Community Packages
Opened by Luca Corbatto (targodan) - Tuesday, 24 October 2017, 13:37 GMT
Last edited by Giancarlo Razzolini (grazzolini) - Thursday, 20 September 2018, 23:16 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Giancarlo Razzolini (grazzolini)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
KeePass crashes when hitting the Mod (Windows) Key in the i3 window manager, again.

Additional info:
* package version(s): keepass: 2.37-1, mono: 5.0.0.100-2


Steps to reproduce:
- Run i3wm with windows key as the mod key
- Open Keepass
- With Keepass in focus hit the windows repeatedly (works roughly 80% of all time)

Additional Info:
This bug was present before, the previous fix was to add the "--verify-all" parameter to the mono call. I was the maintainer of the (now removed) AUR package keepass-i3. It was removed after the fix was added to the community package.

FIX:
Remove the "--verify-all" parameter and it works. I tested it on my up-to-date archlinux system by calling "mono /usr/share/keepass/Keepass.exe" from a terminal and the problem disappeared. Calling "mono --verify-all /usr/share/keepass/Keepass.exe" from a terminal does contain the crash problem. I have attached the console output of an observed crash.
This task depends upon

Closed by  Giancarlo Razzolini (grazzolini)
Thursday, 20 September 2018, 23:16 GMT
Reason for closing:  Works for me
Additional comments about closing:  Also, no response from reporter for a while now
Comment by Giancarlo Razzolini (grazzolini) - Tuesday, 24 October 2017, 17:16 GMT
Hi Luca,

I tried very hard to reproduce this here, and I was not able to. I tried with different Mod (Alt) and this did not happen here. Having said that, I see there are some upstream bug reports for this issue:

https://sourceforge.net/p/keepass/bugs/1545/
https://sourceforge.net/p/keepass/bugs/1523/

Since --verify-all is supposed to check the code, can you tell me if you are using any keepass plugin? Even though this error seems to be only mono related, please try to use keepass without any plugins and with a new/clean database *and* configuration and tell me if this behavior persists.

Another thing to check, even though I don't think it would crash it, would be if you have a compositor running. I did not test using any compositor.
Comment by Luca Corbatto (targodan) - Wednesday, 25 October 2017, 07:52 GMT
Hi Giancarlo,

Right, I didn't think about my compositor (compton).
I will try later this day without compton and without plugins (currently only keepass-http) and come back to you.

Regarding the bugreports: I did research this bug too and the general gist is "it's a mono bug" but the devs of mono seem loath to fix it with the argument "it's a keepass bug". At least I haven't found any open or fixed bugreport about this in the mono project. Although someone seems to have fixed this by using a different mono build, see https://sourceforge.net/p/keepass/bugs/1545/ last answer.

A known work around used to be to add "--verify-all" and it did fix it for me once, however now it seems to be breaking it for me as it works without that parameter, but not with the parameter.
Comment by Luca Corbatto (targodan) - Wednesday, 25 October 2017, 14:25 GMT
So I tried to narrow it down. Sadly to no avail. The situation stayed the same throughout all tests, crashes (sometimes, not every time you start keepass) with "--verify-all", does not crash (ever) without "--verify-all"

Sadly I don't have the time to setup a clean archlinux to test this from scratch, sorry. But here's what I tried:
- Removed all keepass plugins.
- Killed anything my i3-config autostarts, including compton
- Changed my keyboard layout to "gb" and to "us" (usually "de" - german)
- Removed any unnecessary mono-* packages

Don't think this plays a part, but I start i3 via the gdm login. I have two friends who also use i3 and keepass and they have the same problem. Don't know if that is relevant but we are all using laptops with german keyboard layouts.

I'll attach my i3-config for you, maybe that helps in reproducing.
Comment by Luca Corbatto (targodan) - Wednesday, 25 October 2017, 14:26 GMT
Sorry, I forgot the attachment.
   config (6.2 KiB)
Comment by Giancarlo Razzolini (grazzolini) - Thursday, 26 October 2017, 11:37 GMT
Hi Luca,

It makes sense that this only happens with german keyboard layouts. Mono/keepass had an issue with my keyboard layout too (br), but in that case the key combos were off, and I couldn't copy entries from keepass using the right combination, I need to shift the keys to the left. So, CTRL+C would be CTRL + X, and so on.

If I recall it correctly, this was a bug both on mono and keepass. It got fixed when keepass was updated earlier this year, so I don't know exactly what happened, but I can find the upstream bug reports.

Also, I don't think that changing your layout to other keyboards if you don't have the keyboard will help you because the keycodes will remain the same, sent from the keyboard. I tried changing my layout to de here and triggering the issue, but I was unsuccessful.

If you can narrow it down to the specific keyboards/layouts, we might report back to upstream on this.

Loading...