A
Alexander Behnke
Hello,
I am currently facing a problem with a calloc function call which
returns a NULL pointer while in a debugging environment. If I start the
same executable from the shell (not via the debugger) a valid pointer is
returned.
The call stack looks like this:
FlowPRESS.exe!strcat() Line 169 Asm
FlowPRESS.exe!FlowPRESS::Support::Exceptions::Exception::Exception(int
line=32, char * function=0x00483160, char * file=0x004831a0) Line 23 +
0x10 C++
FlowPRESS.exe!FlowPRESS::Support::Exceptions::AllocationFailedException::AllocationFailedException(int
line=32, char * function=0x00483160, char * file=0x004831a0, char *
name=0x00483220) Line 53 + 0x37 C++
// The function below throws the above exceptions due to a null pointer
// returned by calloc
FlowPRESS.exe!FlowPRESS::Support:
ata::Recrodset::initialize(unsigned
int size=3480) Line 32 + 0x40 C++
FlowPRESS.exe!FlowPRESS::Module::Triangulation::initRS(FlowPRESS::Simulation
* sim=0x0012fdc4) Line 1671 + 0x53 C++
FlowPRESS.exe!FlowPRESS::Module::Triangulation::initialize(FlowPRESS::Simulation
* sim=0x0012fdc4) Line 1665 + 0x11 C++
FlowPRESS.exe!FlowPRESS::Simulation::run() Line 46 + 0x45 C++
FlowPRESS.exe!test() Line 39 C++
FlowPRESS.exe!main(int argc=1, char * * argv=0x00321368) Line 52 C++
FlowPRESS.exe!mainCRTStartup() Line 59 + 0x19 C
kernel32.dll!7c816fd7()
ntdll.dll!7c925b4f()
The lines the Null pointer appears in are:
_data = (DATA*)
:calloc(sz,sizeof(DATA)));
if(_data==NULL)
throw(AllocationFailedException(
__LINE__,__FUNCTION__,__FILE__,"_data");
As stated before, the code executes without an error if executed from shell.
Apparently all function calls to calloc and related functions fail after
a certain point.
A simple test program which gradually increases the memory usage
executed without problems.
I hope you can help with this particular problem. If not, I appreciate
any input on where I could get a solution.
Alex
I am currently facing a problem with a calloc function call which
returns a NULL pointer while in a debugging environment. If I start the
same executable from the shell (not via the debugger) a valid pointer is
returned.
The call stack looks like this:
FlowPRESS.exe!strcat() Line 169 Asm
FlowPRESS.exe!FlowPRESS::Support::Exceptions::Exception::Exception(int
line=32, char * function=0x00483160, char * file=0x004831a0) Line 23 +
0x10 C++
FlowPRESS.exe!FlowPRESS::Support::Exceptions::AllocationFailedException::AllocationFailedException(int
line=32, char * function=0x00483160, char * file=0x004831a0, char *
name=0x00483220) Line 53 + 0x37 C++
// The function below throws the above exceptions due to a null pointer
// returned by calloc
FlowPRESS.exe!FlowPRESS::Support:
int size=3480) Line 32 + 0x40 C++
FlowPRESS.exe!FlowPRESS::Module::Triangulation::initRS(FlowPRESS::Simulation
* sim=0x0012fdc4) Line 1671 + 0x53 C++
FlowPRESS.exe!FlowPRESS::Module::Triangulation::initialize(FlowPRESS::Simulation
* sim=0x0012fdc4) Line 1665 + 0x11 C++
FlowPRESS.exe!FlowPRESS::Simulation::run() Line 46 + 0x45 C++
FlowPRESS.exe!test() Line 39 C++
FlowPRESS.exe!main(int argc=1, char * * argv=0x00321368) Line 52 C++
FlowPRESS.exe!mainCRTStartup() Line 59 + 0x19 C
kernel32.dll!7c816fd7()
ntdll.dll!7c925b4f()
The lines the Null pointer appears in are:
_data = (DATA*)
if(_data==NULL)
throw(AllocationFailedException(
__LINE__,__FUNCTION__,__FILE__,"_data");
As stated before, the code executes without an error if executed from shell.
Apparently all function calls to calloc and related functions fail after
a certain point.
A simple test program which gradually increases the memory usage
executed without problems.
I hope you can help with this particular problem. If not, I appreciate
any input on where I could get a solution.
Alex