Bug 500563

Summary: Quitting the Proton Mail Bridge app through its tray icon causes it to segfault
Product: [Frameworks and Libraries] frameworks-kstatusnotifieritem Reporter: Guilherme Silva <oguilherme>
Component: generalAssignee: Alexander Lohnau <alexander.lohnau>
Status: RESOLVED DUPLICATE    
Severity: crash CC: john.kizer
Priority: NOR    
Version First Reported In: 6.11.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Guilherme Silva 2025-02-22 06:46:53 UTC
SUMMARY
I am not sure if I'm filing this bug in the proper place, but I am at least sure that is KDE specific, because the reproduction rate is 5/5 on KDE, but 0/5 on the COSMIC desktop, with their own system tray implementation.

STEPS TO REPRODUCE
1. Be on Arch Linux (not sure if other distros provide a package for Proton Mail Bridge)
2. Install protonmail-bridge: sudo pacman -S protonmail-bridge
3. Run the GUI app via terminal: protonmail-bridge
4. Once the tray icon loads, right click on it and choose "Quit Bridge"

OBSERVED RESULT
On KDE, Proton Mail Bridge crashes with SIGSEGV.

EXPECTED RESULT
No crash.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.3.1
KDE Frameworks Version: 6.11.0
Qt Version: 6.8.2
Kernel Version: 6.13.3-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 4 × Intel® Core™ i5-3570K CPU @ 3.40GHz
Memory: 15,6 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 660
Manufacturer: INTEL
Product Name: B75

ADDITIONAL INFORMATION

gdb backtrace:

(gdb) bt full
#0  0x00007ed6079552bb in QCoreApplicationPrivate::deref (this=0x7ed607ff6ac0 <main_arena>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:2089
#1  QCoreApplicationPrivate::deref (this=0x7ed607ff6ac0 <main_arena>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:2085
#2  0x00007ed607960a31 in operator()<QCoreApplication*> (__closure=<synthetic pointer>, p=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:424
#3  QEventLoopLocker::visit<QEventLoopLocker::~QEventLoopLocker()::<lambda(auto:40)> > (this=0x5cc46db96990, f=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:448
        ptr = <optimized out>
        ptr = <optimized out>
#4  QEventLoopLocker::~QEventLoopLocker (this=this@entry=0x5cc46db96990, this=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:424
#5  0x00007ed600a825b7 in KStatusNotifierItemPrivate::~KStatusNotifierItemPrivate (this=0x5cc46db96790, this=<optimized out>)
    at /usr/src/debug/kstatusnotifieritem/kstatusnotifieritem-6.11.0/src/kstatusnotifieritemprivate_p.h:94
#6  std::default_delete<KStatusNotifierItemPrivate>::operator() (this=<optimized out>, __ptr=0x5cc46db96790) at /usr/include/c++/14.2.1/bits/unique_ptr.h:93
#7  std::default_delete<KStatusNotifierItemPrivate>::operator() (this=<optimized out>, __ptr=0x5cc46db96790) at /usr/include/c++/14.2.1/bits/unique_ptr.h:87
#8  std::unique_ptr<KStatusNotifierItemPrivate, std::default_delete<KStatusNotifierItemPrivate> >::~unique_ptr (this=0x5cc46df80d50, this=<optimized out>)
    at /usr/include/c++/14.2.1/bits/unique_ptr.h:399
        __ptr = @0x5cc46df80d50: 0x5cc46db96790
        __ptr = <optimized out>
#9  KStatusNotifierItem::~KStatusNotifierItem (this=0x5cc46df80d40, this=<optimized out>) at /usr/src/debug/kstatusnotifieritem/kstatusnotifieritem-6.11.0/src/kstatusnotifieritem.cpp:86
#10 0x00007ed600a82856 in KStatusNotifierItem::~KStatusNotifierItem (this=0x5cc46df80d40, this=<optimized out>)
    at /usr/src/debug/kstatusnotifieritem/kstatusnotifieritem-6.11.0/src/kstatusnotifieritem.cpp:86
#11 0x00007ed600d8aa9f in KDEPlatformSystemTrayIcon::cleanup (this=0x5cc46df19900)
    at /usr/src/debug/plasma-integration/plasma-integration-6.3.1/qt6/src/platformtheme/kdeplatformsystemtrayicon.cpp:322
#12 0x00007ed6099e3f80 in QSystemTrayIconPrivate::remove_sys (this=0x5cc46df19b80) at /usr/src/debug/qt6-base/qtbase/src/widgets/util/qsystemtrayicon_x11.cpp:231
#13 QSystemTrayIcon::~QSystemTrayIcon (this=this@entry=0x5cc46df193f0, this=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/widgets/util/qsystemtrayicon.cpp:146
        d = 0x5cc46df19b80
        d = <optimized out>
#14 0x00005cc44b0d9073 in TrayIcon::~TrayIcon (this=0x5cc46df193f0, __in_chrg=<optimized out>)
    at /usr/src/debug/protonmail-bridge/proton-bridge/build/bridge-gui_autogen/EWIEGA46WW/../../../internal/frontend/bridge-gui/bridge-gui/TrayIcon.h:38
#15 TrayIcon::~TrayIcon (this=0x5cc46df193f0, __in_chrg=<optimized out>)
    at /usr/src/debug/protonmail-bridge/proton-bridge/build/bridge-gui_autogen/EWIEGA46WW/../../../internal/frontend/bridge-gui/bridge-gui/TrayIcon.h:38
#16 std::default_delete<TrayIcon>::operator() (this=<optimized out>, __ptr=0x5cc46df193f0) at /usr/include/c++/14.2.1/bits/unique_ptr.h:93
#17 std::unique_ptr<TrayIcon, std::default_delete<TrayIcon> >::~unique_ptr (this=0x5cc46dd27728, __in_chrg=<optimized out>) at /usr/include/c++/14.2.1/bits/unique_ptr.h:399
        __ptr = @0x5cc46dd27728: 0x5cc46df193f0
#18 QMLBackend::~QMLBackend (this=0x5cc46dd276b0, __in_chrg=<optimized out>)
    at /usr/src/debug/protonmail-bridge/proton-bridge/build/bridge-gui_autogen/EWIEGA46WW/../../../internal/frontend/bridge-gui/bridge-gui/QMLBackend.h:44
#19 0x00005cc44b0d986a in QMLBackend::~QMLBackend (this=0x5cc46dd276b0, __in_chrg=<optimized out>)
    at /usr/src/debug/protonmail-bridge/proton-bridge/internal/frontend/bridge-gui/bridge-gui/QMLBackend.h:44
#20 std::default_delete<QMLBackend>::operator() (this=<optimized out>, __ptr=0x5cc46dd276b0) at /usr/include/c++/14.2.1/bits/unique_ptr.h:93
#21 std::unique_ptr<QMLBackend, std::default_delete<QMLBackend> >::~unique_ptr (this=0x5cc44b3bbc30 <app()::app+16>, __in_chrg=<optimized out>)
    at /usr/include/c++/14.2.1/bits/unique_ptr.h:399
        __ptr = @0x5cc44b3bbc30: 0x5cc46dd276b0
#22 AppController::~AppController (this=0x5cc44b3bbc20 <app()::app>, __in_chrg=<optimized out>)
    at /usr/src/debug/protonmail-bridge/proton-bridge/internal/frontend/bridge-gui/bridge-gui/AppController.cpp:63
#23 0x00007ed607e4e391 in __run_exit_handlers (status=0, listp=0x7ed607ff6680 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:118
        atfct = <optimized out>
        onfct = <optimized out>
        cxafct = <optimized out>
        arg = <optimized out>
        f = <optimized out>
        new_exitfn_called = 940
        cur = 0x5cc46df1ee80
        restart = <optimized out>
#24 0x00007ed607e4e46e in __GI_exit (status=<optimized out>) at exit.c:148
#25 0x00007ed607e3548f in __libc_start_call_main (main=main@entry=0x5cc44b0ccbc0 <main(int, char**)>, argc=argc@entry=1, argv=argv@entry=0x7ffcf6e69f28)
    at ../sysdeps/nptl/libc_start_call_main.h:74
        result = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140724450795304, -41646222633800916, 1, 0, 139457757044736, 101998145487960, -41646222648480980, -199872587854845140}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x1, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 1}}}
        not_first_call = <optimized out>
#26 0x00007ed607e3554c in __libc_start_main_impl
    (main=0x5cc44b0ccbc0 <main(int, char**)>, argc=1, argv=0x7ffcf6e69f28, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffcf6e69f18)
    at ../csu/libc-start.c:360
#27 0x00005cc44b0ced05 in _start ()
Comment 1 John Kizer 2025-03-14 05:09:56 UTC
Hi - I can't reproduce on my Fedora KDE 41 device, installed using Proton's provided RPM package - a couple questions about possible differences:

Does the issue reproduce in a Wayland session?

Does the issue reproduce if you start the application with protonmail-bridge --software-renderer ?

Thanks!
Comment 2 Guilherme Silva 2025-03-14 05:22:51 UTC
> Does the issue reproduce in a Wayland session?

Unfortunately, I cannot verify that. I have an NVIDIA GTX 660 so I'm limited to the 470xx driver, which has no Wayland support.

> Does the issue reproduce if you start the application with protonmail-bridge --software-renderer ?

Yes, the crash is still reproducible with --software-renderer.

Thank you!
Comment 3 John Kizer 2025-05-26 04:54:39 UTC
Merging this in with what appears to be a separate report of the same underlying crash. Thanks!

*** This bug has been marked as a duplicate of bug 500322 ***