473,587 Members | 2,230 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.ex e 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.e xe 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 3412
"Greg B" <ru******@hotma il.com> wrote in message
news:f5******** *************** ***@posting.goo gle.com...
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.publi c.vc.* newsgroups.

--
Unforgiven
Jul 22 '05 #2

"Greg B" <ru******@hotma il.com> wrote in message
news:f5******** *************** ***@posting.goo gle.com...
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.ex e 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.program mer.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.ex e 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.e xe 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
5789
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 following exception has occured: SecurityException: Requested Registry Access is not allowed. I have already re-installed visual studio (repair...
1
1852
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 have made developments I reissue the front end in both A97 and A2k formats. The latest version of the front end works fine in Access 2000, however...
4
6889
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. Instead, I created a managed C++ DLL (OneBoxAPI.dll) that wraps the desired API calls in a manner which is easy to call from C#. This way I can use the...
1
2574
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 looking for a robust solution for a major application. Almost every developer seems to come up with a completely different solution. While many of them...
2
2848
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 Win32 exe project
4
2292
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 http://support.microsoft.com/default.aspx?scid=kb%3ben-us%3b172396 But I wonder which stl object can access and which not, I have used std::iostream and std::string this way and seems ok, ...
1
2270
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 requests, so i only had a socket output or some 100 bytes or so, just a small text saying that the server was running, sent to the browser in html. I later...
39
4255
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 just now, I am getting the subject error message (specifically: PHP has encountered an access violation at 00F76E21). The error is NOT occurring...
1
8047
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 unexpectedly quits without throwing any exceptions. Even if I start the executable in the debugger it works okay. To see the failure, I need to start...
0
7915
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
1
7967
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6619
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3872
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2347
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.