Valgrind: r16411 - in /trunk: coregrind/m_syswrap/syswrap-solaris.c memcheck/tests/solaris/brk.stderr.exp memcheck/tests/solaris/brk.vgtest

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Valgrind: r16411 - in /trunk: coregrind/m_syswrap/syswrap-solaris.c memcheck/tests/solaris/brk.stderr.exp memcheck/tests/solaris/brk.vgtest

svn-2
Author: iraisr
Date: Tue May 23 22:37:50 2017
New Revision: 16411

Log:
Port changes from r16407 to Solaris OS.
n-i-bz

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

Modified: trunk/coregrind/m_syswrap/syswrap-solaris.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-solaris.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-solaris.c Tue May 23 22:37:50 2017
@@ -1966,6 +1966,24 @@
    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 @@
       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 @@
          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 @@
          /* 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;
          }

Modified: trunk/memcheck/tests/solaris/brk.stderr.exp
==============================================================================
--- trunk/memcheck/tests/solaris/brk.stderr.exp (original)
+++ trunk/memcheck/tests/solaris/brk.stderr.exp Tue May 23 22:37:50 2017
@@ -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 @@
    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)

Modified: trunk/memcheck/tests/solaris/brk.vgtest
==============================================================================
--- trunk/memcheck/tests/solaris/brk.vgtest (original)
+++ trunk/memcheck/tests/solaris/brk.vgtest Tue May 23 22:37:50 2017
@@ -1,2 +1 @@
 prog: brk
-vgopts: -q


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-developers