RFC: Too many race conditions.
Andrew Haley
aph-gcc@littlepinkcloud.COM
Sun May 20 11:00:00 GMT 2007
David Daney writes:
> I have been thinking about:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29604
>
> My inclination is to do nothing. My analysis (int the bug report),
> makes me think that to fix the race, all I/O operations would have to
> enter a synchronized block twice. This would create a tremendous
> overhead.
>
> Opinions?
Hmm. This depends, does it not, on the fact that a blocking call does
not return when a file descriptor is closed? This sounds to me like a
bug in the kernel, although perhaps it's a bug that has to be
maintained for backwards compatibility. Blocking on a closed soucket
doesn't sound to me like a fruitful activity.
Anyway, I'm with you on the "do nothing" front. Where does the bug
really lie, in the library or in the application code? Decent design
doesn't usually involve opening a socket in one thread and then
passing that socket to another thread to close. Is this an
exploitable security hole? I suppose it is.
Andrew.
More information about the Java
mailing list