]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/smartall.c
Add pool memory debug output
[bacula/bacula] / bacula / src / lib / smartall.c
index 6bd139ce51b42759e4320d7efef8e4242525dfd7..db2066d0e57a883a3e7fb4d3d1634a1e7f34f4ca 100644 (file)
@@ -6,7 +6,7 @@
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    This program is Free Software; you can redistribute it and/or
-   modify it under the terms of version two of the GNU General Public
+   modify it under the terms of version three of the GNU Affero General Public
    License as published by the Free Software Foundation and included
    in the file LICENSE.
 
@@ -15,7 +15,7 @@
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
+   You should have received a copy of the GNU Affero General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
@@ -212,6 +212,9 @@ void sm_free(const char *file, int line, void *fp)
 
    if (((unsigned char *)cp)[head->ablen - 1] != ((((intptr_t) cp) & 0xFF) ^ 0xC5)) {
       V(mutex);
+      Dmsg4(0, "Overrun buffer: len=%d addr=%p allocated: %s:%d\n",
+         head->ablen, fp,
+         head->abfname, head->ablineno);
       Emsg2(M_ABORT, 0, _("Buffer overrun called from %s:%d\n"), file, line);
    }
    if (sm_buffers > 0) {
@@ -398,7 +401,7 @@ void sm_dump(bool bufdump, bool in_use)
          uint32_t memsize = ap->ablen - (HEAD_SIZE + 1);
          char *cp = ((char *)ap) + HEAD_SIZE;
 
-         Pmsg0(0, "%s buffer: %s %d bytes at %p from %s:%d\n", 
+         Pmsg6(0, "%s buffer: %s %d bytes at %p from %s:%d\n", 
             in_use?"In use":"Orphaned",
             my_name, memsize, cp, ap->abfname, ap->ablineno);
          if (bufdump) {