Hello,
We've encountered a bug in pollset wakeup pipe. With
how wakeup pipe is created now, it's possible that reading loop in
`apr_poll_drain_wakeup_pipe()` gets stuck. That could happen, if there is only a
multiple of 512 bytes in the pipe.
The problem is that reading loop in `apr_poll_drain_wakeup_pipe()` is written
with the assumption that `apr_file_read()` would never block. On Windows, where
pipes are created differently, this assumption holds. On *nix this can be fixed
with making the read end of the pipe non-blocking.
Patch attached.
Regards,
Mihaly Szjatinya
Index: poll/unix/wakeup.c
===================================================================
--- a/poll/unix/wakeup.c (revision 1894572)
+++ b/poll/unix/wakeup.c (working copy)
@@ -80,8 +80,9 @@
{
apr_status_t rv;
- if ((rv = apr_file_pipe_create(&wakeup_pipe[0], &wakeup_pipe[1],
- pool)) != APR_SUCCESS)
+ if ((rv = apr_file_pipe_create_ex(&wakeup_pipe[0], &wakeup_pipe[1],
+ APR_WRITE_BLOCK,
+ pool)) != APR_SUCCESS)
return rv;
pfd->p = pool;