100% CPU use with many torrents announcing to a tracker with an expired certificate #12508

Open
opened 2026-02-21 22:49:19 -05:00 by deekerman · 0 comments
Owner

Originally created by @ivan on GitHub (Oct 24, 2021).

qBittorrent & operating system versions

qBittorrent: 4.3.8 x64
Operating system: NixOS 21.11-pre, NixOS 21.05
Qt: 5.15.2
libtorrent-rasterbar: 2.0.3, 2.0.4, or github.com/arvidn/libtorrent@69cb589800

Specifically, I confirmed this issue and saw the same behavior with:

  • (x86_64 NixOS) qbittorrent 4.3.8 with libtorrent github.com/arvidn/libtorrent@69cb589800
  • (x86_64 NixOS) qbittorrent 4.3.8 with libtorrent 2.0.4
  • (x86_64 NixOS) qbittorrent 4.3.5 with libtorrent 2.0.3

What is the problem?

qBittorrent/libtorrent seems to use 100% CPU (one core) when it has many torrents announcing to a tracker with an expired HTTPS certificate.

There isn't really any visible indication or logging that indicates the problem, I just lucked into figuring it out.

Steps to reproduce

  1. Try to download a few hundred torrents pointing to an https:// tracker with an expired certificate
  2. Make sure 'Validate HTTP tracker certificates' is enabled (the default)
  3. Observe 100% CPU use of one core, never decreasing, and strace showing one of the qbittorrent threads spinning fast on epoll_wait(15, [], 128, 0) = 0
  4. Disable 'Validate HTTP tracker certificates'
  5. Wait a few minutes and observe low CPU use
  6. Repeat to confirm if desired (enable validation, force reannounce), it should always reproduce

Additional context

with 'Validate HTTP tracker certificates':

with validation Screenshot 2021-10-24 215727

without 'Validate HTTP tracker certificates':

without validation Screenshot 2021-10-24 215649

Log(s) & preferences file(s)

No response

Originally created by @ivan on GitHub (Oct 24, 2021). ### qBittorrent & operating system versions qBittorrent: 4.3.8 x64 Operating system: NixOS 21.11-pre, NixOS 21.05 Qt: 5.15.2 libtorrent-rasterbar: 2.0.3, 2.0.4, or https://github.com/arvidn/libtorrent/commit/69cb58980001bed4f4295957b58b1aba6f4f6905 Specifically, I confirmed this issue and saw the same behavior with: - (x86_64 NixOS) qbittorrent 4.3.8 with libtorrent https://github.com/arvidn/libtorrent/commit/69cb58980001bed4f4295957b58b1aba6f4f6905 - (x86_64 NixOS) qbittorrent 4.3.8 with libtorrent 2.0.4 - (x86_64 NixOS) qbittorrent 4.3.5 with libtorrent 2.0.3 ### What is the problem? qBittorrent/libtorrent seems to use 100% CPU (one core) when it has many torrents announcing to a tracker with an expired HTTPS certificate. There isn't really any visible indication or logging that indicates the problem, I just lucked into figuring it out. ### Steps to reproduce 1. Try to download a few hundred torrents pointing to an https:// tracker with an expired certificate 2. Make sure 'Validate HTTP tracker certificates' is enabled (the default) 3. Observe 100% CPU use of one core, never decreasing, and `strace` showing one of the qbittorrent threads spinning fast on `epoll_wait(15, [], 128, 0) = 0` 4. Disable 'Validate HTTP tracker certificates' 5. Wait a few minutes and observe low CPU use 6. Repeat to confirm if desired (enable validation, force reannounce), it should always reproduce ### Additional context with 'Validate HTTP tracker certificates': ![with validation Screenshot 2021-10-24 215727](https://user-images.githubusercontent.com/4458/138614596-7d83dd23-5f92-4223-a246-a9e4994d6872.png) without 'Validate HTTP tracker certificates': ![without validation Screenshot 2021-10-24 215649](https://user-images.githubusercontent.com/4458/138614608-f9fe24c2-f2c7-430b-a2b3-3c4fa827834f.png) ### Log(s) & preferences file(s) _No response_
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/qBittorrent#12508
No description provided.