Re: Crashes in Debug (random) but not release
- From: r_z_aret@xxxxxxxxxxxx
- Date: Fri, 15 Apr 2005 16:23:40 -0400
On Thu, 14 Apr 2005 17:35:23 -0400, r_z_aret@xxxxxxxxxxxx wrote:
>On Wed, 13 Apr 2005 08:57:47 -0600, "Timothy Dean"
><tim.dean@xxxxxxxxxxxxxxxxxxx> wrote:
clip
Another tool that I've found helpful is lint. Sure doesn't eliminate
all the bugs. Sure is a bother to use (like having a _very_ fussy
editor check your writing). But every little bit helps.
>>Another thing I noticed at one point when calling a function with a
>>parameter passed by value. The parameter is passed as a contant string (ex:
>>functionCall("SomeText")). When looking at the constructor of the parameter
>>object that takes the string, an invalid pointer arrives at the copy
>>constructor. Thats something I have no control over, right? It is like the
>>string table is corrupt at that point.
>
>Who wrote the constructor? Are you sure the object being constructed
>is appropriate? If you let the compiler choose the appropriate
>conversion, it might make a bad choice. Try doing the conversion
>explicitly (add a variable of the type required for the function, set
>it to the variable you want to pass) and step through the code to see
>what really happens.
Also, make sure any arguments passed to the constructor(s) are valid.
I just caught myself writing a function that returned a pointer to a
stack variable. That caused a serious hiccup in the constructor that
was supposed to handle the pointer.
>
>>
>>Timothy Dean
>>MobileDataforce.
>>
>>
>><r_z_aret@xxxxxxxxxxxx> wrote in message
>>news:ag7o51pqsvq8pe322h5nbeav78kkk15191@xxxxxxxxxx
>>> On Tue, 12 Apr 2005 10:54:37 -0600, "Timothy Dean"
>>> <tim.dean@xxxxxxxxxxxxxxxxxxx> wrote:
>>>
>>> >I have an issue when running in debug mode, the program will "crash" with
>>> >either the "data misalignment" or "access violation" errors. When I run
>>it
>>> >in release, everthing seems fine. The other odd thing is that the place
>>it
>>> >crashes in debug mode seems random. Sometimes if I execute a particular
>>> >line with
>>> >"F10", it will throw the exception. The next time, if I hit "F5" past
>>the
>>> >same line, or "F11" and step through it won't crash at all, or it will
>>crash
>>> >in a different place. If I change a piece of source code, recompile, and
>>> >run again, it will crash in a
>>> >different spot. It seems like the executable file or maybe a library
>>that I
>>> >am linking in is corrupt or misaligned when generating a debug build. Is
>>> >this possible? Has anyone seen anything similar? Thanks.
>>>
>>> Every month or so, someone asks for help trying to figure out why a
>>> program crashes when built for release but not debug or vice versa. So
>>> google _would_ provide some info, except that the question is posed in
>>> so many different ways that finding a good search string is tough.
>>> Probably worth some effort anyway.
>>>
>>> At a minimum, I suggest checking a thread called "Debug works, Release
>>> hangs" in microsoft.public.windowsce.embedded this week.
>>>
>>> The cause is almost always a problem with the poster's code - probably
>>> a bad pointer. The variable symptoms in your case sound especially
>>> like a bad pointer. Unfortunately, the usual solution is a lot of
>>> grunt work to track down the problem. Add ASSERTs to test pointers and
>>> array indeces right after you set them and right before you use them;
>>> these will help find the actual problem. Use the debugger and add
>>> break points (and/or display message boxes), and move them closer and
>>> closer until you narrow down the symptom. Take deep breaths, etc. to
>>> calm down and clear your head. Repeat.
>>>
>>> Good luck.
>>>
>>>
>>> >
>>> >Timothy Dean
>>> >MobileDataforce
>>> >
>>> >
>>>
>>> -----------------------------------------
>>> To reply to me, remove the underscores (_) from my email address (and
>>please indicate which newsgroup and message).
>>>
>>> Robert E. Zaret, eMVP
>>> PenFact, Inc.
>>> 500 Harrison Ave., Suite 3R
>>> Boston, MA 02118
>>> www.penfact.com
>>
>
>-----------------------------------------
>To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).
>
>Robert E. Zaret, eMVP
>PenFact, Inc.
>500 Harrison Ave., Suite 3R
>Boston, MA 02118
>www.penfact.com
-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).
Robert E. Zaret, eMVP
PenFact, Inc.
500 Harrison Ave., Suite 3R
Boston, MA 02118
www.penfact.com
.
- References:
- Crashes in Debug (random) but not release
- From: Timothy Dean
- Re: Crashes in Debug (random) but not release
- From: r_z_aret
- Re: Crashes in Debug (random) but not release
- From: Timothy Dean
- Re: Crashes in Debug (random) but not release
- From: r_z_aret
- Crashes in Debug (random) but not release
- Prev by Date: Re: Error on PPC2002 Emulator: The platform manager server failed!
- Next by Date: Getting Transcriber to work with my App
- Previous by thread: Re: Crashes in Debug (random) but not release
- Next by thread: Re: Crashes in Debug (random) but not release
- Index(es):
Relevant Pages
|