]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Print a message if shadow memory cannot be allocated, rather than just
authorNicholas Nethercote <n.nethercote@gmail.com>
Mon, 30 Aug 2004 19:36:42 +0000 (19:36 +0000)
committerNicholas Nethercote <n.nethercote@gmail.com>
Mon, 30 Aug 2004 19:36:42 +0000 (19:36 +0000)
asserting.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2629

coregrind/vg_main.c

index 0b28677bed91ab557520b5e65fdbdf2e8ac501c2..70b8dfb680a08cab22e71184890b2784768d6f0d 100644 (file)
@@ -494,7 +494,13 @@ static void layout_remaining_space(Addr argc_addr, float ratio)
    if (shadow_size != 0) {
       vres = mmap((char *)VG_(shadow_base), shadow_size, PROT_NONE,
                   MAP_PRIVATE|MAP_ANON|MAP_FIXED, -1, 0);
-      vg_assert((void*)-1 != vres);
+      if ((void*)-1 == vres) {
+         fprintf(stderr, 
+          "valgrind: Couldn't allocate address space for shadow memory\n"
+          "valgrind: Are you using a kernel with a small user address space,\n"
+          "valgrind: or do you have your virtual memory size limited?\n");
+         exit(1);
+      }
    }
 }