我们正在切换到 Windows Server 2008 R2 64 位服务器并且遇到了一些问题。我们的 Windows 服务在 Windows 事件日志中抛出“AccessViolationException”异常。我们在旧的 Windows 2003 32 位服务器上从未遇到过这个问题。唯一的应用程序更改是重新编译为 64 位应用程序。
不知道是代码问题,还是服务器设置问题。任何人都知道为什么会发生这种情况?
更新:
这是两个堆栈跟踪:
Application: MyApplication1.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
at Devart.Data.Oracle.OracleConnection.BeginTransaction(System.Data.IsolationLevel)
at MyApplication.AlertWorkerBase.persistErrors(System.String, System.String, Char)
at MyApplication.AlertWorkerBase.StartAlertWorker()
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()
Application: MyApplication2.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
at System.Threading.Thread.InternalCrossContextCallback(System.Runtime.Remoting.Contexts.Context, IntPtr, Int32, System.Threading.InternalCrossContextDelegate, System.Object[])
at System.Runtime.Remoting.Activation.ActivationServices.DoCrossContextActivation(System.Runtime.Remoting.Activation.IConstructionCallMessage)
at System.Runtime.Remoting.Messaging.ClientContextTerminatorSink.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage)
at System.Runtime.Remoting.Activation.ActivationServices.Activate(System.Runtime.Remoting.Proxies.RemotingProxy, System.Runtime.Remoting.Activation.IConstructionCallMessage)
at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(System.Runtime.Remoting.Messaging.IMessage)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(System.Runtime.Remoting.Proxies.MessageData ByRef, Int32)
at MyApplication2.SessStatsLookup..ctor(Energy.VT.Common.ApplicationParameters)
at MyApplication2.TCPConnection.ClientHandler.Initialize(MyApplication2.ApplicationParameters)
at MyApplication2.TCPConnection.ClientHandler.ServeClient()
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()