This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.22-718-gf34f146
- From: fw at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 12 Feb 2016 12:13:18 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.22-718-gf34f146
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via f34f146e682d8d529dcf64b3c2781bf3f2f05f6c (commit)
from e535ce250143b9c1600b306911710c0de73e2a5e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f34f146e682d8d529dcf64b3c2781bf3f2f05f6c
commit f34f146e682d8d529dcf64b3c2781bf3f2f05f6c
Author: Florian Weimer <fweimer@redhat.com>
Date: Fri Feb 12 12:57:40 2016 +0100
hsearch_r: Apply VM size limit in test case
diff --git a/ChangeLog b/ChangeLog
index d45f715..5b98edd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2016-02-12 Florian Weimer <fweimer@redhat.com>
+
+ * misc/bug18240.c (do_test): Set RLIMIT_AS.
+
2016-02-11 Szabolcs Nagy <szabolcs.nagy@arm.com>
[BZ #19529]
diff --git a/misc/bug18240.c b/misc/bug18240.c
index 4b26865..773586e 100644
--- a/misc/bug18240.c
+++ b/misc/bug18240.c
@@ -22,6 +22,7 @@
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
+#include <sys/resource.h>
static void
test_size (size_t size)
@@ -58,6 +59,27 @@ test_size (size_t size)
static int
do_test (void)
{
+ /* Limit the size of the process, so that memory allocation will
+ fail without impacting the entire system. */
+ {
+ struct rlimit limit;
+ if (getrlimit (RLIMIT_AS, &limit) != 0)
+ {
+ printf ("getrlimit (RLIMIT_AS) failed: %m\n");
+ return 1;
+ }
+ long target = 100 * 1024 * 1024;
+ if (limit.rlim_cur == RLIM_INFINITY || limit.rlim_cur > target)
+ {
+ limit.rlim_cur = target;
+ if (setrlimit (RLIMIT_AS, &limit) != 0)
+ {
+ printf ("setrlimit (RLIMIT_AS) failed: %m\n");
+ return 1;
+ }
+ }
+ }
+
test_size (500);
test_size (-1);
test_size (-3);
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 4 ++++
misc/bug18240.c | 22 ++++++++++++++++++++++
2 files changed, 26 insertions(+), 0 deletions(-)
hooks/post-receive
--
GNU C Library master sources