access-violation

AccessViolationException from a combo: Attempted to read or write protected memory

Users are occassionally getting the above error when using our application (VB.Net, Winforms, using v2 of the framework). I'm not able to reproduce it. The callstack is as follows: : System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at System.Window...

Really Strange Problem about access violation

I've met a really strange problem: The code is as follow: ::boost::shared_ptr<CQImageFileInfo> pInfo=CQUserViewDataManager::GetInstance()->GetImageFileInfo(nIndex); Image* pImage=pInfo->m_pThumbnail; if(pImage==NULL) pImage=m_pStretchedDefaultThumbImage; else { // int sourceWidth = pInfo->GetWidth(); int sourceHeight = pInfo->GetH...

VC++ 6.0 access violation when run in debugger

I am trying to add enhancements to a 4 year old VC++ 6.0 program. The debug build runs from the command line but not in the debugger: it crashes with an access violation inside printf(). If I skip the printf, then it crashes in malloc() (called from within fopen()) and I can't skip over that. This means I cannot run in the debugger and ...

What are some techniques for troubleshooting very intermittent Access Violation on a Windows Mobile Device?

I have a large Compact Frameworks V2.0 application that in most cases works very well. On certain devices about once a day, a user receives a Native Error 0xC0000005 that is not caught with the standard managed Try/Catch block. My application synchronizes with the server via ASMX calls at fixed intervals. The problem appears to occu...

AccessViolationException on OdbcDataReader.Dispose()

Hi, I am getting this exception when disposing an OdbcDataReader just after retrieving data from the database. The reader is actually disposed while leaving a Using block. This should not be causing any errors as far as I know. Any ideas? System.AccessViolationException: Attempted to read or write protected memory. This is often an ind...

App no longer working - any ideas

I am out of ideas as to why my app has suddenly stopped working - perhaps the collective mind of the SO community can help... Background: I have a large application that has been working up until recently. Now when ever I try and run it I get the error "The application failed to initialize properly (0xc0000005)" This happens before the a...

Sql Compact randomly produces AccessViolationException

I am running Sql Server Compact Edition 3.5.1.0 SP1 in a multi-thread application. The application randomly runs insert queries in transactions. With short transactions, it works fine. But when the transactions get longer and delay between executions get shorter or when I run the application in debug mode, SqlCE begins to throw the follo...

Very strange error in my app from component.

Ok my application does everything that is it suppeded to do and it does the same thing every time so its not as if testing was gone be that much trouble. it crashes "somtimes" not always. it does this when i hover the mouse over a file in the open file dialog i have recently outputted. not instantly it waits about half second to a seco...

How to find out who's causing an access violation error?

I'm getting reports that my app is causing a GPF on some Vista machines. The error message is something like this: access violation at 0x75784062 ( tried to write to 0x00000006) In order to fix this, I first need to know exactly who is causing this GPF: my main exe, some third party component, one of my own activex components, a dll, e...

Common causes of - Access Violation errors under .NET

I'm looking for common causes of Access Violation errors under .NET. Things I have checked so far - Call Dispose on all objects implementing IDisposable Check for valid arguments in calls to COM objects Explicitly remove all manually added event handlers DO NOT explicity call GC.Collect/GC.WaitForPendingFinalizers Add and Remove memor...

Attempted to read or write protected memory

I've started seeing an AccessViolationException being thrown in my application a several different spots. It never occured on my development pc, our test server. It also only manifested itself on 1 of our 2 production servers. Because it only seemed to happen on one of our production servers, I started looking at the installed .net fra...

Why does my custom component raise AVs in the IDE?

I'm trying to write a simple component that will allow you to embed one or more SDL rendering surfaces on a Delphi window, using the SDL 1.3 APIs. It will compile and install just fine, but when I try to use the component in the form designer, it raises AVs whenever I try to access its properties in the object inspector, save the form, ...

About the non-nullable types debate

I keep hearing people talk about how non-nullable reference types would solve so many bugs and make programming so much easier. Even the creator of null calls it his billion dollar mistake, and Spec# has introduced non-nullable types to combat this problem. EDIT: Ignore my comment about Spec#. I misunderstood how it works. EDIT 2: I m...

Access violation when accessing a COM object from .Net

...

AV When using a Procedure from one Component called by another

Im not sure if i have explaned this the best i can but, here we go... I have 2 Custom components on a form, Which are link together at design time through the IDE. Whenever i call a procedure from on of the Component i get the Access violation, Access violation at address 0049A614 in module 'Project2.exe'. Read of address 00000...

access violation writing location?

Hi, I have a simple program and I get access violation at *(str + start). why? i should be able to change it. Right? void fn() { char *str = "Hello wordl!"; int end = strlen(str); int start = 0; end--; while(start < end) { *(str + start) = *(str + end); <--- Access violation writing location *(st...

Marshall.Copy method throws AccessViolationException in C#.NET

Hello, I am working on a C# application that would display live images from a camera. The problem i am facing with the below code snippet is that, i get AccessViolationException in Marshall.Copy method when running this function executed continuosly in a thread. But, this runs successfuly when run once (i get a single static image). I g...

AccessViolationException during P/Invoke Help

I keep getting an AccessViolationException when calling the following from an external DLL: FILES_GetMemoryMapping(MapFile, out size, MapName, out PacketSize, pMapping, out PagePerSector); Which has a prototype that I've setup as such: [DllImport("Files.DLL", SetLastError = true)] public static extern uint FILES_GetMemoryMapp...

Need some help deciphering a line of assembler code, from .NET JITted code

In a C# constructor, that ends up with a call to this(...), the actual call gets translated to this: 0000003d call dword ptr ds:[199B88E8h] What is the DS register contents here? I know it's the data-segment, but is this call through a VMT-table or similar? I doubt it though, since this(...) wouldn't be a call to a virtual met...

Reading arbitrary memory locations? Possible?

Is there a way to (read-only) access any arbitrary memory location without running into an access violation? I thought that each process has its own virtual adress space and that it can read all available memory locations...seems not to be the case, since my program hangs if I do something like var IntPtr : PInteger; AnInteger : Int...