Menu

#1 Possibly incorrect warning

open
nobody
None
5
2014-11-29
2006-03-10
No

#include <iostream>
#include "/usr/local/include/mpatrol.h"
#include <ext/hash_map>
using __gnu_cxx::hash_map;
using __gnu_cxx::hash;

using namespace std;

namespace __gnu_cxx {
template<>
struct hash< std::string > {
size_t operator( )( std::string const & s ) const {
return __stl_hash_string( s.c_str( ) );
}
};
}

int main()
{
hash_map<std::string, int> months;

std::string jan("january");
std::string feb("february");

months[jan] = 31;
months[feb] = 28;

cout << "january -> " << months[jan] << endl;
cout << "february -> " << months[feb] << endl;
}

This is a small test program I've been using.

For whatever reason mpatrol reports a bad memmove but
the size is 0.

@(#) mpatrol 1.4.8 (02/01/08)
Copyright (C) 1997-2002 Graeme S. Roy

This is free software, and you are welcome to
redistribute it under certain
conditions; see the GNU Library General Public License
for details.

For the latest mpatrol release and documentation,
visit http://www.cbmamiga.demon.co.uk/mpatrol.

operating system: UNIX
system variant: FreeBSD
processor architecture: Intel 80x86
processor word size: 32-bit
object file format: ELF32
dynamic linker type: SVR4

Log file generated on Fri Mar 10 13:23:06 2006

read 298 symbols from /usr/local/lib/libmpatrol.so
read 2453 symbols from /usr/lib/libstdc++.so.4
read 225 symbols from /lib/libm.so.3
read 2579 symbols from /lib/libc.so.5
read 97 symbols from /usr/local/lib/libelf.so.0
read 71 symbols from /usr/local/lib/compat/pkg/libintl.so.5
read 69 symbols from /usr/local/lib/libintl.so.6
read 348 symbols from /usr/local/lib/libiconv.so.3
read 420 symbols from /libexec/ld-elf.so.1
read 140 symbols from ./a.out

MEMCOPY: memmove (0x0804C000, 0x0804C304, 0 bytes,
0x00) [-|-|-]
0x0804AD91
_ZSt14__copy_trivialIPN9__gnu_cxx15_Hashtable_nodeISt4pairIKSsiEEEEPT_PKS7_SA_S8_+29
0x0804AD6F
_ZSt11__copy_aux2IPN9__gnu_cxx15_Hashtable_nodeISt4pairIKSsiEEEEPT_S8_S8_S8_11__true_type+23
0x0804ACBE
_ZSt10__copy_ni2IPPN9__gnu_cxx15_Hashtable_nodeISt4pairIKSsiEEES7_ET0_T_S9_S8_12__false_type+26
0x0804AC5F
_ZSt10__copy_ni1IN9__gnu_cxx17__normal_iteratorIPPNS0_15_Hashtable_nodeISt4pairIKSsiEEESt6vectorIS7_SaIS7_EEEES8
_ET0_T_SE_SD_11__true_type+51
0x0804AB80
_ZSt4copyIN9__gnu_cxx17__normal_iteratorIPPNS0_15_Hashtable_nodeISt4pairIKSsiEEESt6vectorIS7_SaIS7_EEEES8_ET0_T_
SE_SD_+28
0x0804AA81
_ZSt24__uninitialized_copy_auxIN9__gnu_cxx17__normal_iteratorIPPNS0_15_Hashtable_nodeISt4pairIKSsiEEESt6vectorIS
7_SaIS7_EEEES8_ET0_T_SE_SD_11__true_type+25
0x0804A8E0
_ZSt18uninitialized_copyIN9__gnu_cxx17__normal_iteratorIPPNS0_15_Hashtable_nodeISt4pairIKSsiEEESt6vectorIS7_SaIS
7_EEEES8_ET0_T_SE_SD_+28
0x0804A3A7
_ZNSt6vectorIPN9__gnu_cxx15_Hashtable_nodeISt4pairIKSsiEEESaIS6_EE14_M_fill_insertENS0_17__normal_iteratorIPS6_S
8_EEjRKS6_+355
0x08049D94
_ZNSt6vectorIPN9__gnu_cxx15_Hashtable_nodeISt4pairIKSsiEEESaIS6_EE6insertENS0_17__normal_iteratorIPS6_S8_EEjRKS6
_+24
0x08049601
_ZN9__gnu_cxx9hashtableISt4pairIKSsiESsNS_4hashISsEESt10_Select1stIS3_ESt8equal_toISsESaIiEE21_M_initialize_buck
etsEj+97
0x080492C8
_ZN9__gnu_cxx9hashtableISt4pairIKSsiESsNS_4hashISsEESt10_Select1stIS3_ESt8equal_toISsESaIiEEC1EjRKS5_RKS9_RKSA_+
128
0x080490CC
_ZN9__gnu_cxx8hash_mapISsiNS_4hashISsEESt8equal_toISsESaIiEEC1Ev+44
0x08048DF1 main+41
0x08048C21 _start+137
0x00000001 ???

ERROR: [FREOPN]: memmove: attempt to perform operation
on free memory

system page size: 4096 bytes
default alignment: 4 bytes
overflow size: 0 bytes
overflow byte: 0xAA
allocation byte: 0xFF
free byte: 0x55
allocation stop: 0
reallocation stop: 0
free stop: 0
unfreed abort: 0
small boundary: 32 bytes
medium boundary: 256 bytes
large boundary: 2048 bytes
lower check range: 0
upper check range: 0
check frequency: 1
failure frequency: 0
failure seed: 1142014986
prologue function: <unset>
epilogue function: <unset>
handler function: <unset>
log file: mpatrol.log
profiling file: mpatrol.out
tracing file: mpatrol.trace
program filename: ./a.out
symbols read: 6700
autosave count: 0
freed queue size: 0
allocation count: 46
allocation peak: 6 (6660 bytes)
allocation limit: 0 bytes
allocated blocks: 1 (4096 bytes)
marked blocks: 0 (0 bytes)
freed blocks: 0 (0 bytes)
free blocks: 2 (8192 bytes)
internal blocks: 42 (688128 bytes)
total heap usage: 700416 bytes
total compared: 0 bytes
total located: 423 bytes
total copied: 93670 bytes
total set: 768 bytes
total warnings: 0
total errors: 1

Discussion


Log in to post a comment.