DLL crashes with release EXE. I have a client application which tries to load a dll when I bring up it. But it crashes the exe now. With debug exe it loads without any problem.

Has anyone faced this kind of issues(release exe crash while dll load)?

Anyone has any clue on this??

Thanks
Sanoj

Recommended Answers

All 4 Replies

compile both for debug and use your compiler's debugger to find out the problem. Does your program use LoadLibrary() to load the dll into memory? Then GetProcAddress() to get pointer to a function? Make sure that function pointer is not NULL.

The problem is that, the issue is not reproducible with debug build..I tried building both dll and exe in debug mode.But then the dll is not crashing the exe during load.

Yes I do use LoadLibrary() GetProcAddress()

Thanks
Sanoj

Buffer overruns might cause that behavior because the compiler (at least Microsoft compilers) adds extra bytes to memory allocations when compiled for debug.

Seems like memory corruption is happening(may be bcoz of buffer overruns).
What can be the best way to look for buffer overruns?

I tried Rational Purify to chk for memory errors , but it hasn't given any valuable info.

Any suggestion will be appreciated.

Thanks
Sanoj

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.