{"id":19,"date":"2017-12-15T14:40:01","date_gmt":"2017-12-15T12:40:01","guid":{"rendered":"https:\/\/ahiru.eu\/blog\/?p=19"},"modified":"2017-12-15T14:40:01","modified_gmt":"2017-12-15T12:40:01","slug":"bug-of-the-day-2016-12-14","status":"publish","type":"post","link":"https:\/\/ahiru.eu\/blog\/2017\/12\/15\/bug-of-the-day-2016-12-14\/","title":{"rendered":"Bug of the day: 2016-12-14"},"content":{"rendered":"<p>The previous day, I was looking at the debug logs and noticed a general teardown of the pipeline (setting state to NULL, removing elements, etc) when something crashed (e.g. wrong parameters =&gt; failed to link). I was thinking it absolutely shouldn&#8217;t happen and went to fix it. I could reproduce the pipeline crashing completely, but not the teardown. In any case, I pushed some fixes for it to fail more gracefully and went to sleep.<\/p>\n<p>Next day, the pipeline started crashing for no apparent reason when I was trying to debug something else. I opened the log and, sure enough, there was a teardown. I also thought I could see some &#8220;child process killed&#8221; debug output on stdout, but that was running under screen, and &#8220;how do I scroll under screen?&#8221; should turned into &#8220;meh, that must have been just my idea, I can see the teardown here &#8211; plus I&#8217;m not getting a core dump&#8221;. I tried debugging where it could come from, but it ended up coming from a user command. However, my colleague insisted that the pipeline was just crashing.<\/p>\n<p>Upon closer inspection, I noticed two processes doing teardown simultaneously. I asked my colleague and he said &#8220;yes, I was running four RTSP previews at once, but I was only recording to a file on one channel&#8221;. I tried seeing which process had the filesink in it, and I noticed it was yet another process, the last line of which was something completely normal and non-error. At that point I scrolled up and, sure enough, the &#8220;child process killed&#8221; message was there. It was even signal 9 (SIGKILL), which explained the absence of a core dump.<\/p>\n<p>What had really happened: I was already debugging something else, so I had set debug log level to a high value. My colleague was running four channels at once, which means four different RTSP sessions, which encoded their streams four times, on a CPU encoder. When the time came for one of these four sessions to start encoding again in order to write it on the file, the machine simply couldn&#8217;t handle the load, the child process took longer than the configured timeout to respond and ended up getting killed as &#8220;probably deadlocked&#8221;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The previous day, I was looking at the debug logs and noticed a general teardown of the pipeline (setting state[&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4],"tags":[],"class_list":["post-19","post","type-post","status-publish","format-standard","hentry","category-bug-of-the-day","category-english"],"_links":{"self":[{"href":"https:\/\/ahiru.eu\/blog\/wp-json\/wp\/v2\/posts\/19","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ahiru.eu\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ahiru.eu\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ahiru.eu\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ahiru.eu\/blog\/wp-json\/wp\/v2\/comments?post=19"}],"version-history":[{"count":1,"href":"https:\/\/ahiru.eu\/blog\/wp-json\/wp\/v2\/posts\/19\/revisions"}],"predecessor-version":[{"id":20,"href":"https:\/\/ahiru.eu\/blog\/wp-json\/wp\/v2\/posts\/19\/revisions\/20"}],"wp:attachment":[{"href":"https:\/\/ahiru.eu\/blog\/wp-json\/wp\/v2\/media?parent=19"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ahiru.eu\/blog\/wp-json\/wp\/v2\/categories?post=19"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ahiru.eu\/blog\/wp-json\/wp\/v2\/tags?post=19"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}