<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<title></title>
<style type="text/css">code{white-space: pre;}</style>
</head>
<body>
<p>Hi Andreas Luik,</p>
<p>It is far more appropriate using our tracker to report bugs, could you please migrate the information posted here on the <em>mailing-list</em> to the below:</p>
<ul>
<li>https://trac.videolan.org/vlc</li>
</ul>
<p>On 2016-12-13 10:53, Andreas Luik wrote:</p>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<pre><code> Hello,
bug report for vlc-2.1.6 (also in latest 2.2.4): we use libvlccore
in one thread of our multi-threaded application, and observe the
function vlc_getProxyUrl() to (often) hang forever in this loop:
while (waitpid(pid, &(int){ 0 }, 0) == -1);
The reason for this is that another thread might have already
handled the wait(), and the process "pid" does not exist anymore,
resulting in waitpid(pid) returning -1 (with errno==ECHILD) forever.
It definitely does not make sense to repeat calling waitpid for a
pid which does not exist anymore. Proposed patch is attached.
BTW: the second parameter of waitpid() might be simplified to (int
*)NULL.
Kind regards,
--
i. A. Andreas Luik
Senior System Integrator
in-innovative navigation GmbH
phone: +49 7154 807171
fax: +49 7154 807154
email: Andreas.Luik@innovative-navigation.de
in-innovative navigation GmbH, Leibnizstrasse 11, D-70806 Kornwestheim
Geschäftsführer/Managing Directors:
Dr. Thomas Gern, Dr. Martin Sandler, Dr. Reinhard Zimmermann, Uwe Vögele
Handelsregister: Stuttgart HRB 205770
in-innovative navigation GmbH is ISO 9001:2008 certified. </code></pre>
</blockquote>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<pre><code> *** ./src/posix/netconf.c.orig 2015-02-02 20:42:32.000000000 +0100
--- ./src/posix/netconf.c 2016-12-13 10:48:33.175593341 +0100
***************
*** 94,100 ****
while (len < sizeof (buf));
close(fd[0]);
! while (waitpid(pid, &(int){ 0 }, 0) == -1);
if (len >= 9 && !strncasecmp(buf, "direct://", 9))
return NULL;
--- 94,100 ----
while (len < sizeof (buf));
close(fd[0]);
! while (waitpid(pid, &(int){ 0 }, 0) == -1 && errno != ECHILD);
if (len >= 9 && !strncasecmp(buf, "direct://", 9))
return NULL;</code></pre>
</blockquote>
<p>The proposed patch <em>LGTM</em>, it should however be noted that you can send such patches directly to the mailing-list (ready for merge) by utilizing <code>git format-patch</code> + <code>git send-email</code>.</p>
<p>Best Regards,<br />
Filip Roséen</p>
</body>
</html>