.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

access violation in gc_heap::mark_object_simple

Posted By:      Posted Date: October 28, 2010    Points: 0   Category :.NET Framework

My windows service is crashing in production, seemingly randomly.  It's a 32-bit .NET Framework 3.5 app, running as a service on a Windows Server 2003 machine.  My client has sent me a few crash dumps generated using ADPlus.  Windbg shows the following stack trace for the exception:

ChildEBP RetAddr  Args to Child             
0709fef0 79f7b47e 089b972c 090ae514 006c7f94 mscorwks!WKS::gc_heap::mark_object_simple1+0x148
0709ff1c 79f472d5 03d13a70 00000000 79f769cf mscorwks!WKS::gc_heap::mark_object_simple+0x2b4
0709ff50 79f46d81 00000002 00000000 00000000 mscorwks!WKS::gc_heap::c_drain_mark_list+0x95
0709ff7c 79f47773 7a3b9010 7a3b9028 0709ffb0 mscorwks!WKS::gc_heap::c_mark_phase+0xaa
0709ff98 79f82425 00000000 00000000 00000000 mscorwks!WKS::gc_heap::gc1+0x59
0709ffb0 79f82477 00000000 77e6482f 00000000 mscorwks!WKS::gc_heap::gc_thread_function+0x9f
0709ffb8 77e6482f 00000000 00000000 00000000 mscorwks!WKS::gc_heap::gc_thread_stub+0x73
0709ffec 00000000 79f82448 00000000 00000000 kernel32!BaseThreadStart+0x34

Everything I can find about errors similar to this indicate that the managed heap is corrupted, but !verifyheap produces no output other than "-verify will only produce output if ther

View Complete Post

More Related Resource Links

Access Violation in .NET 4 Runtime in gc_heap::garbage_collect with no unmanaged modules


Hi all,

We are experiencing an access violation in the .NET 4.0 runtime, in a piece of code that uses NHibernate heavily. None of our own code interops with native code directly, nor does the 3rd party code we are using (to the best of our knowledge). We cannot identify the memory pattern that is appears to be corrupting the GC heap, and we don't know whether the problem is in the GC itself or in some other piece of code that is corrupting it.

I've included below the stack trace of the offending thread, and the list of loaded modules.

We need some help debugging this issue. What should we do next?

Adam Smith
Director, Technology
Hubbard One
Thomson Reuters


0:000> !EEStack
Thread   0
Current frame: clr!WKS::gc_heap::find_first_object+0x64
ChildEBP RetAddr  Caller, Callee
0012bf30 791fa5b8 clr!WKS::gc_heap::mark_through_cards_for_segments+0x116, calling clr!WKS::gc_heap::find_card
0012bf38 791fa618 clr!WKS::gc_heap::mark_through_cards_for_segments+0x563, calling clr!WKS::gc_heap::find_first_object
0012bfc4 791faaa1 clr!WKS::gc_heap::relocate_phase+0x5b, calling clr!WKS::gc_heap::mark_through_cards_for_segments
0012c000 791f7a52 clr!WKS::gc_heap::plan_phase+0x851, calling clr!W

Access violation in wpfgfx_v0400.dll - How to find the problem?

I have an access violation exception generated inside wpfgfx_v0400.dll. I have the minidump loaded in visual studio 2010 with all my program's symbols loaded in debug mode. Unfortunately, the stack is of little use. I have searched on the net for help but I could not find anything. I would like to know what I can do from here. Here is the stack for the thread that caused the access violation. Unhandled exception at 0x778b64f4 in WERE8E3.tmp.hdmp: 0xC0000005: Access violation reading location 0x24448900. >   ntdll.dll!778b64f4()      [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]        wpfgfx_v0400.dll!6abb6d2e()          wpfgfx_v0400.dll!6ab9e2d5()          wpfgfx_v0400.dll!6ab22c98()          wpfgfx_v0400.dll!6ab22c98()          wpfgfx_v0400.dll!6ab22c98()          wpfgfx_v0400.dll!6ab23dca()          wpfgfx_v0400.dll!6ab22dbb()          wpfgfx_v0400.dll!6ab291e2()    

Log Reader Agent Access Violation


I recently set up transactional replication from one server database to another server database.  I keep getting a Log Reader Agent error:  An access violation occurred. 

The SQL Server agent starts under one Windows account but the Server is registered under the system account.  The log reader agent is using the system account.

I'm not sure what else to check or what database permissions or roles should be set.  Can somebody help?  Thanks.

Server crashing - Access Violation error



Would someone be able to help? We have a major problem with our SQL Server (2008 RC) installation. SQL Server keeps crashing. The key parts of the dump file seem to be these:

Log was backed up. Database: sage_broadata0506, creation date(time): 2010/06/30(13:26:32), first LSN: 18395:3126:1, last LSN: 18395:3126:1, number of dump devices: 1, device information: (FILE=1, TYPE=DISK: {'E:\Program Files\Microsoft SQL Server\Backup\sage_broadata0506\sage_broadata0506_backup_2010_10_14_085501_6709455.trn'}). This is an informational message only. No user action is required.
2010-10-14 08:55:03.37 spid61      Using 'dbghelp.dll' version '4.0.5'
2010-10-14 08:55:03.72 spid61      ***Stack Dump being sent to E:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\LOG\SQLDump0112.txt
2010-10-14 08:55:03.74 spid61      SqlDumpExceptionHandler: Process 61 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.
2010-10-14 08:55:03.74 spid61      * *******************************************************************************
2010-10-14 08:55:03.74 spid61      *
2010-10-14 08:55:03.74 spid61      * BEGIN STACK DUMP:

Subscribing to events from .NET COM component leads to access violation


I wrote a tiny COM component in C#.  The COM component fires an event, and I'm subscribing to the event in an MFC dialog app.  The event fires, and percolates up to the MFC app, and all seems fine.  But, when you exit the MFC app, an exception in mscorwks.dll generates this line in the Visual Studio Output window:

First-chance exception at 0x7006f877 in UseDotnetFormDllMfc.exe: 0xC0000005: Access violation reading location 0xfeeefef6.

Just subscribing to the event seems to cause this.  If I skip AfxConnectionAdvise, then the exception does not occur.  I assume I'm doing something wrong on the C# side.  The C# code appears below.  Does anyone happen to know what might be going wrong?


using System;

using System.Collections.Generic;

using System.Text;

using System.Runtime.InteropServices;


namespace DotnetFormDll


    // Declare INMSInternalUIEvents as a COM event source

    public delegate void CancelDelegate();


    // Define event interface


        ComVisible(true), // This interface should be in the typelib (defines events)


BackgroundWorker calling COM api method get "Access Violation" error


My WPF appl need to call methods in a COM object (VC++) to do some work. It works perfectly when I call those methods   from the UI thread. As those calls take a very long time to finish, so I decided to move the interaction with COM to a BackgroundWorker. But I got an exception in one COM methods (Other methods still working fine). The error reads:

Unhandled exception at 0x62a7be37 (msvcr100d.dll) in TestApp.exe: 0xC0000005: Access violation writing location 0x0ab0f000.

The signature of the COM method is:


            DWORD size = some func get the size;

            BYTE* pSrcData = the src data address;

            memcpy((void*) pData, pSrcData, size);   //Error occured on this line


    return S_OK;


How the C# calls the method:


Access Violation in SqlServerCe 3.5 SP2 with entity framework


We are developing a .net 4 application that uses sqlServerCe with entity framework.
We get random access violation exceptions when we read from the database. The exceptions always occurs in SqlServerCe.NativeMethods but exact location/function varies.

Platform: There are more exceptions running this on XP but they also occurs on Windows 7.

Any ideas?



Microsoft Visual Studio 2010
Version 10.0.40219.1 SP1Rel

Microsoft .NET Framework
Version 4.0.30319 SP1Rel

Installed Version: Ultimate

Microsoft Visual C# 2010   01019-532-2002102-70982

Microsoft Visual Studio 2010 Ultimate - ENU Service Pack 1 (KB983509)   KB983509
This service pack is for Microsoft Visual Studio 2010 Ultimate - ENU.
If you later install a more recent service pack, this service pack will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/983509.

 System.Data.dll C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll
 System.Data.Entity.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.Entity\v4.0_4.0.0.0__b77a5c561934e089 

Workflow Runtime Crashed with Access Violation Exception




We have an AddInProcess32.exe hosting Workflow Runtime (.Net 3.51 SP1) and the program is targeted to run on a Windows 2008 server (SP2). During the stress testing, some 30-60 workflows were be executed by the program repeatedly for a few days. Everything looked fine except at one time  AddInProcess32.exe crashed with information at Windows Log

Faulting application AddInProcess32.exe, version 3.5.30729.1, time stamp 0x488ef947, faulting module mscorwks.dll, version 2.0.50727.4206, time stamp 0x4bf4c6a7, exception code 0xc0000005, fault offset 0x00024414, process id 0x%9, application start time 0x%10.

.NET Runtime version 2.0.50727.4206 - Fatal Execution Engine Error (73227B6E) (80131506)


We don't have any COM interop or PInvoke. Also, the failed workflow type has been executed successfully more than one thousand times except the one crashed above.


With WinDBG and the crashed dump file, we managed to get the calling sta

MVC architecture in ASP.Net using C# and Microsoft Data Access Application block

The Model-View-Controller (MVC) pattern separates the modeling of the domain, the presentation, and the actions based on user input into three separate classes [Burbeck92]:

Model. The model manages the behavior and data of the application domain, responds to requests for information about its state (usually from the view), and responds to instructions to change state (usually from the controller).

View. The view manages the display of information.

Controller. The controller interprets the mouse and keyboard inputs from the user, informing the model and/or the view to change as appropriate.

Store and Display Images from MS Access Database Using C#

There is only the difference of coding syntax to stream the binary data of image content type to upload it into MS Access Database using C#/VB in ASP.Net 2.0

Namespaces required:-
using System.Data.OleDb;

OleDb is used to connect the web site forms with MS Access Database using Microsoft.Jet.OLEDB.4.0

ASP.Net Upload Image to MS Access Database

As you learnt from the previous articles to upload image to the SQL Database in ASP.Net 2.0 and stream that image into the memory to retrieve it from the database and display it on the web page. In this article you will learn how to upload images to the MS Access database in ASP.Net 2.0

First of all create an Access Database and place it in the App_Data folder of ASP.Net web site project. Then create a table "tblImg" with the following fields:

Wrong Account being used to access files - Help - No Impersonation


I run a simple .aspx website on a Windows Server 2008 machine.

There is NO impersonation, and System.Security.Principal.WindowsIdentity.GetCurrent().Name returns NT AUTHORITY\NETWORK SERVICE, which it the account which the application pool runs. In my web.config, I have <authentication mode="Forms">.


I tried to test the security of the application and server by removing file permissions to the .aspx files. I was greatly worried when the website continued to run without problem (it should not have been able to read the .aspx files).

By turning on file level auditing, I discovered that the .aspx files were being read by the machine$ account (if the machine is called Serv1, then the files would be read by the Serv1$ account, which seems to have access to all files on the local machine).


Is this a security breach or is this behaviour by design ?

Please can somebody assist, as I am worried.

Disallow Direct Access To Files



Here is my dilema, on my site i have a WordPress Audio player (http://wpaudioplayer.com/standalone) that plays my mp3's.

It loads the Mp3's in by javascript...example below:

       AudioPlayer.embed("audioplayer_7", { soundFile: "/Files/Music/[name of file].mp3" });

This file name is clearly visible in the browser source. Not a problem, however this means that any user can legitimately browse to the file directly and download it.

Now i still need the mp3 player (which is flash) to have access to the file but if a user was to try accessing the file directly, they would not be allowed access to it.

I am not sure how to go about this, i am circling the idea of a httphandler but not sure if this is sufficiant to stop the direct access to the file.

Any help would be appreciated

How to access a new database ( which i created ) in isqlplus ?



I created a new database with the help of Database Configuration Assistant !

I created with the scott account

Now i'm not able to connect to the database with the connect identifier with the scott account

The error i get is.,

ERROR - ORA-12154: TNS:could not resolve the connect identifier specified.

Plz help !

Access SessionState: via App1 to SessionState from App2


Hi .NET'ers,

i'm interested to do the following - i geuss, i have no option to do that:

we have our "mainapplication" on a DB; we are tracking user-login status by switching a bit in the DB in the users data row.

we hvae a second application, the backend, which is the administration tool.

(the applications are put in seperate diretories on HD)

sometimes, we need to block/ban users. in some cases the users are logged in, when we "see them in action".

i'd like to build a button in the backend-application, which logss-out the user from the mainapplication.

for sure: i can access the same DB and switch the bit to "know" he's offline, but this will not kill the session on the mainapplication.

because: if a user is on/offline is also indicated by the session in the IIS.
and as the IIS-session is active, the user may be already banned - but he will not be logged out automatically (and showing something like "you have been logged out because of a ban)

one option would be to call the DB by each page-load to find out, if the user is logged on.

is there any option to implement this?

Microsoft Application Block for Data Access in .NET


Hi all,

I was rummaging the internet learning aspx and came across the concept of: Microsoft Application Block for Data Access in .NET

It seems great of course. The articles are all early 2003-5 such as


So the question is - is this tech still relevant and should I be using it?



data access library v4.1


Ive just started a project that will use the enterprise library 4.1 data access code blocks.  Its been years since ive used them, can anyone tell me what assemblies I need to reference in my project in order to use them ?  Ive referenced 


are there any others I need ?

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend