Bug 405702

Summary: kdeconnectd crashes if Android permissions are changed while devices are un-paired
Product: [Applications] kdeconnect Reporter: Simon Redman <simon>
Component: commonAssignee: Albert Vaca Cintora <albertvaka>
Status: RESOLVED FIXED    
Severity: crash CC: e.duisters1, nicolas.fella, simon
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: gdb backtrace of crash

Description Simon Redman 2019-03-20 21:08:28 UTC
SUMMARY
kdeconnectd crashes when the daemon is paired to Android, some permissions are granted to the Android app, then the devices are unpaired, some permissions are revoked, and the devices are re-paired.

STEPS TO REPRODUCE
1. Pair Android and desktop
2. Grant at least one permission to Android app (it does not seem to matter which)
3. Un-pair the phone and the desktop (do *not* kill the running kdeconnectd)
4. Go to Android settings and revoke at least one permission
5. Re-pair Android and desktop

OBSERVED RESULT
kdeconnectd crashes with an error message along the lines of:
sock_file=/run/user/1000/kdeinit5__0
QSocketNotifier: Invalid socket 8 and type 'Read', disabling...                                   
QSocketNotifier: Invalid socket 11 and type 'Read', disabling...                                  
QSocketNotifier: Invalid socket 10 and type 'Read', disabling...                                  
QSocketNotifier: Invalid socket 15 and type 'Read', disabling...

EXPECTED RESULT
kdeconnectd should not crash

SOFTWARE/OS VERSIONS
Windows: Untested
Linux/KDE Plasma: Fedora 29
KDE Plasma Version: 5.14.5
KDE Frameworks Version: 5.55.0
Qt Version: 5.11.3

ADDITIONAL INFORMATION
Intially reported here: https://invent.kde.org/kde/kdeconnect-kde/commit/74ba660cad19fd47589018e6cde3dfeda012d6f2 but does not appear to have to do with that commit. If I disable the questionable code from that commit, the crash still happens.

It does not seem to matter which permissions are granted, any single one being revoked causes the crash for me.
Comment 1 Erik Duisters 2019-03-21 12:58:11 UTC
Created attachment 118959 [details]
gdb backtrace of crash
Comment 2 Erik Duisters 2019-03-21 13:02:20 UTC
The crash does not happen every time but close to it. SMSPlugin crashes when calling oldInterface->deleteLater() see attachment
Comment 3 Erik Duisters 2019-07-20 13:16:06 UTC
Fixed by commit 362b0ba2e2607678b3915bf385b5feac1867e86c