{"action":"created","issue":{"url":"https://api.github.com/repos/kodi-pvr/pvr.hts/issues/264","repository_url":"https://api.github.com/repos/kodi-pvr/pvr.hts","labels_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/issues/264/labels{/name}","comments_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/issues/264/comments","events_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/issues/264/events","html_url":"https://github.com/kodi-pvr/pvr.hts/issues/264","id":198370554,"number":264,"title":"Crash when too many subtitle streams","user":{"login":"popcornmix","id":1053730,"avatar_url":"https://avatars.githubusercontent.com/u/1053730?v=3","gravatar_id":"","url":"https://api.github.com/users/popcornmix","html_url":"https://github.com/popcornmix","followers_url":"https://api.github.com/users/popcornmix/followers","following_url":"https://api.github.com/users/popcornmix/following{/other_user}","gists_url":"https://api.github.com/users/popcornmix/gists{/gist_id}","starred_url":"https://api.github.com/users/popcornmix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/popcornmix/subscriptions","organizations_url":"https://api.github.com/users/popcornmix/orgs","repos_url":"https://api.github.com/users/popcornmix/repos","events_url":"https://api.github.com/users/popcornmix/events{/privacy}","received_events_url":"https://api.github.com/users/popcornmix/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-01-02T18:56:29Z","updated_at":"2017-01-03T09:02:11Z","closed_at":null,"body":"I was looking into crash reported here:\r\nhttps://discourse.osmc.tv/t/tv-channel-crashes/21206/15\r\n\r\nI think this is the key bit of info:\r\n> Is it possible that the channel has too many streams in it (24)? There are many subtitle streams (16-18).\r\nI've played around with TVHeadend and figured out, that the problem is indeed the large number of Subtitle tracks. If I filter some of them out on the server side, then Kodi will play it nicely.\r\nIt is not a problem when recording to a file, because TVHeadend detects that there is no more stream space available and trims some of the subtitle streams.\r\n\r\nI can reproduce issue and crash occurs in pvr.hts (built from current master of this repo):\r\n```Program terminated with signal SIGSEGV, Segmentation fault.\r\n#0  _M_lower_bound (this=<optimized out>, __k=@0x619feba0: 94210, __y=0xee2b5a06, __x=<optimized out>)\r\n    at /home/dc4/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.9.3/bits/stl_tree.h:1261\r\n1261\t/home/dc4/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.9.3/bits/stl_tree.h: No such file or directory.\r\n(gdb) bt\r\n#0  _M_lower_bound (this=<optimized out>, __k=@0x619feba0: 94210, __y=0xee2b5a06, __x=<optimized out>)\r\n    at /home/dc4/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.9.3/bits/stl_tree.h:1261\r\n#1  lower_bound (__k=@0x619feba0: 94210, this=0x7460bb0c) at /home/dc4/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.9.3/bits/stl_tree.h:927\r\n#2  lower_bound (__x=@0x619feba0: 94210, this=0x7460bb0c) at /home/dc4/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.9.3/bits/stl_map.h:902\r\n#3  operator[] (__k=<unknown type in /opt/xbmc-cmake/arm-linux-gnueabihf/lib/kodi/addons/pvr.hts/pvr.hts.so.4.0.1, CU 0x3a553, DIE 0x54955>, this=0x7460bb0c)\r\n    at /home/dc4/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.9.3/bits/stl_map.h:516\r\n#4  CHTSPDemuxer::ParseSubscriptionStart (this=this@entry=0x7460b5b0, m=0x17002, m@entry=0x68416880) at /home/dc4/xbmc_holder/pvr.hts/src/HTSPDemuxer.cpp:456\r\n#5  0x70832e50 in CHTSPDemuxer::ProcessMessage (this=this@entry=0x7460b5b0, method=method@entry=0x67332980 \"subscriptionStart\", m=m@entry=0x68416880)\r\n    at /home/dc4/xbmc_holder/pvr.hts/src/HTSPDemuxer.cpp:336\r\n#6  0x7083a0b4 in CTvheadend::ProcessMessage (this=<optimized out>, method=method@entry=0x67332980 \"subscriptionStart\", msg=msg@entry=0x68416880) at /home/dc4/xbmc_holder/pvr.hts/src/Tvheadend.cpp:1406\r\n#7  0x70827bc8 in CHTSPConnection::ReadMessage (this=0x92c, this@entry=0x74603c18) at /home/dc4/xbmc_holder/pvr.hts/src/HTSPConnection.cpp:324\r\n#8  0x708291f4 in CHTSPConnection::Process (this=0x74603c18) at /home/dc4/xbmc_holder/pvr.hts/src/HTSPConnection.cpp:650\r\n#9  0x7082cf44 in P8PLATFORM::CThread::ThreadHandler (_thread=0x74603c18) at /opt/xbmc-cmake/arm-linux-gnueabihf/include/p8-platform/threads/threads.h:65\r\n#10 0x76dd4e90 in start_thread (arg=0x619ff410) at pthread_create.c:311\r\n```\r\n(this is the line m_streamStat[idx] = 0;)\r\n\r\nI added some logging to see how far it gets: http://paste.ubuntu.com/23729089/\r\n```\r\nAbort0: 0/0/178956970\r\nParseSubscriptionStart: clear: 0/0/178956970\r\nParseSubscriptionStart: zero: 2/0/178956970\r\nParseSubscriptionStart: zero: 1/1/178956970\r\nParseSubscriptionStart: zero: 3/2/178956970\r\nParseSubscriptionStart: zero: 4/3/178956970\r\nParseSubscriptionStart: zero: 5/4/178956970\r\nParseSubscriptionStart: zero: 6/5/178956970\r\nParseSubscriptionStart: zero: 7/6/178956970\r\nParseSubscriptionStart: zero: 8/7/178956970\r\nParseSubscriptionStart: zero: 9/8/178956970\r\nParseSubscriptionStart: zero: 10/9/178956970\r\nParseSubscriptionStart: zero: 11/10/178956970\r\nParseSubscriptionStart: zero: 12/11/178956970\r\nParseSubscriptionStart: zero: 13/12/178956970\r\nParseSubscriptionStart: zero: 14/13/178956970\r\nParseSubscriptionStart: zero: 15/14/178956970\r\nParseSubscriptionStart: zero: 16/15/178956970\r\nParseSubscriptionStart: zero: 17/16/178956970\r\nParseSubscriptionStart: zero: 18/17/178956970\r\nParseSubscriptionStart: zero: 19/18/178956970\r\nParseSubscriptionStart: zero: 20/19/178956970\r\nParseSubscriptionStart: zero: 21/20/178956970\r\nParseSubscriptionStart: zero: 22/0/178956970\r\n```\r\nIt feels like there is some limit of around 20 streams before memory gets corrupted."},"comment":{"url":"https://api.github.com/repos/kodi-pvr/pvr.hts/issues/comments/270072372","html_url":"https://github.com/kodi-pvr/pvr.hts/issues/264#issuecomment-270072372","issue_url":"https://api.github.com/repos/kodi-pvr/pvr.hts/issues/264","id":270072372,"user":{"login":"gkovacsp","id":1654787,"avatar_url":"https://avatars.githubusercontent.com/u/1654787?v=3","gravatar_id":"","url":"https://api.github.com/users/gkovacsp","html_url":"https://github.com/gkovacsp","followers_url":"https://api.github.com/users/gkovacsp/followers","following_url":"https://api.github.com/users/gkovacsp/following{/other_user}","gists_url":"https://api.github.com/users/gkovacsp/gists{/gist_id}","starred_url":"https://api.github.com/users/gkovacsp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkovacsp/subscriptions","organizations_url":"https://api.github.com/users/gkovacsp/orgs","repos_url":"https://api.github.com/users/gkovacsp/repos","events_url":"https://api.github.com/users/gkovacsp/events{/privacy}","received_events_url":"https://api.github.com/users/gkovacsp/received_events","type":"User","site_admin":false},"created_at":"2017-01-03T09:02:10Z","updated_at":"2017-01-03T09:02:10Z","body":"Let me know if you need a test server, I can open up mine."}}
{"actor":{"display_login":"gkovacsp"}}