473,412 Members | 2,304 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,412 software developers and data experts.

Why Is Detail Hidden In Private Fields In AccessViolationException

I've written a test harness in C# to test one of our company's products,
which is written in C.

If the application crashes, the Instruction Address, Memory Address and the
Access Type are stored in the private fields _ip, _target and _accessType of
the AccessViolationException that is thrown. I want to be able to report
these errors to the user in the C# harness to assist in writing defect
reports for the development teams.

I can only access these fields using Reflection. My question is why is this
informative information kept in private fields in the exception, and not
available as a public Property? It would also seem to make sense for this
information to be reported in the Message property as well.

If the crash occurs when running the product directly, i.e. in C, this
information is reported by Windows, so it seems at first glance a step
backwards to not report this information when the AccessViolationException is
thrown from the P/Invoke.
Jul 9 '08 #1
2 1803
I dont have any code which generates one of these but have you tried looking
in the Data property. Its a dictionary which is sometimes used to give extra
information about the exception.

Let us know if its in there.

--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"Tristan MSDN Keen" wrote:
I've written a test harness in C# to test one of our company's products,
which is written in C.

If the application crashes, the Instruction Address, Memory Address and the
Access Type are stored in the private fields _ip, _target and _accessType of
the AccessViolationException that is thrown. I want to be able to report
these errors to the user in the C# harness to assist in writing defect
reports for the development teams.

I can only access these fields using Reflection. My question is why is this
informative information kept in private fields in the exception, and not
available as a public Property? It would also seem to make sense for this
information to be reported in the Message property as well.

If the crash occurs when running the product directly, i.e. in C, this
information is reported by Windows, so it seems at first glance a step
backwards to not report this information when the AccessViolationException is
thrown from the P/Invoke.
Jul 9 '08 #2
I've looked in the Data property, and it has a count of 0.

"Ciaran O''Donnell" wrote:
I dont have any code which generates one of these but have you tried looking
in the Data property. Its a dictionary which is sometimes used to give extra
information about the exception.

Let us know if its in there.

--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"Tristan MSDN Keen" wrote:
I've written a test harness in C# to test one of our company's products,
which is written in C.

If the application crashes, the Instruction Address, Memory Address and the
Access Type are stored in the private fields _ip, _target and _accessType of
the AccessViolationException that is thrown. I want to be able to report
these errors to the user in the C# harness to assist in writing defect
reports for the development teams.

I can only access these fields using Reflection. My question is why is this
informative information kept in private fields in the exception, and not
available as a public Property? It would also seem to make sense for this
information to be reported in the Message property as well.

If the crash occurs when running the product directly, i.e. in C, this
information is reported by Windows, so it seems at first glance a step
backwards to not report this information when the AccessViolationException is
thrown from the P/Invoke.
Jul 11 '08 #3

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

Similar topics

4
by: Ryann | last post by:
Hello. I am creating a form that has 5 steps/pages. Each page contains about 20 fields. But I don't want to write them until they submit on the last page. I figured out that I can use hidden...
1
by: mark.reichman | last post by:
First off.. Thanks to Grant Wagner for help in a previous thread related to this one. I am at a total loss... I have multiple fields in a form with the same name. Lets call the fields with the...
3
by: kmacon | last post by:
I have a form that contains a command button. The command button's OnClick event builds a report using the CreateReport and CreateReportControl functions and then opens the main report. I set...
5
by: Roshawn Dawson | last post by:
Hi, Are hidden fields passed in the querystring when a form is posted back? If they are, must the hidden fields be server controls in order to access them from .net code? Thanks, Roshawn
3
by: David W. Fenton | last post by:
I ran into a weird problem with a subreport with an OnFormat event of the subreport detail. When I view the field list in report design view, all the aliased fields in the recordsource are...
0
by: DrewYK | last post by:
I have the project that may never end in front of me. I am creating a routine that will take SpreadSheets from Excel and bring them into Access. I am not using any "DoCmd"s because the goal...
1
by: Marc Bartsch | last post by:
Hi, My C# app throws the following exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. From...
1
by: =?Utf-8?B?SmFzb24gUm9kbWFu?= | last post by:
I have a wierd problem in my application where any call to Assembly.GetFullName of the currently running assembly fails with an AccessViolationException. This only happens on windows vista, all...
0
by: mikeosoft | last post by:
Hi there, this is my first post here! I hope someone can help me. What I'm trying to do is : Storing Fonts in SQL Server And recalling them without installing the file in Windows\Fonts So I...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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,...
0
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...

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.