Oleg
Wed Sep 20 06:40:29 CDT 2006
> Here is my problem whihc is very strange for me;
> (VC++ 2003)
> i am developping a multi-threaded DLL and using STL of VC++,
> (especially "list")...
>
> So far i always compiled my code in debug mode... ok...
> Here it is;
> When i run my application with double click on it, it throws a run-time
> error; i search and i found that it gives error on a "delete xStruct;"
> statement,
> i commented it and it again gave an error when trying to run push_back
> of STL list.
>
> Here is the strange thing;
> Without changing "anything" instead of double clicking&running the app.
> when
> i start it via "Start" button (again in debug mode) in VS 2003 it works
> perfect...
>
> How can u explain it???
>
There is a number of differences between running under debugger and without it
that can affect the application's behavior:
- different heap layouts (can reveal some heap-related bugs and hide some others)
- unexpected synchronization of threads when running under debugger
(can hide some synchronization-related bugs)
- different working directories
- some others (different environment variables, etc.)
From your description I would first check for working directory issues (if the application
depends on it), then for heap corruption, and if no corruption found, check also for
synchronization problems.
Here is how to detect heap corruptions:
http://www.debuginfo.com/tips/userbpntdll.html
--
Oleg
[VC++ MVP
http://www.debuginfo.com/]