|
From: <sv...@va...> - 2017-05-22 08:50:13
|
Author: sewardj
Date: Mon May 22 09:50:07 2017
New Revision: 16407
Log:
Make the message "brk segment overflow in thread #%u: can't grow to %#lx"
be printed only once, rather than every time it happens. Also make it
not be printed in silent mode (-q).
Modified:
trunk/coregrind/m_syswrap/syswrap-generic.c
Modified: trunk/coregrind/m_syswrap/syswrap-generic.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-generic.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c Mon May 22 09:50:07 2017
@@ -1322,16 +1322,29 @@
vg_assert(delta > 0);
vg_assert(VG_IS_PAGE_ALIGNED(delta));
- Bool overflow;
+ Bool overflow = False;
if (! VG_(am_extend_into_adjacent_reservation_client)( aseg->start, delta,
&overflow)) {
- if (overflow)
- VG_(umsg)("brk segment overflow in thread #%u: can't grow to %#lx\n",
- tid, newbrkP);
- else
- VG_(umsg)("Cannot map memory to grow brk segment in thread #%u "
- "to %#lx\n", tid, newbrkP);
- VG_(umsg)("(see section Limitations in user manual)\n");
+ if (overflow) {
+ static Bool alreadyComplained = False;
+ if (!alreadyComplained) {
+ alreadyComplained = True;
+ if (VG_(clo_verbosity) > 0) {
+ VG_(umsg)("brk segment overflow in thread #%u: "
+ "can't grow to %#lx\n",
+ tid, newbrkP);
+ VG_(umsg)("(see section Limitations in user manual)\n");
+ VG_(umsg)("NOTE: further instances of this message "
+ "will not be shown\n");
+ }
+ }
+ } else {
+ if (VG_(clo_verbosity) > 0) {
+ VG_(umsg)("Cannot map memory to grow brk segment in thread #%u "
+ "to %#lx\n", tid, newbrkP);
+ VG_(umsg)("(see section Limitations in user manual)\n");
+ }
+ }
goto bad;
}
|