On Fri, Mar 20, 2015 at 1:13 AM, Jeff Trawick <[email protected]> wrote:
> On Thu, Mar 19, 2015 at 7:44 PM, Yann Ylavic <[email protected]> wrote:
>> > --- apr/apr/trunk/test/abts_tests.h (original)
>> > +++ apr/apr/trunk/test/abts_tests.h Thu Mar 19 23:40:51 2015
>> > @@ -50,9 +50,7 @@ const struct testlist {
>> >      {testoc},
>> >      {testpath},
>> >      {testpipe},
>> > -#if 0
>> >      {testpoll},
>> > -#endif
>>
>> This test blocks infinitely on my machine (Linux 2.6.32-5-amd64 with
>> libc6 2.11.3-4+deb6u5).
>> Any other with the same issue?
>
> Umm, it seems that apr_time_from_msec(200) is turning into a long wait:
>
> (gdb) up
> #3  0x000000000041bf9e in justsleep (tc=0x7fff5995ff10, data=0x0) at
> testpoll.c:855
> 855            rv = apr_pollset_poll(pollset, apr_time_from_msec(200),
> &nsds,
>
> epoll_wait(12, {}, 5, 200)              = 0
> write(1, "\10\\", \)                    = 2
> write(1, "\10-", -)                     = 2
> write(1, "\10|", |)                     = 2
> poll(0x2657b98, 0, 200000
> ...
>
> This works for me:
>
> Index: poll/unix/poll.c
> ===================================================================
> --- poll/unix/poll.c (revision 1667903)
> +++ poll/unix/poll.c (working copy)
> @@ -258,6 +258,9 @@
>
>      ret = WSAPoll(pollset->p->pollset, pollset->nelts, (int)timeout);
>  #else
> +    if (timeout > 0) {
> +        timeout /= 1000;
> +    }
>      ret = poll(pollset->p->pollset, pollset->nelts, timeout);
>  #endif
>      (*num) = ret;
>
> --

Indeed, poll() expects msecs as well...
The strange thing is that it does not occur in 1.5.x for me (same code AFAICS).

Reply via email to