Bug 493505

Summary: Unhandled exception causing crash after multicast leak changes in GrapheneOS
Product: [Applications] kdeconnect Reporter: matchboxbananasynergy
Component: android-applicationAssignee: Albert Vaca Cintora <albertvaka>
Status: REPORTED ---    
Severity: crash CC: andrew.g.r.holmes
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Android   
OS: Android 14.x   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description matchboxbananasynergy 2024-09-22 21:20:56 UTC
SUMMARY

KDE Connect not properly handling exception.

GrapheneOS is currently working on resolving various upstream Android leaks with multicast. As part of that work, KDE Connect start crashing for people. The changes have been reverted for the time being as we work to resolve app compatibility issues, however the error below can be sorted by gracefully handling the exception.

"java.lang.RuntimeException: Unable to create service
org.kde.kdeconnect.BackgroundService: java.lang.RuntimeException: java.net.SocketException: setsockopt failed: EPERM (Operation not permitted)"

My understanding from the information that has been relayed to me, this is where the issue lies:

https://invent.kde.org/network/kdeconnect-android/-/blob/master/src/org/kde/kdeconnect/Backends/LanBackend/LanLinkProvider.java?ref_type=heads#L302

STEPS TO REPRODUCE

To reproduce the issue, you would likely need to be on a version of GrapheneOS with the changes that have since been reverted, but we still believe that handling the exception above gracefully is important.

OBSERVED RESULT

The app crashes.

EXPECTED RESULT

The app should handle the exception and not crash.