Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Access violation not caught/trapped by Visual Studio or Dr Watson

Reply
Thread Tools

Access violation not caught/trapped by Visual Studio or Dr Watson

 
 
Greg B
Guest
Posts: n/a
 
      04-23-2004
Created a simple Win32 application (using Visual Studio wizard)...
Am using Visual Studio (Enterprise Edition) 6.0, as well as Service
Pack 5.

At the start of 'WinMain' function, added the following two lines:

char* ptr = NULL;
*ptr = 'b';

Built the crashTestApp.exe in both Release and Debug configurations.
When trying to run the .exe in Windows Explorer on the same machine
(Windows XP, SP 1), get:

'crashTestApp.exe has encountered a problem and needs to close. We
are sorry for the inconvenience.' messagebox, with an option to Debug.
When I copy the crash executables (Debug and Release versions) onto a
clean Windows 2000 Server machine and run them, I get a similar
message box popping up (but by default it is Dr Watson, and therefore
I don't get a chance to debug). If I then install the same version of
Visual Studio (6.0, Enterprise edition) and Service Pack 5 for Visual
Studio on that machine and run the .exes again, I am once again able
to debug.

Now, this is where it is starting to get weird...

A friend of mine in United States has a Windows 2000 Server machine
(which happens to be hosting a Citrix Metaframe Server). He has
installed Microsoft Visual Studio 6.0 Professional (notice the
difference) and Service Pack 5 on that machine, and then obtained the
crash executables from me. But, when he attempts to execute them,
there is no message box popping up at all. 'Just-in-time debugging'
checkbox in Visual Studio Tools->Options->Debug tab is checked.
If we uncheck that box, close Visual Studio and run the crash
executables, once again nothing seems to occur (i.e. they are launched
and terminated quietly). Doesn't appear to be anything in the Event
Viewer either.

Interestingly enough, if my friend creates a simple Win32 app on his
machine and uses the same code for 'WinMain' (i.e. with the access
violation lines), builds it in Release/Debug modes and then tries
running it, everything works as expected (he gets a messagebox
notifying him of the access violation, and giving him a chance to
debug). If he then disables 'Just-in-time debugging' for Visual Studio
and runs his own-built application, then Dr Watson notification pops
up (and there's an appropriate message in the Event Viewer)

Now, could someone suggest as to why this is happening and how I can
go about solving this issue. Is the problem in the way I build my
executables? Is it the difference in the Visual Studio versions
(Enterprise vs Professional)? Is it because I'm building on XP and
he's running it on 2000 Server? Is it because of some (security)
policy settings on my friend's machine? Is it because I am 20 hours
ahead in the timezone and the binaries I've sent to him have
creation/modification date in the future? Is it because of some
permissions issue (i.e. the executable he builds himself he has rights
to debug, while for my one he doesn't?). Is it because Visual Studio
is installed in the Citrix Metaframe Server environment? (then again,
when I repeated the same steps with my local Citrix Metaframe server
setup, everything worked a treat)

I know I could probably attach a debugger to a running process but
that would be my last resort if everything else fails...

Any help/ideas would be much appreciated
regards,
Greg
 
Reply With Quote
 
 
 
 
Unforgiven
Guest
Posts: n/a
 
      04-23-2004
"Greg B" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> Created a simple Win32 application (using Visual Studio wizard)...
> Am using Visual Studio (Enterprise Edition) 6.0, as well as Service
> Pack 5.


This is off topic here. Try one of the microsoft.public.vc.* newsgroups.

--
Unforgiven


 
Reply With Quote
 
 
 
 
John Harrison
Guest
Posts: n/a
 
      04-23-2004

"Greg B" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> Created a simple Win32 application (using Visual Studio wizard)...
> Am using Visual Studio (Enterprise Edition) 6.0, as well as Service
> Pack 5.
>
> At the start of 'WinMain' function, added the following two lines:
>
> char* ptr = NULL;
> *ptr = 'b';
>
> Built the crashTestApp.exe in both Release and Debug configurations.
> When trying to run the .exe in Windows Explorer on the same machine
> (Windows XP, SP 1), get:
>

[snip]
>
> Any help/ideas would be much appreciated
> regards,
> Greg


The only C++ answer to your question is that you have invoked undefined
behaviour and therefore anything could happen. If you want a Windows answer
to your question ask on a Windows programming group such as
news:comp.os.ms-windows.programmer.win32

john


 
Reply With Quote
 
JKop
Guest
Posts: n/a
 
      04-23-2004
Greg B posted:

> Created a simple Win32 application (using Visual Studio wizard)...
> Am using Visual Studio (Enterprise Edition) 6.0, as well as Service
> Pack 5.
>
> At the start of 'WinMain' function, added the following two lines:
>
> char* ptr = NULL;
> *ptr = 'b';
>
> Built the crashTestApp.exe in both Release and Debug

configurations.
> When trying to run the .exe in Windows Explorer on the same machine
> (Windows XP, SP 1), get:
>
> 'crashTestApp.exe has encountered a problem and needs to close. We
> are sorry for the inconvenience.' messagebox, with an option to

Debug.
> When I copy the crash executables (Debug and Release versions) onto

a
> clean Windows 2000 Server machine and run them, I get a similar
> message box popping up (but by default it is Dr Watson, and

therefore
> I don't get a chance to debug). If I then install the same version

of
> Visual Studio (6.0, Enterprise edition) and Service Pack 5 for

Visual
> Studio on that machine and run the .exes again, I am once again

able
> to debug.
>
> Now, this is where it is starting to get weird...
>
> A friend of mine in United States has a Windows 2000 Server machine
> (which happens to be hosting a Citrix Metaframe Server). He has
> installed Microsoft Visual Studio 6.0 Professional (notice the
> difference) and Service Pack 5 on that machine, and then obtained

the
> crash executables from me. But, when he attempts to execute them,
> there is no message box popping up at all. 'Just-in-time debugging'
> checkbox in Visual Studio Tools->Options->Debug tab is checked.
> If we uncheck that box, close Visual Studio and run the crash
> executables, once again nothing seems to occur (i.e. they are

launched
> and terminated quietly). Doesn't appear to be anything in the Event
> Viewer either.
>
> Interestingly enough, if my friend creates a simple Win32 app on

his
> machine and uses the same code for 'WinMain' (i.e. with the access
> violation lines), builds it in Release/Debug modes and then tries
> running it, everything works as expected (he gets a messagebox
> notifying him of the access violation, and giving him a chance to
> debug). If he then disables 'Just-in-time debugging' for Visual

Studio
> and runs his own-built application, then Dr Watson notification

pops
> up (and there's an appropriate message in the Event Viewer)
>
> Now, could someone suggest as to why this is happening and how I

can
> go about solving this issue. Is the problem in the way I build my
> executables? Is it the difference in the Visual Studio versions
> (Enterprise vs Professional)? Is it because I'm building on XP and
> he's running it on 2000 Server? Is it because of some (security)
> policy settings on my friend's machine? Is it because I am 20 hours
> ahead in the timezone and the binaries I've sent to him have
> creation/modification date in the future? Is it because of some
> permissions issue (i.e. the executable he builds himself he has

rights
> to debug, while for my one he doesn't?). Is it because Visual

Studio
> is installed in the Citrix Metaframe Server environment? (then

again,
> when I repeated the same steps with my local Citrix Metaframe

server
> setup, everything worked a treat)
>
> I know I could probably attach a debugger to a running process but
> that would be my last resort if everything else fails...
>
> Any help/ideas would be much appreciated
> regards,
> Greg


I'm new here and even I find that dumb. It's like hitting someone in
the head with a sledgehammer and then asking why or why not they're
spasming.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is Visual Studio 2005 complict with Visual Studio 2003 rockdale ASP .Net 1 08-23-2006 07:20 PM
Should I write Visual studio 2005 or Visual studio 2003 MCSD =?Utf-8?B?VmlqYXk=?= Microsoft Certification 14 06-30-2006 09:05 AM
Is Visual Studio Team System and Visual Studio Foundation Server are same?. Thirumalai ASP .Net 0 05-22-2006 08:48 AM
visual studio .net 2003 verses visual studio .net 2002 wh ASP .Net 2 01-16-2004 04:54 PM



Advertisments