Opened 10 years ago
Closed 10 years ago
#12395 closed Bug Report - General (fixed)
SSDP thread uses 100% CPU
Reported by: | Owned by: | stuartm | |
---|---|---|---|
Priority: | critical | Milestone: | 0.27.5 |
Component: | MythTV - UPnP | Version: | 0.27-fixes |
Severity: | high | Keywords: | |
Cc: | Ticket locked: | no |
Description
On both backend and frontend, the SSDP thread after a few minutes or hours will jump to 100% CPU and never come down.
I discovered this to be caused by a zero byte UDP packet (that some badly designed UPNP device on my network must be sending).
This can be reproduced using the following C program:
#include <sys/socket.h> #include <netinet/in.h> #include <string.h> #include <stdio.h> int main(int argc, char**argv) { int sockfd,n; struct sockaddr_in servaddr,cliaddr; char sendline[0]; sockfd=socket(AF_INET,SOCK_DGRAM,0); bzero(&servaddr,sizeof(servaddr)); servaddr.sin_family = AF_INET; servaddr.sin_addr.s_addr=inet_addr("239.255.255.250"); servaddr.sin_port=htons(1900); int len = 0; printf("Send %d bytes\n", len); sendto(sockfd,sendline,len,0,(struct sockaddr *)&servaddr,sizeof(servaddr)); }
And then running the following (on the backend, just for example)
top -H -p `pgrep mythbackend`
Change History (5)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
Milestone: | unknown → 0.27.5 |
---|---|
Owner: | changed from dblain to stuartm |
Priority: | minor → critical |
Severity: | medium → high |
Status: | new → accepted |
comment:3 Changed 10 years ago by
There's an open pull request for this https://github.com/MythTV/mythtv/pull/92
comment:5 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
Note: See
TracTickets for help on using
tickets.
I have a fork of fixes/0.27 and have coded a fix which works. I will create a pull request, but I've never submitted code to the project before.
I cannot easily test on master because this installation is currently in use. I believe the problem still exists there, and should be easily reproducible using the file in the description.
The requirements for submitting tickets and code to this project are pretty daunting for a first timer. Take it easy on me.