public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bkorb at gnu dot org" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sources.redhat.com
Subject: [Bug libc/12232] setrlimit interferes with malloc
Date: Fri, 07 Jan 2011 23:31:00 -0000	[thread overview]
Message-ID: <bug-12232-131-FXYDF67dC1@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-12232-131@http.sourceware.org/bugzilla/>

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

--- Comment #11 from Bruce Korb <bkorb at gnu dot org> 2011-01-07 23:31:06 UTC ---
One more data point.  The following program does not show
the problem.  So, calling free(malloc(0x88)) clears the issue
and the following code doesn't stumble.

#define NUM_ROUNDS 1000
#define MAX_ALLOC_ROUND 10000
#define MAX_ALLOC_TOTAL (NUM_ROUNDS * MAX_ALLOC_ROUND)

int
main(int argc, char ** argv)
{
    struct rlimit limit;
    if (getrlimit (RLIMIT_AS, &limit) < 0)
        return 77;
    if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > MAX_ALLOC_TOTAL)
        limit.rlim_max = MAX_ALLOC_TOTAL;
    limit.rlim_cur = limit.rlim_max;
    if (setrlimit (RLIMIT_AS, &limit) < 0)
        return 77;
    if (dprintf (STDOUT_FILENO, "%011000d\n", 17) == -1
        && errno == ENOMEM)
        return 1;

    return 0;
}

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


  parent reply	other threads:[~2011-01-07 23:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-18 16:47 [Bug libc/12232] New: " bkorb at gnu dot org
2010-11-18 19:02 ` [Bug libc/12232] " drepper.fsp at gmail dot com
2010-11-18 20:14 ` bkorb at gnu dot org
2010-11-18 20:27 ` jakub at redhat dot com
2010-11-18 20:39 ` drepper.fsp at gmail dot com
2010-11-18 20:56 ` bkorb at gnu dot org
2010-11-18 21:00 ` bkorb at gnu dot org
2010-11-22 12:38 ` roucaries.bastien+bugs at gmail dot com
2010-11-23 16:00 ` bkorb at gnu dot org
2011-01-07 22:26 ` bkorb at gnu dot org
2011-01-07 23:24 ` bkorb at gnu dot org
2011-01-07 23:31 ` bkorb at gnu dot org [this message]
2011-01-08 14:32 ` drepper.fsp at gmail dot com
2011-01-08 21:32 ` roucaries.bastien+bugs at gmail dot com
2011-01-09 17:52 ` bkorb at gnu dot org
2011-01-09 17:53 ` bkorb at gnu dot org
2011-01-09 17:54 ` bkorb at gnu dot org
2011-01-09 18:59 ` bkorb at gnu dot org
2011-01-10  1:25 ` bkorb at gnu dot org
2011-01-10  3:19 ` drepper.fsp at gmail dot com
2011-01-10 16:00 ` bkorb at gnu dot org
2014-06-30  6:27 ` fweimer 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=bug-12232-131-FXYDF67dC1@http.sourceware.org/bugzilla/ \
    --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).