Hi,
I know that the following error is caused by invalid memory access in
my program... but how do I pinpoint the exact location?
==4384== Invalid read of size 4
==4384== at 0x4052B855: std::string::assign(std::string const&) (in
/usr/lib/libstdc++.so.5.0.4)
==4384== by 0x804F576: TopBuilder::readHost(char const*, PPool&)
(/usr/include/g++/bits/basic_string.h:358)
==4384== by 0x804EAB1: TopBuilder::buildNet(std::string const&,
PPool&) (TopBuilder.cpp:140)
==4384== by 0x804A0FF: main (main.cpp:59)
==4384== by 0x405A3856: __libc_start_main (in /lib/libc.so.6)
==4384== by 0x8049ED0: (within
/home/cincai/tmp/gsim/src/rrsched/rrsched)
==4384== Address 0x0 is not stack'd, malloc'd or free'd
So far I've found that this is caused by the combination of access
to map and vector. Problem is, I created a separate testing and
it works. Afterall, the suspicious statements are simply
"m[name] = &factory" and "field.push_back(c)", where "m" is
map