Red Gate forums :: View topic - Profiling ASP.NET MVC Memory Access Exception
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
ANTS Performance Profiler 6
ANTS Performance Profiler 6 forum

Profiling ASP.NET MVC Memory Access Exception

Search in ANTS Performance Profiler 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
IvanL



Joined: 26 Nov 2010
Posts: 1
Location: Belgium

PostPosted: Fri Nov 26, 2010 11:44 am    Post subject: Profiling ASP.NET MVC Memory Access Exception Reply with quote

I'm running ANTS Performance Profiler 6.1.0.119 and wished to profile an ASP.NET MVC website (MVC2). But as soon as I start up the profiler I get the following exception:

Quote:

Server Error in '/' Application.
--------------------------------------------------------------------------------

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.]
System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +48
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +275
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +139
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +47

[ConfigurationErrorsException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +601
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +193
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +45
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +56
System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +601
System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +185
System.Web.Compilation.BuildManager.CompileResourcesDirectory() +30
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +375

[HttpException (0x80004005): Attempted to read or write protected memory. This is often an indication that other memory is corrupt.]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +60
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +506
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +768

[HttpException (0x80004005): Attempted to read or write protected memory. This is often an indication that other memory is corrupt.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +547
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +78
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +258




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4955


As options I used "Line level and method level; only with source code", "Record SQL and IO" and the "Profile child processes" is on.

The last line of code that is visible and most likely where the profiler does something fishy is when MVC executes the following: AreaRegistration.RegisterAllAreas();

If I try to start profiling again after this occurred the IE just opens and remains waiting for reply without anything happening, there's no processor time besides the initial startup so it appears as if everything broke and the site refuses to load. If I run it outside the profiler it works just fine however.
Back to top
View user's profile Send private message
nick.maidment



Joined: 29 Jan 2010
Posts: 74

PostPosted: Fri Nov 26, 2010 12:13 pm    Post subject: Reply with quote

There are a couple of things you can try to get this working. First, switch the profiling mode from "line level" to "method level".

Second, remove any pdbs you have. If it works after this, you just need to work out which pdb is causing the problem.

If it still doesn't work after trying these. We'll need to analyse a memory dump (using a debugger like windbg) to work out exactly what the problem is.
Back to top
View user's profile Send private message
lmdarif



Joined: 03 Mar 2011
Posts: 1

PostPosted: Thu Mar 03, 2011 7:53 am    Post subject: Reply with quote

Any update on this issue, i am facing this issue on NON MVC asp.net application.

Thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group