473,395 Members | 2,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

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
Jul 22 '05 #1
3 3395
"Greg B" <ru******@hotmail.com> wrote in message
news:f5**************************@posting.google.c 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
Jul 22 '05 #2

"Greg B" <ru******@hotmail.com> wrote in message
news:f5**************************@posting.google.c 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
Jul 22 '05 #3
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.
Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Scott Emick | last post by:
In my visual studio (enterprise arch. 2003) when I try to open my projects, or add to a project a component (vb windows project) I get a big red X inside a red frame and the error pops up: The...
1
by: Oliver | last post by:
I have a database developed fully in Access 2000 which I make available to users of both Access 97 and Access 2000. I use a split front end/back end arrangement; with the BE in Access 97. When I...
4
by: Matt Sawyer | last post by:
I am attempting to use an API (CxApiOem.dll) that has a large number of defines and complicated structs. It's just too much hassle to attempt to use DLLImport to make the desired API calls. ...
1
by: Johann Blake | last post by:
I am looking for a good solution on how to implement data access in an application so that there is a clean separation between the data access layer, the business layer and the GUI layer. I am...
2
by: Boris Fortes | last post by:
I need to unhook event receiver as result of native C++ event. It unhooks successfully, but __raise does not return and throws access violation. Visual Studio 2003 How to reproduce: Consol...
4
by: mos | last post by:
Hi! According the article: You may experience an access violation when you access an STL object through a pointer or reference in a different DLL or EXE...
1
by: Johnex | last post by:
Hi! I am currently writing a tiny webserver that i can attach to all my applications to give them web functionality. I first started of making all the socket and helper classes to handle the...
39
by: Martin | last post by:
I have an intranet-only site running in Windows XPPro, IIS 5.1, PHP 5.2.5. I have not used or changed this site for several months - the last time I worked with it, all was well. When I tried it...
1
by: tk121 | last post by:
Hey all - I have some unmanaged code that I'm calling into with C# .NET 2.0, and everything works flawlessly in the debugger, but as soon as I run the application as a standalone executable it...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.