Bug 413767 - libktorrent isn't a thread-safe
Summary: libktorrent isn't a thread-safe
Status: RESOLVED LATER
Alias: None
Product: ktorrent
Classification: Applications
Component: general (other bugs)
Version First Reported In: 5.1
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Joris Guisson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-03 10:07 UTC by Alexander Trufanov
Modified: 2020-10-30 08:56 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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