[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Re: [5578] Increase default IO timeout from 10ms to 5s
From: |
Jamie Lokier |
Subject: |
Re: [Qemu-devel] Re: [5578] Increase default IO timeout from 10ms to 5s |
Date: |
Wed, 5 Nov 2008 23:38:09 +0000 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
Daniel P. Berrange wrote:
> > To be exact, it *was* possible for glibc to implement a pselect
> > free of races: that is by using the same trick as your patch,
> > i.e. making a pipe and adding it to select()ed fd's and mangling
> > the sigmask.
>
> Yes & no. The trouble with glibc using pipes behind your back is that
> then it creates a totally different race in threaded apps, where a FD
> could be leaked to a child process between glibc opening its secret
> pipe and setting the O_CLOSEXEC flag. Indeed it already suffers from
> this problem with name resolving
That involves wrapping every signal handler too, and because of
threads, handlers would need to be wrapped all the time by a
sigaction() replacement - quite a lot of cruft in libc would be
required!
If you're writing libc, and willing to go to such crazy lengths to
implement pselect() "properly", you can fix the close-on-exec race by
wrapping execve() too.
Or you can avoid close-on-exec by using siglongjmp() from the wrapped
signal handlers to jump out of select(), not requiring an fd at all.
Unsurprisingly no libc that I know goes to these lengths.
-- Jamie
- Re: [Qemu-devel] Re: [5578] Increase default IO timeout from 10ms to 5s, (continued)
- Re: [Qemu-devel] Re: [5578] Increase default IO timeout from 10ms to 5s, Jamie Lokier, 2008/11/05
- Re: [Qemu-devel] Re: [5578] Increase default IO timeout from 10ms to 5s, M. Warner Losh, 2008/11/05
- Re: [Qemu-devel] Re: [5578] Increase default IO timeout from 10ms to 5s, Jan Kiszka, 2008/11/05
- Re: [Qemu-devel] Re: [5578] Increase default IO timeout from 10ms to 5s, Daniel P. Berrange, 2008/11/05
- Re: [Qemu-devel] Re: [5578] Increase default IO timeout from 10ms to 5s, andrzej zaborowski, 2008/11/05
- Re: [Qemu-devel] Re: [5578] Increase default IO timeout from 10ms to 5s, Daniel P. Berrange, 2008/11/05
- Re: [Qemu-devel] Re: [5578] Increase default IO timeout from 10ms to 5s,
Jamie Lokier <=
- Re: [Qemu-devel] Re: [5578] Increase default IO timeout from 10ms to 5s, Jamie Lokier, 2008/11/05
- Re: [Qemu-devel] Re: [5578] Increase default IO timeout from 10ms to 5s, M. Warner Losh, 2008/11/06
- Re: [Qemu-devel] Re: [5578] Increase default IO timeout from 10ms to 5s, Avi Kivity, 2008/11/04