Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Receiving thread uses 100% CPU #2954

Open
yomnes0 opened this issue May 21, 2024 · 0 comments
Open

[BUG] Receiving thread uses 100% CPU #2954

yomnes0 opened this issue May 21, 2024 · 0 comments
Labels
[core] Area: Changes in SRT library core Type: Bug Indicates an unexpected problem or unintended behavior
Milestone

Comments

@yomnes0
Copy link
Collaborator

yomnes0 commented May 21, 2024

When using group connection and profiling, one of the reiceiver thread can reach 100% CPU comsuption

To Reproduce

  • Build srt-xtransmit with the following configuration :

cmake ../ -DCMAKE_BUILD_TYPE=Release -DENABLE_ENCRYPTION=ON -DUSE_ENCLIB=openssl -DENABLE_BONDING=ON -DENABLE_PROFILE=ON

  • Run xtransmit as follows :

./srt-xtransmit receive "srt://:4200?groupconnect=1" "srt://:5200?groupconnect=1"

./srt-xtransmit generate "srt://127.0.0.1:5200" "srt://127.0.0.1:4200" --sendrate 10Mbps

  • Watch cpu usage with

top -H -p receiver_pid

The bug is reproducible even faster using AES encryption. It however seems to be reproducible only in some environments, such as raspberry pi 2b using ubuntu 22.04.

Expected behavior
CPU should not reach 100%

Screenshots

Screenshot_110

Screenshot_111

Desktop (please provide the following information):

  • OS: Ubuntu 24.04 LTS 64bit on raspberry pi 2b
  • SRT Version / commit ID: cf13200 from Master (19/04/24)

Additional context
There seems to be a race condition of some sort. During my tests, I could see "deadlocks" happenning at random time, sometimes during the handshake process, sometimes when reading a packet, and so on. One example is shown in the attached results from perf.

Issue is more common at lower bitrate (faster to reproduce at 10mbps rather than 50mbps). It has not yet been observed in a production environment with profiling disabled.

image (2)

@yomnes0 yomnes0 added the Type: Bug Indicates an unexpected problem or unintended behavior label May 21, 2024
@maxsharabayko maxsharabayko added this to the v1.6.0 milestone Jun 12, 2024
@maxsharabayko maxsharabayko added the [core] Area: Changes in SRT library core label Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Type: Bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants