public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: David Daney <ddaney@avtrex.com>
Cc: java-patches@gcc.gnu.org
Subject: Re: [Patch] PR 31228, Fix close-on-exec race.
Date: Tue, 20 Mar 2007 22:12:00 -0000	[thread overview]
Message-ID: <m34pofd1dg.fsf@localhost.localdomain> (raw)
In-Reply-To: <460058DA.7090300@avtrex.com>

>>>>> "David" == David Daney <ddaney@avtrex.com> writes:

David> Make the accept non-blocking, and do a select/poll on the
David> ServerSocket. That way the accept would never block and you could use
David> a mutex.

Yeah.  I hadn't thought of the accept case, thanks.

David> This makes me think that ld.so is probably broken also.  When we do
David> dlopen ld.so opens the library file and does several mmaps before
David> closing the file descriptor.  These could leak out as well.

Not to mention other places that libc may create fds.

On some platforms fdwalk(3) can be used to make this close loop more
efficient.  There's also closefrom(3).  Linux doesn't seem to have
either of these, but Solaris does.

Tom

  reply	other threads:[~2007-03-20 22:12 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-19  7:03 David Daney
2007-03-20 21:25 ` Tom Tromey
2007-03-20 21:37   ` David Daney
2007-03-20 21:57     ` David Daney
2007-03-20 22:12       ` Tom Tromey [this message]
2007-03-20 22:24         ` David Daney
2007-03-21 10:10         ` Andrew Haley
2007-03-21 17:34         ` David Daney
2007-03-21 17:39           ` David Daney
2007-03-21 17:54           ` Andrew Haley
2007-03-21 22:31             ` David Daney
2007-03-22 10:46               ` Andrew Haley
2007-03-23  0:12                 ` David Daney
2007-03-23  1:16                   ` David Daney
2007-03-23 20:01                     ` Tom Tromey
2007-03-23 20:22                       ` David Daney
2007-03-26  0:10                         ` Mark Mitchell
2007-03-26  3:37                           ` David Daney
2007-03-26  5:41                             ` Mark Mitchell
2007-03-26  6:11                               ` David Daney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m34pofd1dg.fsf@localhost.localdomain \
    --to=tromey@redhat.com \
    --cc=ddaney@avtrex.com \
    --cc=java-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).