Strange problem with release version. 
Author Message
 Strange problem with release version.

Hi,

 Ive got an application that works fine in debug version but crashes
inmediately after starting in the release version.. I tried to trace it and
arrived to the conclusion that the "unhandled exception" that is thrown,
appears after a message to a thread is sent.... Its strange, since this
application in debug mode ran for more than a week with no problem and the
release version does not get to be for more than one second running.... May
someone give me a clue about this? I checked everything I thought I should
check: pointers, memory... but found nothing....Maybe its something in the
project settings for the release version?? Both versions have the same
settings...??

 Thanks,

  Juan



Mon, 07 Feb 2005 12:22:54 GMT  
 Strange problem with release version.
Hi,

as standard both versions have the same settings, except:

optimization is on in release
debug info is off in release
when you overwrite in debug debug infos, sometimes the program run,
but in release it crashes
incremental builtand link is off in release
other built directories
other dll from other vc project

with threads i cant help you but what is the MFC function with exepted ?
sometimes it help

by , Fred



Quote:
> Hi,

>  Ive got an application that works fine in debug version but crashes
> inmediately after starting in the release version.. I tried to trace it
and
> arrived to the conclusion that the "unhandled exception" that is thrown,
> appears after a message to a thread is sent.... Its strange, since this
> application in debug mode ran for more than a week with no problem and the
> release version does not get to be for more than one second running....
May
> someone give me a clue about this? I checked everything I thought I should
> check: pointers, memory... but found nothing....Maybe its something in
the
> project settings for the release version?? Both versions have the same
> settings...??

>  Thanks,

>   Juan



Mon, 07 Feb 2005 12:37:48 GMT  
 Strange problem with release version.

Quote:

> Hi,

>  Ive got an application that works fine in debug version but crashes
> inmediately after starting in the release version.. I tried to trace it and
> arrived to the conclusion that the "unhandled exception" that is thrown,
> appears after a message to a thread is sent.... Its strange, since this
> application in debug mode ran for more than a week with no problem and the
> release version does not get to be for more than one second running.... May
> someone give me a clue about this? I checked everything I thought I should
> check: pointers, memory... but found nothing....Maybe its something in the
> project settings for the release version?? Both versions have the same
> settings...??

>  Thanks,

>   Juan

In the release build settings, on the C/C++ page set Debug Info to
"Program Database" and on the Link page turn on "Generate Debug Info".
Then you can build and debug the release version.

A common problem related to thread messages is having the wrong function
prototype for the message handler.  Works in debug, crashes the stack in
release.  See "user-defined handlers" and make sure your function
matches the specified prototype for whichever macro you are using.

--
Scott McPhillips [VC++ MVP]



Mon, 07 Feb 2005 13:09:47 GMT  
 Strange problem with release version.
Hi,

Another thing you may want to check is that no code in ASSERT's or TRACE's
has side-effects - these will be compiled to nothing in the release version.

For example,.

ASSERT(x = SomeFunc() );

Will neither update x, or call SomeFunc() in a release build.

Rob



Mon, 07 Feb 2005 13:52:02 GMT  
 Strange problem with release version.

Quote:

> I checked everything I thought I should
>check: pointers, memory... but found nothing....Maybe its something in the
>project settings for the release versi

See if anything here helps :

www.mooremvp.freeserve.co.uk/Win32/framed_tip040.htm

--
Bob Moore [WinSDK MVP]
http://www.mooremvp.freeserve.co.uk/
(this is a non-commercial site and does not accept advertising)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Do not reply via email unless specifically requested to do so.
Unsolicited email is NOT welcome and will go unanswered.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Mon, 07 Feb 2005 23:09:49 GMT  
 Strange problem with release version.
Try to disable optimiztion.


Quote:
> Hi,

>  Ive got an application that works fine in debug version but crashes
> inmediately after starting in the release version.. I tried to trace it
and
> arrived to the conclusion that the "unhandled exception" that is thrown,
> appears after a message to a thread is sent.... Its strange, since this
> application in debug mode ran for more than a week with no problem and the
> release version does not get to be for more than one second running....
May
> someone give me a clue about this? I checked everything I thought I should
> check: pointers, memory... but found nothing....Maybe its something in
the
> project settings for the release version?? Both versions have the same
> settings...??

>  Thanks,

>   Juan



Tue, 08 Feb 2005 07:53:48 GMT  
 Strange problem with release version.

I went over the definition of the prototype of the function and I think its
correct....The thing is that I tried to debug the release version and looks
like the code jumps into a place where theres no valid code when tries to
execute the message handler for the first time....
Just in case, this is the definition....

in the .cpp:

BEGIN_MESSAGE_MAP(CAnalyzerThread, CWinThread)
 file://{{AFX_MSG_MAP(CAnalyzerThread)
 ON_WM_TIMER()
    ON_THREAD_MESSAGE(UM_PERFORMANALYSIS,OnPerformAnalysis)
 file://}}AFX_MSG_MAP
END_MESSAGE_MAP()

void CAnalyzerThread::OnPerformAnalysis(WPARAM wParam, LPARAM lParam){

 char file_name[500];
 char file_name2[500];
 CString buffer;

// it never reaches this place...??

 CAnalyzer *analyzer = new CAnalyzer;
 CDCRAnalyzerApp *theApp =(CDCRAnalyzerApp *)AfxGetApp();
 int file_count=1;
 int error=0;

if (!theApp->isConfigured()) return;
 CTime t=CTime::GetCurrentTime();
 theApp->AddToList("Starting analysis at:" + t.Format("%H:%M"));

 SetFirstFileName(file_name);
 SetFirstFileName(file_name2);
if (!AddCDTDir(file_name)){
   error++;

Quote:
}

  analyzer->AnalyzeFile(file_name,&buffer);
  theApp->AddToList(buffer);
 if (!AddSuperDir(file_name2)){
   error++;
Quote:
}

  analyzer->AnalyzeFile(file_name2,&buffer);
  theApp->AddToList(buffer);
 if (theApp->AnyMail() && (error!=2)) theApp->SendToMailList();
 Sleep(2000);

Quote:
}

in the .h:

 // Generated message map functions
 file://{{AFX_MSG(CAnalyzerThread)
 afx_msg void OnTimer(UINT nIDEvent);
    afx_msg void OnPerformAnalysis(WPARAM wParam, LPARAM lParam);
 file://}}AFX_MSG

 DECLARE_MESSAGE_MAP()

Quote:
----- Original Message -----

Newsgroups:
microsoft.public.vc.de{*filter*},microsoft.public.vc.events,microsoft.public.vc.
language,microsoft.public.vc.mfc,microsoft.public.vc.online_help
Sent: Thursday, August 22, 2002 2:09 PM
Subject: Re: Strange problem with release version.


> > Hi,

> >  Ive got an application that works fine in debug version but crashes
> > inmediately after starting in the release version.. I tried to trace it
and
> > arrived to the conclusion that the "unhandled exception" that is thrown,
> > appears after a message to a thread is sent.... Its strange, since this
> > application in debug mode ran for more than a week with no problem and
the
> > release version does not get to be for more than one second running....
May
> > someone give me a clue about this? I checked everything I thought I
should
> > check: pointers, memory... but found nothing....Maybe its something in
the
> > project settings for the release version?? Both versions have the same
> > settings...??

> >  Thanks,

> >   Juan

> In the release build settings, on the C/C++ page set Debug Info to
> "Program Database" and on the Link page turn on "Generate Debug Info".
> Then you can build and debug the release version.

> A common problem related to thread messages is having the wrong function
> prototype for the message handler.  Works in debug, crashes the stack in
> release.  See "user-defined handlers" and make sure your function
> matches the specified prototype for whichever macro you are using.

> --
> Scott McPhillips [VC++ MVP]




> > Hi,

> >  Ive got an application that works fine in debug version but crashes
> > inmediately after starting in the release version.. I tried to trace it
and
> > arrived to the conclusion that the "unhandled exception" that is thrown,
> > appears after a message to a thread is sent.... Its strange, since this
> > application in debug mode ran for more than a week with no problem and
the
> > release version does not get to be for more than one second running....
May
> > someone give me a clue about this? I checked everything I thought I
should
> > check: pointers, memory... but found nothing....Maybe its something in
the
> > project settings for the release version?? Both versions have the same
> > settings...??

> >  Thanks,

> >   Juan

> In the release build settings, on the C/C++ page set Debug Info to
> "Program Database" and on the Link page turn on "Generate Debug Info".
> Then you can build and debug the release version.

> A common problem related to thread messages is having the wrong function
> prototype for the message handler.  Works in debug, crashes the stack in
> release.  See "user-defined handlers" and make sure your function
> matches the specified prototype for whichever macro you are using.

> --
> Scott McPhillips [VC++ MVP]



Tue, 08 Feb 2005 09:22:29 GMT  
 Strange problem with release version.
Read my essay "surviving the release version" on my MVP Tips site.
                                joe

Quote:

>Hi,

> Ive got an application that works fine in debug version but crashes
>inmediately after starting in the release version.. I tried to trace it and
>arrived to the conclusion that the "unhandled exception" that is thrown,
>appears after a message to a thread is sent.... Its strange, since this
>application in debug mode ran for more than a week with no problem and the
>release version does not get to be for more than one second running.... May
>someone give me a clue about this? I checked everything I thought I should
>check: pointers, memory... but found nothing....Maybe its something in the
>project settings for the release version?? Both versions have the same
>settings...??

> Thanks,

>  Juan

Joseph M. Newcomer [MVP]

Web: http://www3.pgh.net/~newcomer
MVP Tips: http://www3.pgh.net/~newcomer/mvp_tips.htm


Fri, 11 Feb 2005 09:00:02 GMT  
 Strange problem with release version.
Check if your program has memory leak.

The debug mode has alllocate more storage to memory. Even when your program
has leak. It is still ok as the memory has more space for it. But when it is
in release. It will crash immediately.


Quote:
> Try to disable optimiztion.



> > Hi,

> >  Ive got an application that works fine in debug version but crashes
> > inmediately after starting in the release version.. I tried to trace it
> and
> > arrived to the conclusion that the "unhandled exception" that is thrown,
> > appears after a message to a thread is sent.... Its strange, since this
> > application in debug mode ran for more than a week with no problem and
the
> > release version does not get to be for more than one second running....
> May
> > someone give me a clue about this? I checked everything I thought I
should
> > check: pointers, memory... but found nothing....Maybe its something in
> the
> > project settings for the release version?? Both versions have the same
> > settings...?

> >  Thanks,

> >   Juan



Sun, 20 Feb 2005 06:42:31 GMT  
 Strange problem with release version.
You may also want to check compiler optimizations.  I always use default
for this setting and especially never use "optimize for speed".

Also, this scenario is fairly typical of a multi-threaded app you need
to check your synchronization techniques here as well.

Can you explain the context of the thread?  What kind of app is this?
Doc\View?  That may help to debug.

mike


Quote:
> Check if your program has memory leak.

> The debug mode has alllocate more storage to memory. Even when your
program
> has leak. It is still ok as the memory has more space for it. But when it
is
> in release. It will crash immediately.



> > Try to disable optimiztion.



> > > Hi,

> > >  Ive got an application that works fine in debug version but crashes
> > > inmediately after starting in the release version.. I tried to trace
it
> > and
> > > arrived to the conclusion that the "unhandled exception" that is
thrown,
> > > appears after a message to a thread is sent.... Its strange, since
this
> > > application in debug mode ran for more than a week with no problem and
> the
> > > release version does not get to be for more than one second
running....
> > May
> > > someone give me a clue about this? I checked everything I thought I
> should
> > > check: pointers, memory... but found nothing....Maybe its something
in
> > the
> > > project settings for the release version?? Both versions have the same
> > > settings...?

> > >  Thanks,

> > >   Juan



Sun, 20 Feb 2005 16:47:26 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. Strange problem with release version.

2. Strange problem with release version.

3. A strange exception in release version.

4. Debug version ok but release version problem

5. Debug version ok but release version problem

6. Debug version ok but release version problem

7. Debug version ok but release version problem

8. no problem with the debug version but problem with the release one

9. Strange problem for 2 versions of VS.Net

10. Strange Release Build problem in ATL project

11. Strange problem: release build crashes, debug doesn't

12. Debug version - Release version

 

 
Powered by phpBB® Forum Software