|
From: Gonzalo <gon...@gm...> - 2013-05-13 13:46:28
|
Hi guys,
I'm having hard times trying to use valgrind with my project. I
regularly use valgrind without problems but in this project I can't.
If I run the application without valgrind, it works ok, but running under
valgrind, it crashs
es.
This is the stack trace:
==8527== Process terminating with default action of signal 11 (SIGSEGV)
==8527== Access not within mapped region at address 0xBEF3EDA4
*==8527== at 0x8091CD0: WriteFiasco(std::string const&)
(fiasco_finder.h:28)*
==8527== by 0x43F810D: __static_initialization_and_destruction_0(int,
int) (*exceptions.cpp:2*)
==8527== by 0x43F817D: global constructors keyed to exceptions.cpp
(exceptions.cpp:122)
==8527== by 0x43F82AC: ??? (in
/home/gonzalo/Perforce/gonzalo_6523/Server/branches/StaticOrderFiasco/Common/Debug/libCommon.so)
==8527== by 0x4347197: ??? (in
/home/gonzalo/Perforce/gonzalo_6523/Server/branches/StaticOrderFiasco/Common/Debug/libCommon.so)
==8527== by 0x400DF0B: call_init (dl-init.c:70)
==8527== by 0x400E028: _dl_init (dl-init.c:134)
==8527== by 0x400088E: ??? (in /lib/ld-2.11.3.so)
==8527== If you believe this happened as a result of a stack
==8527== overflow in your program's main thread (unlikely but
==8527== possible), you can try to increase the size of the
==8527== main thread stack using the --main-stacksize= flag.
==8527== The main thread stack size used in this run was 8388608.
and this is the function fiasco_finder.h::WriteFiasco:
inline bool WriteFiasco(const std::string& fileName)
{
static int counter = 0;
++counter;
std::ofstream file;
file.open("FiascoFinder.txt", std::ios::out | std::ios::app);
file << "Starting to initialize file - number: [" << counter << "]
filename: [" << fileName.c_str() << "]" << std::endl;
file.flush();
file.close();
return true; *<----- line 28*
}
#define *FIASCO_FINDER* const bool g_psuedoUniqueName =
WriteFiasco(__FILE__);
and this is exceptions.cpp:2
#include "fiasco_finder.h"
*FIASCO_FINDER <--------- line 2*
#include "exceptions.h"
I don't really know what is happenning. Did someone have the same problem
or a similar one?. I'm kind of lost and out of ideas.
Thanks a lot!
Gonzalo
|