|
From: Jeremy F. <je...@go...> - 2004-03-09 01:06:37
|
CVS commit by fitzhardinge:
Raise RLIMIT_AS to max allowable, so that we can create the large mappings
we need to. If the hard limit is set to low, then things will fail as
large mmaps fail.
M +8 -0 stage1.c 1.8
--- valgrind/coregrind/stage1.c #1.7:1.8
@@ -39,4 +39,5 @@
#include <fcntl.h>
#include <errno.h>
+#include <sys/resource.h>
#include "vg_include.h"
@@ -197,4 +198,5 @@ static void hoops(void)
int main(int argc, char **argv)
{
+ struct rlimit rlim;
const char *cp = getenv(VALGRINDLIB);
@@ -206,4 +208,10 @@ int main(int argc, char **argv)
our_argc = argc;
+ /* Set the address space limit as high as it will go, since we make
+ a lot of very large mappings. */
+ getrlimit(RLIMIT_AS, &rlim);
+ rlim.rlim_cur = rlim.rlim_max;
+ setrlimit(RLIMIT_AS, &rlim);
+
/* move onto another stack so we can play with the main one */
ume_go((addr_t)hoops, (addr_t)stack + sizeof(stack));
|