From: Nicholas Nethercote Date: Mon, 30 Aug 2004 19:36:42 +0000 (+0000) Subject: Print a message if shadow memory cannot be allocated, rather than just X-Git-Tag: svn/VALGRIND_2_2_0~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78cb64cc71d73281f3841f01a6813c131e03464e;p=thirdparty%2Fvalgrind.git Print a message if shadow memory cannot be allocated, rather than just asserting. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2629 --- diff --git a/coregrind/vg_main.c b/coregrind/vg_main.c index 0b28677bed..70b8dfb680 100644 --- a/coregrind/vg_main.c +++ b/coregrind/vg_main.c @@ -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); + } } }