Bug 413767

Summary: libktorrent isn't a thread-safe
Product: [Applications] ktorrent Reporter: Alexander Trufanov <trufanovan>
Component: generalAssignee: Joris Guisson <joris.guisson>
Status: RESOLVED LATER    
Severity: normal CC: justin.zobel
Priority: NOR    
Version First Reported In: 5.1   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Alexander Trufanov 2019-11-03 10:07:52 UTC
The libktorrent runs UTPServer instance in a separate thread. Its `UTPServer::changePort(bt::Uint16 p)` may be called from another thread (main thread of KTorrent app) if someone will try to change a port setting in Settings/Network/Port.
Previously this resulted in a warning but since Kubuntu 18.04 based on Qt 5.9.5 it causes a crash of the app with 
`Thread 5 "utp::UTPServerT" received signal SIGSEGV, Segmentation fault.`

I've pushed a workaround to KTorrent project (just restarting UTPServer with a new port instead of changing a port in current instance): https://phabricator.kde.org/D13045
More tech details available in the review above.

Still we agreed to leave this bug here to not forget about this thread-safety problem in libktorrent.
Comment 1 Justin Zobel 2020-10-30 06:40:11 UTC
Alexander is this now able to be resolved since the PR was merged?
Comment 2 Alexander Trufanov 2020-10-30 08:49:59 UTC
Yes, it shall be resolved now