[Ns-developers] valgrind error with Mac48Address and Python bindings

Gustavo Carneiro gjcarneiro at gmail.com
Tue Jan 27 06:50:59 PST 2009

The attached program (drop it into scratch/ to compile) replicates a
valgrind error often reported when running python simulations.  However, I
do not understand what I am doing wrong.  Can anyone spot the problem?

gjc at dark-tower:ns-3-dev$ ./waf --run scratch/test-address --valgrind
Entering directory `/home/gjc/projects/ns/ns-3-allinone/ns-3-dev/build'
Build finished successfully (00:00:00)
==22137== Memcheck, a memory error detector.
==22137== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==22137== Using LibVEX rev 1854, a library for dynamic binary translation.
==22137== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==22137== Using valgrind-3.3.1-Debian, a dynamic binary instrumentation
==22137== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==22137== For more details, rerun with: -v
==22137== Invalid read of size 8
==22137==    at 0x400CDA: main (test-address.cc:19)
==22137==  Address 0xbfe55a0 is 0 bytes inside a block of size 6 alloc'd
==22137==    at 0x4C25F6C: operator new(unsigned long)
==22137==    by 0x400CBB: main (test-address.cc:17)
==22137== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 8 from 1)
==22137== malloc/free: in use at exit: 0 bytes in 0 blocks.
==22137== malloc/free: 2,417 allocs, 2,417 frees, 156,484 bytes allocated.
==22137== For counts of detected errors, rerun with: -v
==22137== All heap blocks were freed -- no leaks are possible.
Command ['/usr/bin/valgrind', '--leak-check=full', '--error-exitcode=1',
exited with code 1

Gustavo J. A. M. Carneiro
INESC Porto, Telecommunications and Multimedia Unit
"The universe is always one step beyond logic." -- Frank Herbert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-address.cc
Type: text/x-c++src
Size: 373 bytes
Desc: not available
Url : http://mailman.isi.edu/pipermail/ns-developers/attachments/20090127/e8d1471b/test-address.bin

More information about the Ns-developers mailing list