308321 [390] testsuite memcheck filter interferes with gdb_filter
308341 [390] vgdb should report process exit (or fatal signal)
308644 [390] vgdb command for having the info for the track-fds option
+308711 [390] give more info about aspacemgr and arenas in out_of_memory
n-i-bz [390] report error for vgdb snapshot requested before execution
n-i-bz [390] Some wrong command line options could be ignored
__attribute__((noreturn))
void VG_(out_of_memory_NORETURN) ( HChar* who, SizeT szB )
{
- static Bool alreadyCrashing = False;
+ static Int outputTrial = 0;
+ // We try once to output the full memory state followed by the below message.
+ // If that fails (due to out of memory during first trial), we try to just
+ // output the below message.
+ // And then we abandon.
+
ULong tot_alloc = VG_(am_get_anonsize_total)();
Char* s1 =
"\n"
" 3GB per process.\n\n"
" Whatever the reason, Valgrind cannot continue. Sorry.\n";
- if (!alreadyCrashing) {
- alreadyCrashing = True;
+ if (outputTrial <= 1) {
+ if (outputTrial == 0) {
+ outputTrial++;
+ VG_(am_show_nsegments) (0, "out_of_memory");
+ VG_(print_all_arena_stats) ();
+ if (VG_(clo_profile_heap))
+ VG_(print_arena_cc_analysis) ();
+ }
+ outputTrial++;
VG_(message)(Vg_UserMsg, s1, who, (ULong)szB, tot_alloc);
} else {
VG_(debugLog)(0,"mallocfree", s1, who, (ULong)szB, tot_alloc);