Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
test-skeleton.c: Do not set RLIMIT_DATA [BZ #19648]
With older kernels, it is mostly ineffective because it causes malloc
to switch from sbrk to mmap (potentially invalidating malloc testing
compared to what real appliations do).  With newer kernels which
have switched to enforcing RLIMIT_DATA for mmap as well, some test
cases will fail in an unintended fashion because the limit which was
set previously does not include room for all mmap mappings.
  • Loading branch information
Florian Weimer committed Mar 7, 2016
1 parent 9ff72da commit 9000560
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
2016-03-07 Florian Weimer <fweimer@redhat.com>

[BZ #19648]
* test-skeleton.c (main): Do not set RLIMIT_DATA.

2016-03-07 Adhemerval Zanella <adhemerval.zanella@linaro.org> 2016-03-07 Adhemerval Zanella <adhemerval.zanella@linaro.org>


[BZ #14750] [BZ #14750]
Expand Down
17 changes: 0 additions & 17 deletions test-skeleton.c
Expand Up @@ -429,23 +429,6 @@ main (int argc, char *argv[])
setrlimit (RLIMIT_CORE, &core_limit); setrlimit (RLIMIT_CORE, &core_limit);
#endif #endif


#ifdef RLIMIT_DATA
/* Try to avoid eating all memory if a test leaks. */
struct rlimit data_limit;
if (getrlimit (RLIMIT_DATA, &data_limit) == 0)
{
if (TEST_DATA_LIMIT == RLIM_INFINITY)
data_limit.rlim_cur = data_limit.rlim_max;
else if (data_limit.rlim_cur > (rlim_t) TEST_DATA_LIMIT)
data_limit.rlim_cur = MIN ((rlim_t) TEST_DATA_LIMIT,
data_limit.rlim_max);
if (setrlimit (RLIMIT_DATA, &data_limit) < 0)
printf ("setrlimit: RLIMIT_DATA: %m\n");
}
else
printf ("getrlimit: RLIMIT_DATA: %m\n");
#endif

/* We put the test process in its own pgrp so that if it bogusly /* We put the test process in its own pgrp so that if it bogusly
generates any job control signals, they won't hit the whole build. */ generates any job control signals, they won't hit the whole build. */
if (setpgid (0, 0) != 0) if (setpgid (0, 0) != 0)
Expand Down

0 comments on commit 9000560

Please sign in to comment.