Solved keepassx2

I have a problem with security/keepassx2. It builds and runs, but after I enter password from kdbx container it crashes with Bus error. The same crash applies if I try to create new container. I used this port before without any issues, but it's hard to figure out what happened. I tried to downgrade security/libgcrypt without any success.

Can anyone with recent port tree confirm that the problem affecting not only me? The reproductions steps (if you have no database) are

1. Install from ports
2. Database -> New Database
3. Enter password for new database
4. Press save button.
It should crash.

By the way, if you use another program to keep passwords, please name it! I'm unhappy that keepassx is a qt-application.
My requirements are:
1. FreeBSD/Windows/Android support
2. Standalone software
3. Open source
 
The crash occurs in security/libgcrypt.
Code:
Program received signal SIGBUS, Bus error.
[Switching to Thread 806806400 (LWP 100145/keepassx)]
0x0000000801bfbb64 in _gcry_salsa20_amd64_encrypt_blocks () from /usr/local/lib/libgcrypt.so.20
(gdb) bt
#0  0x0000000801bfbb64 in _gcry_salsa20_amd64_encrypt_blocks () from /usr/local/lib/libgcrypt.so.20
#1  0x0000000000000001 in ?? ()
#2  0x00000000002d0360 in ?? ()
#3  0x000000080680658c in ?? ()
#4  0x0000000000000023 in ?? ()
#5  0x00007fffffffc760 in ?? ()
#6  0x00000008036d25f5 in pthread_getspecific () from /lib/libthr.so.3
#7  0x0000000801bfaaf8 in _gcry_camellia_aesni_avx2_cfb_dec () from /usr/local/lib/libgcrypt.so.20
#8  0x0000000801bfa52b in _gcry_camellia_aesni_avx2_cfb_dec () from /usr/local/lib/libgcrypt.so.20
#9  0x0000000801b9568e in gcry_is_secure () from /usr/local/lib/libgcrypt.so.20
#10 0x0000000801b8948f in gcry_cipher_setkey () from /usr/local/lib/libgcrypt.so.20
#11 0x000000000048f714 in SymmetricCipherGcrypt::setKey (this=0x80a47d240, key=@0x7fffffffcc98)
  at /usr/ports/security/keepassx2/work/keepassx-2.0-alpha6/src/crypto/SymmetricCipherGcrypt.cpp:89
#12 0x000000000048f14e in SymmetricCipher (this=0x7fffffffce58, algo=Salsa20, mode=Stream, direction=Encrypt,
  key=@0x7fffffffcc98, iv=@0x70be70)
  at /usr/ports/security/keepassx2/work/keepassx-2.0-alpha6/src/crypto/SymmetricCipher.cpp:28
#13 0x00000000004b6dd9 in KeePass2RandomStream (this=0x7fffffffce58, key=@0x7fffffffd0c0)
  at /usr/ports/security/keepassx2/work/keepassx-2.0-alpha6/src/format/KeePass2RandomStream.cpp:27
#14 0x00000000004b7c46 in KeePass2Reader::readDatabase (this=0x7fffffffd068, device=0x7fffffffd040,
  key=@0x7fffffffd058)
  at /usr/ports/security/keepassx2/work/keepassx-2.0-alpha6/src/format/KeePass2Reader.cpp:133
#15 0x00000000004a10e5 in DatabaseOpenWidget::openDatabase (this=0x806a19600)
  at /usr/ports/security/keepassx2/work/keepassx-2.0-alpha6/src/gui/DatabaseOpenWidget.cpp:113
#16 0x0000000000488682 in DatabaseOpenWidget::qt_static_metacall (_o=0x806a19600, _c=InvokeMetaMethod, _id=1,
  _a=0x7fffffffd1a0)
  at /usr/ports/security/keepassx2/work/keepassx-2.0-alpha6/src/gui/moc_DatabaseOpenWidget.cxx:60
#17 0x0000000800ac9c0d in QMetaObject::activate () from /usr/local/lib/qt4/libQtCore.so.4
#18 0x00000008014137f3 in QDialogButtonBox::standardButton () from /usr/local/lib/qt4/libQtGui.so.4
#19 0x0000000801413f78 in QDialogButtonBox::event () from /usr/local/lib/qt4/libQtGui.so.4
#20 0x0000000800ac9c0d in QMetaObject::activate () from /usr/local/lib/qt4/libQtCore.so.4
#21 0x00000008016958d1 in QAbstractButton::clicked () from /usr/local/lib/qt4/libQtGui.so.4
#22 0x00000008013e5b54 in QAbstractButton::isCheckable () from /usr/local/lib/qt4/libQtGui.so.4
#23 0x00000008013e56b5 in QAbstractButton::click () from /usr/local/lib/qt4/libQtGui.so.4
#24 0x000000000046906a in DialogyWidget::clickButton (this=0x806a19600, standardButton=QDialogButtonBox::Ok)
  at /usr/ports/security/keepassx2/work/keepassx-2.0-alpha6/src/gui/DialogyWidget.cpp:78
#25 0x0000000000468e94 in DialogyWidget::keyPressEvent (this=0x806a19600, e=0x7fffffffda78)
  at /usr/ports/security/keepassx2/work/keepassx-2.0-alpha6/src/gui/DialogyWidget.cpp:43
#26 0x0000000801087533 in QWidget::event () from /usr/local/lib/qt4/libQtGui.so.4
#27 0x000000080103a4bd in QApplicationPrivate::notify_helper () from /usr/local/lib/qt4/libQtGui.so.4
#28 0x000000080103d212 in QApplication::notify () from /usr/local/lib/qt4/libQtGui.so.4
I recompiled it without O2 flag and keepassx start working.
Code:
.if ${.CURDIR:M*/security/libgcrypt}
CFLAGS= -pipe
.endif
Actually, I don't know what to do next :) The crash can be due to poor keepassx programming or indicate problems with libgcrypt
 
Back
Top