Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on Windows after PC wakes up since 2.7.7 #10455

Closed
lazka opened this issue Mar 17, 2024 · 5 comments · Fixed by #10458
Closed

Crash on Windows after PC wakes up since 2.7.7 #10455

lazka opened this issue Mar 17, 2024 · 5 comments · Fixed by #10458

Comments

@lazka
Copy link
Contributor

lazka commented Mar 17, 2024

Overview

Since the update from 2.7.6 to 2.7.7 I occasionally get crashes when the PC wakes up and I get this shown on the unlock screen.

Screenshot 2024-03-12 082145

It happened four times this week and never before that in the last year.

Steps to Reproduce

I haven't figured out a way to reproduce, I only know this:

  1. Have KeepassXC running
  2. Put the PC to sleep
  3. Wake up the PC

Expected Behavior

No crash

Actual Behavior

Crash

Context

KeePassXC - Version 2.7.7
Revision: 68e2dd8

Qt 5.15.11
Debugging mode is disabled.

Operating system: Windows 11 Version 2009
CPU architecture: x86_64
Kernel: winnt 10.0.22631

Enabled extensions:

  • Auto-Type
  • Browser Integration
  • Passkeys
  • SSH Agent
  • KeeShare
  • YubiKey
  • Quick Unlock

Cryptographic libraries:

  • Botan 3.1.1
@lazka lazka added the bug label Mar 17, 2024
@droidmonkey
Copy link
Member

Yes I have seen this as well but haven't been able to track it down yet

@lazka
Copy link
Contributor Author

lazka commented Mar 17, 2024

I think I got a stacktrace (the above is from the official installer, the stacktrace from the MSYS2 build):

[New Thread 17112.0x3eac]
warning: qt.qpa.mime: Retrying to obtain clipboard.
warning: qt.qpa.mime: Retrying to obtain clipboard.
warning: qt.qpa.mime: Unable to obtain clipboard.
warning: qt.qpa.mime: Retrying to obtain clipboard.
warning: qt.qpa.mime: Retrying to obtain clipboard.
warning: qt.qpa.mime: Unable to obtain clipboard.
warning: qt.qpa.mime: Retrying to obtain clipboard.
warning: qt.qpa.mime: Retrying to obtain clipboard.
warning: qt.qpa.mime: Unable to obtain clipboard.
warning: com\ole32\ole232\clipbrd\clipapi.cpp(3731)\ole32.dll!00007FFCE47751D0: (caller: 00007FFCE4776A25) ReturnHr(1) tid(2770) 800401D0 OpenClipboard Failed
warning: com\ole32\ole232\clipbrd\clipapi.cpp(3731)\ole32.dll!00007FFCE47751D0: (caller: 00007FFCE4776A25) ReturnHr(2) tid(2770) 800401D0 OpenClipboard Failed
warning: com\ole32\ole232\clipbrd\clipapi.cpp(3731)\ole32.dll!00007FFCE47751D0: (caller: 00007FFCE4776A25) ReturnHr(3) tid( (The operation completed successfully.)
[Thread 17112.0x3eac exited with code 0]

Thread 1 received signal SIGSEGV, Segmentation fault.
0x00007ff6dab92b1c in Database::transformedDatabaseKey() const ()
(gdb) bt
#0  0x00007ff6dab92b1c in Database::transformedDatabaseKey() const ()
#1  0x00007ff6dadbe679 in Kdbx4Reader::readDatabaseImpl(QIODevice*, QByteArray const&, QSharedPointer<CompositeKey const>, Database*) ()
#2  0x00007ff6dadbc5da in KdbxReader::readDatabase(QIODevice*, QSharedPointer<CompositeKey const>, Database*) ()
#3  0x00007ff6dad17bf5 in KeePass2Reader::readDatabase(QIODevice*, QSharedPointer<CompositeKey const>, Database*) ()
#4  0x00007ff6dab8fe16 in Database::open(QString const&, QSharedPointer<CompositeKey const>, QString*) ()
#5  0x00007ff6dac346ea in DatabaseOpenWidget::clearForms() ()
#6  0x00007ff6dac3427b in DatabaseOpenWidget::load(QString const&) ()
#7  0x00007ff6dac082a3 in DatabaseWidget::lock() ()
#8  0x00007ff6dabd3b6e in DatabaseTabWidget::lockDatabases() ()
#9  0x00007ff6dab5e443 in MainWindow::handleScreenLock() ()
#10 0x00007ffc87d1fd8d in void doActivate<false>(QObject*, int, void**) () from C:\msys64\clang64\bin\Qt5Core.dll
#11 0x00007ffc87d1fd8d in void doActivate<false>(QObject*, int, void**) () from C:\msys64\clang64\bin\Qt5Core.dll
#12 0x00007ff6dacfbdc3 in ScreenLockListenerWin::nativeEventFilter(QByteArray const&, void*, long*) ()
#13 0x00007ffc87ce8b73 in QAbstractEventDispatcher::filterNativeEvent(QByteArray const&, void*, long*) ()
   from C:\msys64\clang64\bin\Qt5Core.dll
#14 0x00007ffc87d40621 in QEventDispatcherWin32::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from C:\msys64\clang64\bin\Qt5Core.dll
#15 0x00007ffcb299fef5 in QWindowsGuiEventDispatcher::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from C:\msys64\clang64\share\qt5\plugins\platforms\qwindows.dll
#16 0x00007ffc87ce9d35 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from C:\msys64\clang64\bin\Qt5Core.dll
#17 0x00007ffc87ced07d in QCoreApplication::exec() () from C:\msys64\clang64\bin\Qt5Core.dll
#18 0x00007ff6dab33761 in main ()

@droidmonkey
Copy link
Member

Yup that is what I was thinking, I found that code and changed it, couldn't reproduce the crash yet.

droidmonkey added a commit that referenced this issue Mar 17, 2024
* Fixes #10455
* Fixes #10432
* Fixes #10415

Prevent setting critical key components to nullptr when database data is cleared. This can result in a crash due to race condition between threads.

Added a bunch of asserts to detect this problem and if guards to prevent actual crashes.
droidmonkey added a commit that referenced this issue Mar 31, 2024
* Fixes #10455
* Fixes #10432
* Fixes #10415

Prevent setting critical key components to nullptr when database data is cleared. This can result in a crash due to race condition between threads.

Added a bunch of asserts to detect this problem and if guards to prevent actual crashes.
@Uj947nXmRqV2nRaWshKtHzTvckUUpD
Copy link

Uj947nXmRqV2nRaWshKtHzTvckUUpD commented Mar 31, 2024

i got similar error after resuming from sleep

image

on 2.7.7
only happens sometimes, not after each resume

@droidmonkey
Copy link
Member

It's all the same, thank you. Fixed in the linked PR.

droidmonkey added a commit that referenced this issue Mar 31, 2024
* Fixes #10455
* Fixes #10432
* Fixes #10415

Prevent setting critical key components to nullptr when database data is cleared. This can result in a crash due to race condition between threads.

Added a bunch of asserts to detect this problem and if guards to prevent actual crashes.
droidmonkey added a commit that referenced this issue Apr 1, 2024
* Fixes #10455
* Fixes #10432
* Fixes #10415

Prevent setting critical key components to nullptr when database data is cleared. This can result in a crash due to race condition between threads.

Added a bunch of asserts to detect this problem and if guards to prevent actual crashes.
droidmonkey added a commit that referenced this issue Apr 1, 2024
* Fixes #10455
* Fixes #10432
* Fixes #10415

Prevent setting critical key components to nullptr when database data is cleared. This can result in a crash due to race condition between threads.

Added a bunch of asserts to detect this problem and if guards to prevent actual crashes.
droidmonkey added a commit that referenced this issue Apr 1, 2024
* Fixes #10455
* Fixes #10432
* Fixes #10415

Prevent setting critical key components to nullptr when database data is cleared. This can result in a crash due to race condition between threads.

Added a bunch of asserts to detect this problem and if guards to prevent actual crashes.
pull bot pushed a commit to tigerwill90/keepassxc that referenced this issue Apr 13, 2024
* Fixes keepassxreboot#10455
* Fixes keepassxreboot#10432
* Fixes keepassxreboot#10415

Prevent setting critical key components to nullptr when database data is cleared. This can result in a crash due to race condition between threads.

Added a bunch of asserts to detect this problem and if guards to prevent actual crashes.
pull bot pushed a commit to shashinma/keepassxc that referenced this issue Apr 13, 2024
* Fixes keepassxreboot#10455
* Fixes keepassxreboot#10432
* Fixes keepassxreboot#10415

Prevent setting critical key components to nullptr when database data is cleared. This can result in a crash due to race condition between threads.

Added a bunch of asserts to detect this problem and if guards to prevent actual crashes.
droidmonkey added a commit that referenced this issue Apr 28, 2024
* Fixes #10455
* Fixes #10432
* Fixes #10415

Prevent setting critical key components to nullptr when database data is cleared. This can result in a crash due to race condition between threads.

Added a bunch of asserts to detect this problem and if guards to prevent actual crashes.
droidmonkey added a commit that referenced this issue Apr 29, 2024
* Fixes #10455
* Fixes #10432
* Fixes #10415

Prevent setting critical key components to nullptr when database data is cleared. This can result in a crash due to race condition between threads.

Added a bunch of asserts to detect this problem and if guards to prevent actual crashes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants