KeepassX quits when autotype with @ in user or password

Bug #286617 reported by Hammermensch
22
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KeePassX
Unknown
Unknown
keepassx (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

perhaps it is related to bug #83263

I have a similar problem.

I have used ubuntu 8.04 with KeepassX 0.3.3 downloaded from the KeepassX-website.

No problem at all. Only a ew autotypes wasnt typed in correct (think this is another bug).

But now, installed freshly ubuntu 8.10 with deleted .keespassx-folder a new bug appeared. in the preferences i toggled the options to minimize keepassx in the tastbar instead of closing. Now, when I make an autotype, sometimes keepassx closes, sometimes not.
one thing i recognized. when the username is an email-addy, the autotype stops before the @-symbol is typed. so, i tested combinations of user/pw containing the @-symbol.

always when there is a @-symbol in the user OR the pw, keepassx quits with following message in the terminal

Found Metastream: KPX_CUSTOM_ICONS_4
Found Metastream: KPX_GROUP_TREE_STATE
ASSERT: "c!=-1" in file lib/HelperX11.cpp, line 32
Aborted (core dumped)

without having the @-symbol in pw or user keepass autotypes correctly and hides in the taskbar

in ubuntu 8.04 with the same keepassx-version i didnt have the problem.

Revision history for this message
Ralph Janke (txwikinger) wrote :

Thanks for reporting this issue and helping to make Ubuntu better.

How did you install KeepassX?

Thanks

Changed in keepassx:
status: New → Incomplete
Revision history for this message
Nick Ellery (nick.ellery) wrote :

@Ralph

Looks like it was complied from source, manually.

@Hammermensch

keepassx version 0.3.3 is currently available in Intrepid. Would you mind testing this on that, rather than from the upstream source, and report back with the results? Thanks a lot.

Thanks,

Nick

Revision history for this message
Hammermensch (hammermensch) wrote :

hi, in 8.04 i first installed with apt-get install an old version, then created the database. then a few weeks later i downloaded .deb-File from the homepage and updated few times until ver. 0.3.3.

3 days ago, i installed ubuntu 8.10 freshly on my system. before, i deleted the .keepassx-folder to have a clean install for keepassx. then i installed it with apt-get install. 0.3.3 was delivered with intrepid. Or was it downloaded from another respository?

i attached sources.list

Revision history for this message
Julian Kniephoff (jules-k) wrote :

I can confirm this bug from a clean 8.10 install (without any additional repositories).

I also had a look into the source code. The assertion occurs in the function HelperX11::getModifiers. In this function, there is a for loop with a range of 0 to 3 (i=0; i < 4), which iterates over the entries of the KeySym list returned by XGetKeyboardMapping. However, this list may be longer than 4 elements, which is the case for "@", obviously. Changing the loops range to 0-SymsPerKey (which is a value returned also by XGetKeyboardMapping, indicating how many elements the list has), removes the assertion -- the autotype completes without crashing the application.
However: Now a "q" is typed instead of a "@" which is caused by the function HelperX11::pressModifiers. For me, getModifiers returns a 4 (with the above change) for "@" but there is no case for 4 in the switch statement of pressModifiers, so no modifier key press is simulated.

I am not an X11 guru but maybe there is one here and he can do something with this information.

Revision history for this message
Hammermensch (hammermensch) wrote :

@Nick Ellery

See your comment now. What do you mean with upstream source? I made a clean install with 8.10. No upgrade. Then i installed Keypass from add/delete programm-menu.

@Julian
Thanks for confirmation.

Revision history for this message
Julian Kniephoff (jules-k) wrote :

Sorry for double posting but I should add two other things, that I found out:
First the bug seems to occur with other characters that involve pressing AltGr. I tested this with "|", which -- on a German keyboard -- is typed as AltGr+<.
As this worked in hardy and the corresponding code did not change in keepassx (the original reporter of this bug and me, too, used 0.3.3 already in hardy), some other change has to cause this and I think I found it:
Running this little program:
"#include <stdio.h>

#include <X11/Xlib.h>
#include <X11/keysymdef.h>

int main (int argc, char *argv[])
{
        Display *d = XOpenDisplay (NULL);
        int n, i;
        KeySym *syms = XGetKeyboardMapping (d, 24, 1, &n); // KeyCode 24 is "@".
        for (i = 0; i < n; ++i)
        {
                printf("%x\n", syms[i]);
        }
        XFree (syms);
        XCloseDisplay (d);
}"
on a hardy machine yields:
"71
51
40
7d9
40
7d9
0"
With 0x40 being the KeySym of "@" HelperX11::getModifiers returns 2, which is interpreted as AltGr by HelperX11::pressModifiers.
On my new intrepid install, this gives me:
"71
51
71
51
40
7d9
40"
Which makes getModifiers return 4 (or crash with an assertion, if you didn't apply the change I mentioned in the last post), which can not be interpreted by pressModifiers.

As said, I am not an X11 guru and thus cannot judge, whether this is a bug in intrepids X11 or a design flaw in keepassx (or maybe in a completely different place like a keyboard map...).

Revision history for this message
Tanis Mezzelfo (tanis-mezzelfo) wrote :

I can confirm this bug from a my clean 8.10 install (without any additional repositories) :-( Always when there is a @-symbol in the username, keepassx 0.3.3 quits!

There's some temporary workaround for now?

Revision history for this message
Tanis Mezzelfo (tanis-mezzelfo) wrote :

Add other information... if I launch keepassx 0.3.3 from command line then I see this assert error "ASSERT: "c!=-1" in file lib/HelperX11.cpp, line 32" when keepassx quits.

I hope this info could be useful to resolv.

Felix Geyer (debfx)
Changed in keepassx:
status: Incomplete → Confirmed
Revision history for this message
Francesco (francofienga) wrote :

Same thing here:

Ubuntu 8.10 (8.04 Upgrade)
keepassx 0.3.3

Even after reinstalling keepassx.
There was no problem on Ubuntu 8.04.

Revision history for this message
Felix Geyer (debfx) wrote :

I have just released KeePassX v0.3.4 which fixes this bug.

Revision history for this message
Hammermensch (hammermensch) wrote :

Will this release come with ubuntu-updates?

Revision history for this message
Felix Geyer (debfx) wrote :

I hope so. In the meantime you can use the packages from the KeePassX website:
http://www.keepassx.org/downloads

Revision history for this message
Nick Ellery (nick.ellery) wrote :

I'm opening a new report for this upgrade. It will be in Jaunty.

Revision history for this message
Tanis Mezzelfo (tanis-mezzelfo) wrote :

Great Felix! Thank you very much! KeepassX is a very good and useful security tool! I use it on my ubuntu 8.10 and windows system.

Revision history for this message
Nick Ellery (nick.ellery) wrote :

I've uploaded the new upstream release to a bzr branch, and it should soon get uploaded to Jaunty. I'll also upload it to my ppa so you can use the new version.

Revision history for this message
Reinhard Tartler (siretart) wrote :

archive admins, please sync keepassx 0.3.4-1 (universe) from Debian experimental (main).

Changelog since current jaunty version 0.3.3-1:

keepassx (0.3.4-1) experimental; urgency=low

  * new upstream release. LP: #296014

 -- Reinhard Tartler <email address hidden> Sun, 09 Nov 2008 21:59:02 +0100

Revision history for this message
Martin Pitt (pitti) wrote :

[Updating] keepassx (0.3.3-1 [Ubuntu] < 0.3.4-1 [Debian])
 * Trying to add keepassx...
  - <keepassx_0.3.4-1.dsc: downloading from http://ftp.debian.org/debian/>
  - <keepassx_0.3.4.orig.tar.gz: downloading from http://ftp.debian.org/debian/>
  - <keepassx_0.3.4-1.diff.gz: downloading from http://ftp.debian.org/debian/>
I: keepassx [universe] -> keepassx_0.3.3-1 [universe].

Changed in keepassx:
status: Confirmed → Fix Released
Revision history for this message
Hammermensch (hammermensch) wrote :

hi there,

i have still a problem.
In some cases the autotyping of passwords interrups. In one case it was the special character ^. Can somebody confirm that?
I have written to the author of Keepass about the problem, but no answer.
Should i open a new bug report for this, or is this perhaps related to this bug?

Revision history for this message
Julian Kniephoff (jules-k) wrote :

Not directly related to this one, I would say. This has to do with dead keys. On some -- e.g. German -- keyboard layouts, ^ is a dead key as is ', ` and ~. All of them make autotype stop, when occuring in a password, on my system.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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