access-violation

What's wrong with my code? (pdcurses/getmaxyx)

It gives me an access violation on the getmaxyx line (second line in the main function) and also gives me these two warnings: LINK : warning LNK4049: locally defined symbol "_stdscr" imported LINK : warning LNK4049: locally defined symbol "_SP" imported Yes, it's the same code as in another question I asked, it's just that I'm making ...

Access Violation reading elements of an array

I've written my own code to parse an .obj model file - essentially just ASCII text. The file gets parsed and stored in the class correctly according to my tests. I can read back the values (from data members) just fine in the loading function. The problem occurs when I try to read back the values in my main rendering loop. There is an a...

How to find a dangling interface that causes an AV in Delphi

I've a complex application to which I've just introduced some changes, adding a couple of new classes with interfaces and deleting some others. Functionally it all works but I get an access violation just after the Destroy procedure of a class: "Access violation at address 0040B984 in module 'xxxx.exe'. Read of address 80808088". I kno...

Can RichtTextBox.RecreateHandle called in wrong moment cause Memory Access Exception?

Hi, My app sometimes throw this exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. There is NO WAY how to reproduce it. I would say that chance it happens is around 1 in 500. It always happens at a different time and at a different place (I...

What do those question marks mean in Windbg?

I'm getting an access violation in a program. Windbg shows that the program is trying to read at 0x09015000. It shows question marks (??) next to the address. My question is, what do these question marks indicate. Do they mean the memory location was never allocated, i.e. it's not backed by any physical memory (or page file)? Or is it so...

How to debug AccessViolationException coming from native code

I'm writing managed code, and I'm using managed bindings (qt4dotnet) for an unmanaged library (Qt). Now and then, I get an AccessViolationException coming somewhere from Qt, but I don't know how to debug that. I don't even get a stacktrace further than the managed/unmanaged boundary (meaning I don't know what part of Qt crashed on me). ...

Delphi: Access violation when putting a string in an editbox?

Well, I am studing some inline assembly in Delphi and the assembly crypto routine is all going great, until I try to parse the ShortString into the Textbox. The violation I get is as follows: The full code is here: procedure TForm2.Button1Click(Sender: TObject); var len,keylen:integer; name, key:ShortString; begin name := ShortSt...

Executing member function of class through pointer to abstract parent of said class.

I have created an abstract base class Animal which has public virtual abstract method makeSound(). I created a subclass Cow which implements Animal.makeSound() as you would expect (you know... "moo"). And I have a Farm class which holds a private member variable std::vector<Animal*> animals. In one of the Farm methods I iterate over a...

Virtual List Control Problem

Hi, I'm using a virtual lit control and I get the data from a map. My problem is when I run the code, it displays the list ok, but when the mouse cursor moves on to the list control or when I try to scroll down, it gives a Debug Assertion failure saying map/set iterator is not dereferencable. My GetDispInfo() method is as follows: voi...

How do detect if an address will cause an access violation?

I'm creating a class for a Lua binding which holds a pointer and can be changed by the scripter. It will include a few functions such as :ReadString and :ReadBool, but I don't want the application to crash if I can tell that the address they supplied will cause an access violation. Is the a good way to detect if an address is outside of...

Sometimes I get EXEC_BAD_ACCESS (Access violation) when reversing an array

Hello, I am loading an image using the OpenEXR library. This works fine, except the image is loaded rotated 180 degrees. I use the loop shown below to reverse the array but sometimes the program will quit and xcode will give me an EXEC_BAD_ACCESS error (Which I assume is the same as an access violation in msvc). It does not happen every...

Access violation in Image destructor

A very simple program I might say.. #include <windows.h> #include <gdiplus.h> using namespace Gdiplus; int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR cmdLine, int nShow){ // Gdiplus variables GdiplusStartupInput mGdiplusStartupInput; ULONG_PTR mGdiplusToken; GdiplusStartup(&mGdiplusToken, &mGdiplusS...

advice on debugging attempt to read or write protected memory exception with winforms

Some background, this application is a printing application that runs within REvit Structure, an Autodesk program. Its a .net add-in. I have been plagued with these sort of exceptions that pop up intermittently and it is really frustrating. How can I go about debugging these? Generally it is advised multi-threading is not used in Revit...

How can I call my C# code from a C++ dll? Access violation problem.

Background: Big C++ MFC app that's not going to get rewritten any time soon. Few years ago needed to add features and decided that it would be easier built with C# and .NET so needed a way to call into .NET functions with the C++ app. At the time we were using VC6.0 for the MFC app and we built the .NET functionality using VS.NET 2...

unhandlex exceptions when using new after implementing a setup project in visual studio 2010

Hey I have my little client application which - when started - creates some user defined objects on the heap via "new" pHistory = new CHistory; This was no problem and everything ran fine until yesterday. I wanted to deploy my application and did decide to use a "Setup Project" from Visual Studio 2010. http://msdn.microsoft.com/en-u...

Access Violation with unmanaged DLL

Currently, we use an unmanaged DLL from a vendor that allows us to access a particular instrument. The particular function of interest is specified in a header file as this: extern "C" short CCONV acq_get_board_count (); In my application, I have the pinvoke statement: public class bograms { [DllImport("bograms.dll", EntryPoint =...

System.AccessViolationException from unmanaged code?

Hi, I'm writing this library that implements some basic audio player features in C++/CLI via the Media Foundation framework that will be consumed by managed code. I can play audio, stop, pause, etc just fine. For anyone who is not familiar with Media Foundation, the media session posts events that you can handle for notifications. Th...

Print MSWord-Document with com4j

I'm trying to print out a .doc-File with com4j. This is my Code: document.printOut2000(true, false, WdPrintOutRange.wdPrintAllDocument, newDocumentPath, _, _, WdPrintOutItem.wdPrintDocumentContent, 1, _, WdPrintOutPages.wdPrintAllPages, true, true, _, false, 0, 0, 0, 0); I got the values from a recorded Word-Macro and http://msdn.mic...

C# P/Invoke on CUDA DLL eventually causes AccessViolationException

This is driving me crazy. I've looked all over, but I'm not sure I understand exactly what's causing this error. I'm making a call to a DLL (that I've coded as a separate project) which runs a CUDA kernel on some data I'm using. Although, I suspect the issue isn't being caused by CUDA, since the code has been tested and works at least ...

DAX Error: Access violation Read of address 00000000

Every time I try compile a VB project that uses a Delphi (2007) activex, I get a DAX error in the delphi activex. This only happens when I try to compile the VB project. Anybody knows what might be going on? ...