T
Tony Johansson
Hello!
We have a C#.ASP.NET application that runs on a IIS 6. The application
contains actually several asp pages but there is no GUI.
The application receive an xml file that is processed.
There is also an MFC dll that is called from this asp application to make a
syntax check on quite many commands.
You don't have to know what a command is.
The problem that we get is the following when the asp pages calls the MFC
dll it will crash in such a way
that the whole application pool on the IIS will be restarted. The IIS runs
on a windows server 2003.
We have added some rows in the MFC dll to write to a file about where in the
dll it is executing.and also
write some value for different variables.
We know exactly on which row in the MFC dll it will crash . We know also
that this row is used in
several other places in the code so we doubt there is an error on that row
but we are not
100% sure.
We have also build the dll in debug mode and copied it to the windows server
2003 and it
will result in the same error crash in the dll.
Another thing that is of interest is that if we run the built-in application
server in Visual Studio which exist by default we never get any kind of
error.
This is strange because when we run the built-in application server the asp
will call the MFC dll but when we run it in this way we never ever get any
kind of problem.
We have also copied and change the asp pages to be runable in a windows form
application which will call the
MFC dll and here we never get any kind of problem either.
If we look in Event Viewer when we have a MFC crash we can read the
following.
Note that there is two entry for this DLL crash in the Event viewer. The
three rows at the bottom is the second entry and is written with a few
seconds delay compared to the first entry.
An unhandled exception occurred and the process was terminated.
Application ID: DefaultDomain
Process ID: 6108
Exception: System.AccessViolationException
Message: Attempted to read or write protected memory. This is often an
indication that other memory is corrupt.
StackTrace: at System.RuntimeTypeHandle.ConstructName(Boolean nameSpace,
Boolean fullInst, Boolean assembly)
at System.RuntimeType.RuntimeTypeCache.ConstructName(String& name,
Boolean nameSpace, Boolean fullinst, Boolean assembly)
at System.RuntimeType.RuntimeTypeCache.GetFullName()
at System.RuntimeType.get_FullName()
at System.Runtime.Serialization.SerializationInfo..ctor(Type type,
IFormatterConverter converter)
at
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object
obj, ISurrogateSelector surrogateSelector, StreamingContext context,
SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter,
ObjectWriter objectWriter)
at
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object
obj, ISurrogateSelector surrogateSelector, StreamingContext context,
SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter,
ObjectWriter objectWriter)
at
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object
graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream
serializationStream, Object graph, Header[] headers, Boolean fCheck)
at
System.Runtime.Remoting.Channels.CrossAppDomainSerializer.SerializeObject(Object
obj, MemoryStream stm)
at System.AppDomain.Serialize(Object o)
at System.AppDomain.MarshalObject(Object o)
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
EventType clr20r3, P1 w3wp.exe, P2 6.0.3790.3959, P3 45d6968e, P4 mscorlib,
P5 2.0.0.0, P6 4889dc80, P7 13ac, P8 35, P9 exception, P10 NIL.
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
I hope to get some information about this strange problem that we have.
For example I wonder about the row that cause the crash.
As I said before it sounds strange that there should be an error on that row
when it works when we run and call the MFC dll in two different local modes
which are.
1. Use Visual Studio and the built-in application server
2. Use Windows forms that call the MFC dll
//Tony
We have a C#.ASP.NET application that runs on a IIS 6. The application
contains actually several asp pages but there is no GUI.
The application receive an xml file that is processed.
There is also an MFC dll that is called from this asp application to make a
syntax check on quite many commands.
You don't have to know what a command is.
The problem that we get is the following when the asp pages calls the MFC
dll it will crash in such a way
that the whole application pool on the IIS will be restarted. The IIS runs
on a windows server 2003.
We have added some rows in the MFC dll to write to a file about where in the
dll it is executing.and also
write some value for different variables.
We know exactly on which row in the MFC dll it will crash . We know also
that this row is used in
several other places in the code so we doubt there is an error on that row
but we are not
100% sure.
We have also build the dll in debug mode and copied it to the windows server
2003 and it
will result in the same error crash in the dll.
Another thing that is of interest is that if we run the built-in application
server in Visual Studio which exist by default we never get any kind of
error.
This is strange because when we run the built-in application server the asp
will call the MFC dll but when we run it in this way we never ever get any
kind of problem.
We have also copied and change the asp pages to be runable in a windows form
application which will call the
MFC dll and here we never get any kind of problem either.
If we look in Event Viewer when we have a MFC crash we can read the
following.
Note that there is two entry for this DLL crash in the Event viewer. The
three rows at the bottom is the second entry and is written with a few
seconds delay compared to the first entry.
An unhandled exception occurred and the process was terminated.
Application ID: DefaultDomain
Process ID: 6108
Exception: System.AccessViolationException
Message: Attempted to read or write protected memory. This is often an
indication that other memory is corrupt.
StackTrace: at System.RuntimeTypeHandle.ConstructName(Boolean nameSpace,
Boolean fullInst, Boolean assembly)
at System.RuntimeType.RuntimeTypeCache.ConstructName(String& name,
Boolean nameSpace, Boolean fullinst, Boolean assembly)
at System.RuntimeType.RuntimeTypeCache.GetFullName()
at System.RuntimeType.get_FullName()
at System.Runtime.Serialization.SerializationInfo..ctor(Type type,
IFormatterConverter converter)
at
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object
obj, ISurrogateSelector surrogateSelector, StreamingContext context,
SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter,
ObjectWriter objectWriter)
at
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object
obj, ISurrogateSelector surrogateSelector, StreamingContext context,
SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter,
ObjectWriter objectWriter)
at
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object
graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream
serializationStream, Object graph, Header[] headers, Boolean fCheck)
at
System.Runtime.Remoting.Channels.CrossAppDomainSerializer.SerializeObject(Object
obj, MemoryStream stm)
at System.AppDomain.Serialize(Object o)
at System.AppDomain.MarshalObject(Object o)
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
EventType clr20r3, P1 w3wp.exe, P2 6.0.3790.3959, P3 45d6968e, P4 mscorlib,
P5 2.0.0.0, P6 4889dc80, P7 13ac, P8 35, P9 exception, P10 NIL.
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
I hope to get some information about this strange problem that we have.
For example I wonder about the row that cause the crash.
As I said before it sounds strange that there should be an error on that row
when it works when we run and call the MFC dll in two different local modes
which are.
1. Use Visual Studio and the built-in application server
2. Use Windows forms that call the MFC dll
//Tony