Bug 456696 - "QSocketNotifier: Can only be used with threads started with QThread" everywhere
Summary: "QSocketNotifier: Can only be used with threads started with QThread" everywhere
Status: REPORTED
Alias: None
Product: kde
Classification: I don't know
Component: general (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR minor
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-14 00:33 UTC by Russell Haley
Modified: 2023-09-04 01:41 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Fedora 36 upgrade transaction (593.85 KB, text/plain)
2022-07-14 00:33 UTC, Russell Haley
Details
updated package list triggering this bug (43.97 KB, text/plain)
2023-09-01 07:25 UTC, P Shao
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Russell Haley 2022-07-14 00:33:23 UTC
Created attachment 150603 [details]
Fedora 36 upgrade transaction

Many things on my system recently started printing this to stderr.  It's mostly just annoying, but it does get into the stdout of `kscreen-console json`  and make the json invalid, and having this warning showing up in my consoles all the time feels a bit dodgy.


STEPS TO REPRODUCE

1. `kioclient5 stat`

... is the shortest command I know that prints the error and exits immediately, but it's much more widespread.

OBSERVED RESULT

    QSocketNotifier: Can only be used with threads started with QThread
    kioclient5: Syntax error, not enough arguments

EXPECTED RESULT

    kioclient5: Syntax error, not enough arguments

SOFTWARE/OS VERSIONS
 
Linux/KDE Plasma: Fedora 36
KDE Plasma Version: 5.25.2
KDE Frameworks Version: 5.96.0
Qt Version: 5.15.3

ADDITIONAL INFORMATION

This shows how many times the message has been logged by various programs since boot:

    journalctl -b --output cat --output-fields=_EXE MESSAGE='QSocketNotifier: Can only be used with threads started with QThread' | sort | uniq -c | sort -nk1,1

On my machine, it prints:

      1 /usr/bin/dolphin
      1 /usr/bin/korganizer
      1 /usr/bin/kstart
      1 /usr/bin/kwrite
      1 /usr/bin/okteta
      1 /usr/bin/plasma-discover
      1 /usr/libexec/ksmserver-logout-greeter
      2 /usr/bin/akonadi_archivemail_agent
      2 /usr/bin/akonadi_birthdays_resource
      2 /usr/bin/akonadi_control
      2 /usr/bin/akonadi_followupreminder_agent
      2 /usr/bin/akonadi_indexing_agent
      2 /usr/bin/akonadi_maildispatcher_agent
      2 /usr/bin/akonadi_mailfilter_agent
      2 /usr/bin/akonadi_mailmerge_agent
      2 /usr/bin/akonadi_migration_agent
      2 /usr/bin/akonadi_newmailnotifier_agent
      2 /usr/bin/akonadi_sendlater_agent
      2 /usr/bin/akonadi_unifiedmailbox_agent
      2 /usr/bin/akonadi_vcard_resource
      2 /usr/bin/corectrl
      2 /usr/bin/kalendarac
      2 /usr/bin/kcminit_startup
      2 /usr/bin/kded5
      2 /usr/bin/ksplashqml
      2 /usr/bin/kwalletd5
      2 /usr/bin/plasmashell
      2 /usr/libexec/baloorunner
      2 /usr/libexec/DiscoverNotifier
      2 /usr/libexec/kactivitymanagerd
      2 /usr/libexec/kdeconnectd
      2 /usr/libexec/kf5/polkit-kde-authentication-agent-1
      2 /usr/libexec/org_kde_powerdevil
      2 /usr/libexec/xdg-desktop-portal-kde
      4 /usr/bin/akonadi_akonotes_resource
      4 /usr/bin/akonadi_contacts_resource
      4 /usr/bin/akonadi_ical_resource
      4 /usr/bin/akonadi_maildir_resource
      4 /usr/bin/systemsettings
     36 /usr/bin/konsole
     39 /usr/libexec/kscreenlocker_greet

According to `sudo rg --one-file-system -Suu "Can only be used with threads" --binary /usr`, the message probably comes from /usr/lib64/libQt5Core.so.5.15.3, which the top culprits link against according to `ldd`, and which is provided by the qt5-qtbase package.

According to `dnf history`, this package was updated from version 5.15.2-30 to version 5.15.3-1 as part of the Fedora 35->36 upgrade on 2022-05-12.  I have attached the `dnf history info` from that transaction.

Oddly, the logs show 59 occurances of the message from 2022-03-29, when the installed qt5-qtbase version was 5.15.2, but then it didn't appear again until many boots later on 2022-05-16, which was the SECOND (wat?) boot and login session after the Fedora 35->36 upgrade, with no intervening dnf transactions. Unfortunately, I have no logs from before 2022-03-29, because plasma-systemmonitor had some kind of fit and spammed hundreds of messages per second, which flushed the journal from before that date.

I don't know whether this is a problem with libQt or with the use of it.

This seems similar to bug 418402, but it has a much wider blast radius and seems to have started with a different version of qt5-qtbase.
Comment 1 Nate Graham 2022-07-14 15:37:01 UTC
> I don't know whether this is a problem with libQt or with the use of it.
I'm CCing some very smart people who may be able to determine which one it is.
Comment 2 Eli Asher 2022-07-31 21:58:00 UTC
(In reply to Nate Graham from comment #1)
> > I don't know whether this is a problem with libQt or with the use of it.
> I'm CCing some very smart people who may be able to determine which one it
> is.

(In reply to Russell Haley from comment #0)
> Created attachment 150603 [details]
> Fedora 36 upgrade transaction
> 
> Many things on my system recently started printing this to stderr.  It's
> mostly just annoying, but it does get into the stdout of `kscreen-console
> json`  and make the json invalid, and having this warning showing up in my
> consoles all the time feels a bit dodgy.
> 
> 
> STEPS TO REPRODUCE
> 
> 1. `kioclient5 stat`
> 
> ... is the shortest command I know that prints the error and exits
> immediately, but it's much more widespread.
> 
> OBSERVED RESULT
> 
>     QSocketNotifier: Can only be used with threads started with QThread
>     kioclient5: Syntax error, not enough arguments
> 
> EXPECTED RESULT
> 
>     kioclient5: Syntax error, not enough arguments
> 
> SOFTWARE/OS VERSIONS
>  
> Linux/KDE Plasma: Fedora 36
> KDE Plasma Version: 5.25.2
> KDE Frameworks Version: 5.96.0
> Qt Version: 5.15.3
> 
> ADDITIONAL INFORMATION
> 
> This shows how many times the message has been logged by various programs
> since boot:
> 
>     journalctl -b --output cat --output-fields=_EXE
> MESSAGE='QSocketNotifier: Can only be used with threads started with
> QThread' | sort | uniq -c | sort -nk1,1
> 
> On my machine, it prints:
> 
>       1 /usr/bin/dolphin
>       1 /usr/bin/korganizer
>       1 /usr/bin/kstart
>       1 /usr/bin/kwrite
>       1 /usr/bin/okteta
>       1 /usr/bin/plasma-discover
>       1 /usr/libexec/ksmserver-logout-greeter
>       2 /usr/bin/akonadi_archivemail_agent
>       2 /usr/bin/akonadi_birthdays_resource
>       2 /usr/bin/akonadi_control
>       2 /usr/bin/akonadi_followupreminder_agent
>       2 /usr/bin/akonadi_indexing_agent
>       2 /usr/bin/akonadi_maildispatcher_agent
>       2 /usr/bin/akonadi_mailfilter_agent
>       2 /usr/bin/akonadi_mailmerge_agent
>       2 /usr/bin/akonadi_migration_agent
>       2 /usr/bin/akonadi_newmailnotifier_agent
>       2 /usr/bin/akonadi_sendlater_agent
>       2 /usr/bin/akonadi_unifiedmailbox_agent
>       2 /usr/bin/akonadi_vcard_resource
>       2 /usr/bin/corectrl
>       2 /usr/bin/kalendarac
>       2 /usr/bin/kcminit_startup
>       2 /usr/bin/kded5
>       2 /usr/bin/ksplashqml
>       2 /usr/bin/kwalletd5
>       2 /usr/bin/plasmashell
>       2 /usr/libexec/baloorunner
>       2 /usr/libexec/DiscoverNotifier
>       2 /usr/libexec/kactivitymanagerd
>       2 /usr/libexec/kdeconnectd
>       2 /usr/libexec/kf5/polkit-kde-authentication-agent-1
>       2 /usr/libexec/org_kde_powerdevil
>       2 /usr/libexec/xdg-desktop-portal-kde
>       4 /usr/bin/akonadi_akonotes_resource
>       4 /usr/bin/akonadi_contacts_resource
>       4 /usr/bin/akonadi_ical_resource
>       4 /usr/bin/akonadi_maildir_resource
>       4 /usr/bin/systemsettings
>      36 /usr/bin/konsole
>      39 /usr/libexec/kscreenlocker_greet
> 
> According to `sudo rg --one-file-system -Suu "Can only be used with threads"
> --binary /usr`, the message probably comes from
> /usr/lib64/libQt5Core.so.5.15.3, which the top culprits link against
> according to `ldd`, and which is provided by the qt5-qtbase package.
> 
> According to `dnf history`, this package was updated from version 5.15.2-30
> to version 5.15.3-1 as part of the Fedora 35->36 upgrade on 2022-05-12.  I
> have attached the `dnf history info` from that transaction.
> 
> Oddly, the logs show 59 occurances of the message from 2022-03-29, when the
> installed qt5-qtbase version was 5.15.2, but then it didn't appear again
> until many boots later on 2022-05-16, which was the SECOND (wat?) boot and
> login session after the Fedora 35->36 upgrade, with no intervening dnf
> transactions. Unfortunately, I have no logs from before 2022-03-29, because
> plasma-systemmonitor had some kind of fit and spammed hundreds of messages
> per second, which flushed the journal from before that date.
> 
> I don't know whether this is a problem with libQt or with the use of it.
> 
> This seems similar to bug 418402, but it has a much wider blast radius and
> seems to have started with a different version of qt5-qtbase.

I encountered the same phenomenon. In addition, the standard keyboard shortcuts do not work.
Comment 3 P Shao 2023-09-01 05:17:13 UTC
I ran into exactly the same issue after an upgrade in Arch Linux from plastma 5.27.6 to 5.27.7 alone with a collection of qt-related upgrade as well :(
Comment 4 P Shao 2023-09-01 07:04:50 UTC
(In reply to Nate Graham from comment #1)
> > I don't know whether this is a problem with libQt or with the use of it.
> I'm CCing some very smart people who may be able to determine which one it
> is.

@Nate Graham, can I trouble you to escalate this issue please to see if we can get some clue? I just run into this almost exactly same issue with many KDE apps impacted. This is after a seemingly harmless upgrade from plasma 5.27.6 to 5.27.7 and minor version update of qt-5.15.10 on an Arch Linux box. Thanks.
Comment 5 P Shao 2023-09-01 07:25:27 UTC
Created attachment 161323 [details]
updated package list triggering this bug

I am attaching the package list which I updated today that introduced this bug on my Arch Linux machine
Comment 6 Fushan Wen 2023-09-01 07:28:37 UTC
Looks like a problem in Qt. in openSUSE KF was also updated but Qt wasn't, and I did not encounter the problem.
Comment 7 P Shao 2023-09-01 07:30:41 UTC
(In reply to P Shao from comment #3)
> I ran into exactly the same issue after an upgrade in Arch Linux from
> plastma 5.27.6 to 5.27.7 alone with a collection of qt-related upgrade as
> well :(

Forgot to add that this only appears to happen under KDE wayland sessions
Comment 8 P Shao 2023-09-01 07:31:50 UTC
(In reply to Fushan Wen from comment #6)
> Looks like a problem in Qt. in openSUSE KF was also updated but Qt wasn't,
> and I did not encounter the problem.

Thanks for sharing the information, any clue what it might be? I can try to downgrade some packages to test to help :)
Comment 9 P Shao 2023-09-04 01:41:28 UTC
After some fiddling around through package downgrading/upgrading, I have confirmed at least on my computer it was caused by fcitx5-qt (5.0.17-7 => 5.1.0-1), which makes sense to explain why the bug impacted so many (seemingly all) qt-based applications. I will reach out to the maintainer of the package for bug report.