Questions tagged [access-violation]

An access violation (also known as segmentation fault) is generally an attempt to access memory that the CPU cannot physically address. It is often caused when attempting to access a null reference or a reference to memory that has been freed.

access-violation
482 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7 votes
0 answers
301 views

Different AppDomain Corrupted State Exception (AccessViolationException) Application Pool Worker Process

How can I prevent an entire application (process) crash when AccessViolationException (or another Corrupted State Exception) is thrown in an AppDomain in .NET 4.6? My goal is to wrap a 3rd party ...
Meeting Attender's user avatar
6 votes
0 answers
907 views

w3wp randomly crashes with AccessViolationException and TargetInvocationException serving WCF call

We are observing random (like once in 1-5 days) IIS crash exceptions in the EventLog. Server - Windows Server 2012 R2. The first one is access violation (more often): Application: w3wp.exe ...
Anton's user avatar
  • 326
6 votes
1 answer
2k views

QString in initializer list causes access violation. What goes wrong here?

I encountered an access-violation when using a QString in a initializer-list that I do not understand. Here is a minimal example that reproduces the problem. // file ClassA.h #pragma once #include &...
Knitschi's user avatar
  • 3,022
5 votes
1 answer
364 views

Is there a way to predict that `Marshal.GetExceptionForHR(code, pointers)` would throw an `AccessViolationException`

I have a whole sequence of interlinked questions. I would like to know answers for all of them independantly, so *yes*, some of them appear to be X-Y questions; but I do want to know the solution to ...
Brondahl's user avatar
  • 8,083
5 votes
2 answers
275 views

Why is this struct literal getting corrupted when passed by address in VS2013 but not gcc/clang?

I'm putting together a Visual Studio 2013 solution for a library I maintain. The library primarily uses arena allocation, so we have an allocator interface: allocator.h #define HAMMER_ALLOCATOR__H__ ...
Meredith L. Patterson's user avatar
5 votes
0 answers
2k views

Visual Studio 2012 not able to debug non-x64 .net applications: Access Violation

I upgraded (clean install) from Win7+VS2012 to Win8+VS2012. I ran into a problem just after that: When I try to run any project with the processor target AnyCPU or x86, vshost.exe crashes immediately ...
seri's user avatar
  • 324
4 votes
0 answers
926 views

.NET/C# reading certificate from store cause AccessViolationException

I've getting very strange code exception, which is should work but not work. I have following code: X509Certificate certificate; X509CertificateStore store = X509CertificateStore.LocalMachineStore(...
vasilyk's user avatar
  • 142
4 votes
0 answers
2k views

Securely obtaining a logon token from user-entered credentials with LogonUser, CredUIPromptForWindowsCredentials and CredUnPackAuthenticationBuffer

I am trying to update an existing piece of library code that prompts an end-user for a username and password (using the normal Windows UI), and then passes these credentials to LogonUser to obtain the ...
jimbobmcgee's user avatar
  • 1,651
4 votes
1 answer
3k views

0xC0000005 - Access violation (Each time from a different dll)

I have been given a task to debug a C++ project. I have not written a single line of code in this project!! This project executes for about 5 minutes without problem. Then it ends with an exception "...
LegoBatman's user avatar
4 votes
1 answer
1k views

IShellDisptach: Why does FolderItemVerbs::Release() + CoUninitialize() crash?

I'm having a very bizarre problem with the IShellDispatch COM interface, more specifically with the FolderItemVerbs object, that drives me nuts! Calling FolderItemVerbs::Release() followed by ...
MuldeR's user avatar
  • 577
4 votes
1 answer
1k views

Bonjour sdk for windows is running only in UI thread

I am developing a program that uses Bonjour algorithm to find services in network. I downloaded Bonjour SDK for Windows. There were two sample applications on .Net. Both are Windows Forms project. ...
uzrgm's user avatar
  • 395
4 votes
0 answers
924 views

System.AccessViolationException when calling Active Directory FindAll()

I have a simple snippet of code in C# .Net 4 that randomly gives a access violation when calling .FindAll() on DirectorySearcher in System.DirectoryServices All that the method does is find out if a ...
user1395943's user avatar
3 votes
0 answers
365 views

C# System.AccessviolationException and using GC.Collect

Here is the code sample: ConcurrentCircularBuffer<byte[]> _cList = new ConcurrentCircularBuffer<byte[]>(10); private Bitmap getBitmap() { byte[] bmpdata = _cList.Dequeue(); if (...
Rexortis's user avatar
3 votes
0 answers
185 views

xUnit Test generating Access Violation

I use xUnit in my c# test frameworks under Visual Studio 2019. Occasionally I'll run into a situation where I've got a self-referencing loop in my code...but rather than throwing a stack overflow ...
user avatar
3 votes
1 answer
3k views

AccessViolationException in .NET framework 4.5 or higher

I'm trying to run a .NET C# console app found on internet ( article, code ). It uses a few pInvoke calls, and at some point triggers Marshal.PtrToStringUni(IntPtr ptr, int len). What is very ...
Eric P.'s user avatar
  • 97
3 votes
0 answers
440 views

Access Violation when trying to run MIT Scheme under Windows 10

I've been trying to install MIT Scheme under a 64-bit Windows 10 installation, however whenever I try to start the program I get the following error message: >>The system has trapped within ...
Nemin's user avatar
  • 31
3 votes
0 answers
146 views

How can I pre-emptively determine if accessing a property will cause an AccessViolation?

I have a method in Rubberduck (an in-process VBE add-in) that is assigning a Picture and Mask to a CommandBarControl(Button). It works well when adding images to the VBE's of Excel, Word, etc., but it ...
ThunderFrame's user avatar
  • 9,430
3 votes
0 answers
174 views

AccessViolationException at no specific code-location while debugging

I get an AccessViolationException while debugging an application, but don't get this exception while running this application as release without attached debugger. The application is a very thread-...
Matthias's user avatar
  • 1,028
3 votes
0 answers
3k views

System.AccessViolationException happened in unknown module

I have a program, which at unexplained times throws this error: System.AccessViolationException was unhandled Message: Attempted to read or write protected memory. This is often an indication ...
NorSD NorSD's user avatar
3 votes
1 answer
7k views

First-chance exception at ...: Access violation reading location ... when debugging using Visual Studio 2010

I try so hard to catch from legacy code access violation keep getting : First-chance exception at 0x57e77e1c in YouTubeLocal.exe: 0xC0000005: Access violation reading location 0x0000000c. My stack ...
user63898's user avatar
  • 30.4k
3 votes
0 answers
975 views

how to fix System.AccessViolationException in ChilkatSocket AsyncConnection

Below is my Chilkat Sockets Server and client code which on running giving me below strange error, kindly help me to resolve it, both client and server are running on the same machine. Server Code: ...
Shax's user avatar
  • 4,257
3 votes
0 answers
944 views

How do I debug an access violation from a object call?

When I make a call to a SOAP API method I am getting the following message: First chance exception at $74EDB9BC. Exception class EAccessViolation with message 'Access violation at address 007004F6 ...
BrianKE's user avatar
  • 4,105
3 votes
0 answers
912 views

Delphi PeekMessage access violation Delphi 2009 Windows API

Periodically getting an access violation from a PeekMessage. This is not my call to PeekMessage, it's from Application.Run. Stack trace from MadExcept shows Application.Run calling PeekMessage which ...
RBrowning99's user avatar
3 votes
1 answer
685 views

OpenGL - attempt to use VBO causes an error

I am having a problem when trying to use VBO in OpenGL (using loads of tutorials on this) - each time I call glBufferData an "access violation in atioglxx.dll" error pops up. I've been trying to use ...
John Smith's user avatar
3 votes
0 answers
516 views

SQL Server CE CoTaskMemFree exception

I couldn't find anyone else on SO that had this same problem, and google hasn't helped much. Might be a good one for some of you wizards out there. We have designed a service that receives data real ...
TravisWhidden's user avatar
3 votes
0 answers
8k views

WinDBG Help - Access Violation in Managed Code

I have a server application written in C#. The application uses no 3rd party software or DLLs, its all managed. Clients connect to the server via socket. Eventually, the application fails due to an ...
Someone Else's user avatar
  • 2,705
2 votes
0 answers
151 views

HMACSHA256 causes AccessViolationException when reused parallelly

Why there is nowhere written that HMACSHA256 can cause System.AccessViolationException when accessed parallelly? The AccessViolationException is super hard to investigate since it cannot be caught by ...
frakon's user avatar
  • 2,126
2 votes
0 answers
232 views

When using Yolov5 and Python 3.9.7 I get "Process finished with exit code -1073741819 (0xC0000005)"

I have tried all of the answers that reference "exit code -1073741819 (0xC0000005)" (Which means access violation) but none of them work. I followed the exact instructions on the Ultraytics ...
Zod's user avatar
  • 31
2 votes
0 answers
6k views

Python OSError: exception: access violation reading 0x0000000000000000 when running external plugin

I have been using Python to run a piece of software via a plug-in which is implemented as a DLL. This is provided through the following wrapper class: from ctypes import * import os ANULL = -999999 ...
rayc_126's user avatar
2 votes
1 answer
252 views

COM object that has been separated from its underlying RCW cannot be used, only in test debug

I am starting a WPF application from an MSTest (as a STA thread). I start the application in the assembly initialize and wait for it to complete loading. Both when I manually close the main window (...
rainbowC's user avatar
2 votes
0 answers
197 views

Pandas drop_duplicates occasionally crashes with no exception

I'm using pandas with Python 2.7 (distributed with ArcGIS Desktop 10.7, which is why I can't use Python 3), running on Windows Server 2019. In my code I'm trying to remove duplicates from a CSV file (~...
isshp's user avatar
  • 292
2 votes
1 answer
873 views

Windows Forms - How can I prevent a System.AccessViolationException when opening a new thread

I am hoping this issue is an obvious one to someone 😊 I have a Windows Forms application that does some independent processes on separate sub-forms. It has a MainForm that opens first and then it ...
SweetTweet's user avatar
2 votes
1 answer
564 views

System.AccessViolationException in any OpenTK.Graphics.OpenGL4.GL Methods

I'm currently learning OpenTK(v 3.1). But there is a problem. System.AccessViolationException is always thrown when I call GL.~~~() functions. using System; using OpenTK.Graphics.OpenGL4; namespace ...
A-H4NU's user avatar
  • 61
2 votes
0 answers
449 views

CComPtr deconstructor causes Read Access Violation

I wrote following C++/Win32 program to save a screenshot in jpeg format. #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <winuser.h> #include <strsafe.h> #include <...
yasar's user avatar
  • 13.4k
2 votes
0 answers
355 views

Can heap corruption be caused by linking issues?

I am getting an access violation in my program when running some code that belongs to a library. My program statically links to the library. I'm able to run that code in other projects without issues, ...
Alex's user avatar
  • 722
2 votes
1 answer
10k views

Python Ctypes OSError: exception: access violation reading 0x00000000

I am trying to use a DLL file from python with ctypes but get stuck in a problem of OSError: exception: access violation reading 0x00000000 The code is: import ctypes as ctypes NS = ctypes....
ZZG's user avatar
  • 31
2 votes
0 answers
263 views

Read Access Violation Exception on reading information from a PE nt_header

Here i want to get ntheader info from a PE image (Image type is unsigned char array or string then converting to unsigned char array): IMAGE_DOS_HEADER * DOSHeader = PIMAGE_DOS_HEADER(Image); ...
user avatar
2 votes
0 answers
408 views

How to catch Access Violation exception in Compact Framework 3.5

While running a managed application with CF3.5 in WEC7, sometimes it throws Access Violation exception in 2 cases. 1. USB Barcode scan into a text box field: In this case, we are using a user dialog ...
Hariprasad Jayprakash's user avatar
2 votes
0 answers
1k views

C# - Font (from Resources) "name" does not exist in current context

So, just so nobody is confused, the setup is basically the main solution and then a second solution with the custom controls in it. The first picture is from the main solution and it shows the error I'...
Joshe343's user avatar
2 votes
1 answer
803 views

Access Violation when using WebBrowser in multiple threads

I am utilizing WebBrowser in multiple threads, however, after some executions (from 50 to 10000+) I get Access Violation Exception. The related parts of the code: Starting thread: var thread = ...
Murumuru's user avatar
2 votes
0 answers
178 views

gdal_grid.exe has stopped working. Why?

I have a number og geojson files containing surfaces and I need to make a DEM for each. This means that for each surface, I want a geotiff, where each pixel is the height of the surface. I tried ...
Little geek's user avatar
2 votes
0 answers
262 views

Access violation in postgres embedded sql libecpg.dll when pulling network cable

I have a connection from a postgres client (Windows 7) to a remote Postgres server (Ubuntu) - Postgres version 9.5. The postgres client is a c-program using embedded sql (libecpg.dll). When I pull ...
walter t's user avatar
2 votes
0 answers
180 views

QT 4.6 Crashing before main

I have an application that uses QT 4.6. My program compiles just fine however when ran I get an access violation which may be seen down below. Exception thrown at 0x00007FF693FC2A6C in Rewynd.exe: ...
user1631635's user avatar
2 votes
1 answer
256 views

What can make a Win32 C++ pointer that doesn't change address suddenly point to invalid memory?

I have a C++ program with a memory corruption problem that I am currently debugging inside Visual Studio 2013. I am using gflags to help pinpoint the problem: https://blog.kowalczyk.info/article/1j9/...
Robert Oschler's user avatar
2 votes
0 answers
640 views

C# AccessViolationException was unhandled

I write down a multi-threading program to get page info.Debugging this program some time ,it will show this error "Access Violation Exception was unhandled.Attempted to read or write protected memory. ...
E.Tarrent's user avatar
2 votes
3 answers
1k views

Access Violation on Accessing a UserSession in Intraweb

I'm new to IntraWeb and have a problem. In order to implement a Login Form, i stored Datasets in the Usersession. But when it comes to access the Datasets i get an Access Violation Error. I figured ...
Chrispy1403's user avatar
2 votes
0 answers
163 views

C - Access Violation when calling external function

I have two c libraries A and B (DLL) in visual studio. Library B depends on functionality exposed by library A. Everything compiles without warnings and errors. When executing B.AddAt(...) an Access ...
JimDoddle's user avatar
2 votes
0 answers
207 views

__declspec(dllimport) c structure: access violation

For some time I have been trying to find a solution for the below problem, but with no success: I have a "c" dll, where the following structure is defined: file: myDll.h #ifdef EXPORTS #define ...
test_c's user avatar
  • 21
2 votes
1 answer
692 views

WP8.1 (0xc0000005) 'Access violation' crash

I develop a Windows Phone 8.1 program using winRT and have an error which is not caught by VS. The only output line I get is "The program 'MyProgram.exe' has exited with code -1073741819 (0xc0000005) '...
Greg's user avatar
  • 21
2 votes
0 answers
142 views

Access Violation in Cordova app when double clicking on a list item

We are creating a Cordova app using AngularJS. On Windows Phone 8.1 the app crashes when double clicking on a list item. When debugging 'scripts only' the app just disappears leaving an Access ...
HilmarJ's user avatar
  • 21

1
2 3 4 5
10