]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Port changes from r16407 to Solaris OS.
authorIvo Raisr <ivosh@ivosh.net>
Tue, 23 May 2017 21:37:50 +0000 (21:37 +0000)
committerIvo Raisr <ivosh@ivosh.net>
Tue, 23 May 2017 21:37:50 +0000 (21:37 +0000)
n-i-bz

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

coregrind/m_syswrap/syswrap-solaris.c
memcheck/tests/solaris/brk.stderr.exp
memcheck/tests/solaris/brk.vgtest

index a296e6b6af9f3ae282c6d46a5c421d760cf64c8c..22a75014bc5bd2202b4a2a58e88d3597e4a619bf 100644 (file)
@@ -1966,6 +1966,24 @@ void VG_(track_client_dataseg)(ThreadId tid)
    VG_TRACK(die_mem_brk, VG_(brk_base), seg->end + 1 - VG_(brk_base));
 }
 
+static void PRINTF_CHECK(1, 2)
+possibly_complain_brk(const HChar *format, ...)
+{
+   static Bool alreadyComplained = False;
+   if (!alreadyComplained) {
+      alreadyComplained = True;
+      if (VG_(clo_verbosity) > 0) {
+         va_list vargs;
+         va_start(vargs, format);
+         VG_(vmessage)(Vg_UserMsg, format, vargs);
+         va_end(vargs);
+         VG_(umsg)("(See section Limitations in the user manual.)\n");
+         VG_(umsg)("NOTE: further instances of this message will not be "
+                   "shown.\n");
+      }
+   }
+}
+
 PRE(sys_brk)
 {
    /* unsigned long brk(caddr_t end_data_segment); */
@@ -2013,8 +2031,8 @@ PRE(sys_brk)
       vg_assert(VG_(brk_base) == VG_(brk_limit));
 
       if (!VG_(setup_client_dataseg)()) {
-         VG_(umsg)("Cannot map memory to initialize brk segment in thread #%d "
-                   "at %#lx\n", tid, VG_(brk_base));
+         possibly_complain_brk("Cannot map memory to initialize brk segment in "
+                               "thread #%d at %#lx\n", tid, VG_(brk_base));
          SET_STATUS_Failure(VKI_ENOMEM);
          return;
       }
@@ -2156,8 +2174,8 @@ PRE(sys_brk)
          Bool ok = VG_(am_create_reservation)(resvn_start, resvn_size, SmLower,
                                               anon_size);
          if (!ok) {
-            VG_(umsg)("brk segment overflow in thread #%d: can't grow "
-                      "to %#lx\n", tid, new_brk);
+            possibly_complain_brk("brk segment overflow in thread #%d: can not "
+                                  "grow to %#lx\n", tid, new_brk);
             SET_STATUS_Failure(VKI_ENOMEM);
             return;
          }
@@ -2170,8 +2188,8 @@ PRE(sys_brk)
          /* Address space manager will merge old and new data segments. */
          sres = VG_(am_mmap_anon_fixed_client)(anon_start, anon_size, prot);
          if (sr_isError(sres)) {
-            VG_(umsg)("Cannot map memory to grow brk segment in thread #%d "
-                      "to %#lx\n", tid, new_brk);
+            possibly_complain_brk("Cannot map memory to grow brk segment in "
+                                  "thread #%d to %#lx\n", tid, new_brk);
             SET_STATUS_Failure(VKI_ENOMEM);
             return;
          }
index 3e981d510ead1c12fad399081a0459417bf51a1f..d391c95757ace09f9900fc1f072c1ee208d4baee 100644 (file)
@@ -1,3 +1,4 @@
+
 Invalid read of size 1
    at 0x........: test_begin (brk.c:19)
    by 0x........: main (brk.c:78)
@@ -8,4 +9,15 @@ Invalid read of size 1
    by 0x........: main (brk.c:78)
  Address 0x........ is 0 bytes after the brk data segment limit 0x........
 
-brk segment overflow in thread #1: can't grow to 0x........
+brk segment overflow in thread #1: can not grow to 0x........
+(See section Limitations in the user manual.)
+NOTE: further instances of this message will not be shown.
+
+HEAP SUMMARY:
+    in use at exit: 0 bytes in 0 blocks
+  total heap usage: 0 allocs, 0 frees, 0 bytes allocated
+
+For a detailed leak analysis, rerun with: --leak-check=full
+
+For counts of detected and suppressed errors, rerun with: -v
+ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
index 1306b7786be082d9f2de4a44f5288073d8bb0192..b1766ffc3850db404ee3ab5b5dae45532f35f6ae 100644 (file)
@@ -1,2 +1 @@
 prog: brk
-vgopts: -q