<div dir="ltr"><div class="gmail_quote">(Sending a second time, because I accidentally used a mail account not subscribed to wine-devel)<br><br><div dir="ltr">Yes, sorry. The following lines were only in v1:<br><br>--- snip ---<br>For <a href="https://bugs.winehq.org/show_bug.cgi?id=14697" target="_blank">https://bugs.winehq.org/show_bug.cgi?id=14697</a><br><br>The only disadvantage I'm aware of is that it increases the stack usage<br>on the signal stack by sizeof(sigset_t) bytes.<br>--- snip ---<div><br></div><div>Imho blocking USR1 on the server side is not a good solution, because:</div><div>* If a user somehow sends a USR1 signal manually, it would still trigger the bug</div><div>* We need code to keep track of outstanding APC results in the wineserver, and then resend USR1 after all system APCs are finished. This could easily get out of sync. Also, in server_select() we do not know if we're just in the signal handler, which would be necessary to know if an additional USR1 signal is required.</div><div><br></div><div>I'm not aware of a good way to write a test case for this, because it highly depends on the timing. All system APCs are usually finished within a few clock cycles. The only way to trigger this bug is to interrupt just while processing the APC, but before sending the result. There is no way to write a reliable test for that (and running the same test more than thousand times in a loop doesn't make it better).</div><div><br></div><div>Regards,</div><div>Sebastian</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-11-04 13:50 GMT+01:00 Alexandre Julliard <span dir="ltr"><<a href="mailto:julliard@winehq.org" target="_blank">julliard@winehq.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sebastian Lackner <<a href="mailto:sebastian@fds-team.de" target="_blank">sebastian@fds-team.de</a>> writes:<br>
<br>
> Changes in v2:<br>
>   * Do not delete the still valid comment "Return TRUE if a user APC has been run.".<br>
>     I still had this deleted from an earlier version of the patchset, where the<br>
>     return type was changed.<br>
><br>
> If a USR1 suspend signal arrives between dequeing a system APC and sending<br>
> back the result to the wineserver, a deadlock occurs. To avoid this issue<br>
> this patch blocks all signals in server_select(), except while waiting or<br>
> processing user APCs.<br>
<br>
I'm guessing this is for bug 14697?  It seems to me you could do that on<br>
the server side, by not suspending the thread while system APCs are<br>
outstanding. Also a test case demonstrating the bug would be a good<br>
first step.<span class="HOEnZb"><font color="#888888"><br>
<span><font color="#888888"><br>
--<br>
Alexandre Julliard<br>
<a href="mailto:julliard@winehq.org" target="_blank">julliard@winehq.org</a><br>
</font></span></font></span></blockquote></div><br></div>
</div><br></div>