public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pasky at suse dot cz" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sources.redhat.com
Subject: [Bug nscd/5381] nscd: Race condition of mempool_alloc() .. cache_add() and gc()
Date: Sat, 22 Nov 2008 11:09:00 -0000	[thread overview]
Message-ID: <20081122110835.7311.qmail@sourceware.org> (raw)
In-Reply-To: <20071121045836.5381.pasky@suse.cz>


------- Additional Comments From pasky at suse dot cz  2008-11-22 11:08 -------
The current fix is not really working at all, since the mem_in_flight_list
checking in gc() is incomplete. You do mark these areas as used during garbage
collect, but then if you actually hit them, you do not handle the case at all,
since you assume you always hit either hash entry or data.

We cannot move a mem_in_flight_list entry around since we use the pointers in
the cacheadd routines.  Options:

(i) Cover the cacheadd routines with wider-span locks

(ii) Break the shifts on such an entry:

moves->size = off_alloc - off_alloc_start
off_free = off_allocend
disp = 0

I still think the (i) is simpler, but even (ii) should be ok, since typically,
the mem_in_flight entries will be at the top of the garbage-collected area and
thus on the next garbage collect we will shake them down.

I didn't have time to come up with an actual patch yet, I will do that next week
unless you beat me to it (or point out any mistake).

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


http://sourceware.org/bugzilla/show_bug.cgi?id=5381

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


  parent reply	other threads:[~2008-11-22 11:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-21  4:58 [Bug nscd/5381] New: " pasky at suse dot cz
2007-11-21  4:59 ` [Bug nscd/5381] " pasky at suse dot cz
2007-12-15  9:39 ` ismail at pardus dot org dot tr
2008-04-19 17:36 ` drepper at redhat dot com
2008-11-22 11:09 ` pasky at suse dot cz [this message]
2008-11-26 13:41 ` pasky at suse dot cz
2008-11-26 13:42 ` pasky at suse dot cz
2008-11-26 16:12 ` drepper at redhat dot com
2008-11-26 21:51 ` pasky at suse dot cz
2009-01-16 15:37 ` pasky at suse dot cz
2009-02-13 20:37 ` drepper at redhat dot com

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=20081122110835.7311.qmail@sourceware.org \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sources.redhat.com \
    /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).