【问题标题】:AccessViolationException when moving app to server 2008R2 64bit将应用程序移动到服务器 2008R2 64 位时出现 AccessViolationException
【发布时间】:2012-08-17 22:12:02
【问题描述】:

我们正在切换到 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()

【问题讨论】:

  • 但是另一个应用程序(MyApplication2)与Oracle无关...
  • 当 App2 远程调用它的构造函数时,您对 SessStatsLookup() 的作用有任何了解(或者更好的是,可以访问源代码)吗?

标签: c# .net exception-handling 64-bit windows-server-2008


【解决方案1】:

此帖:http://social.msdn.microsoft.com/forums/en-US/adodotnetdataproviders/thread/eacaf64d-09b8-4565-9cc1-91c918a31797/

讨论了由大于 40 字节的连接字符串引起的缓冲区溢出问题。我怀疑这是同一个问题,但您可以尝试 OP 的解决方法,看看它是否相关:

作为解决方法,我不会解析连接中的数据源 字符串(目标是分发 Oracle 应用程序而不使用 tnsnames.ora)。

如果您的 conn 字符串小于 40 字节,并且您仍然看到异常,我会联系 oracle 并查看他们是否有更新的驱动程序。

【讨论】:

  • 感谢您的回答,但我仍然有一个应用程序根本无法连接到 oracle 有这个问题。
  • 你确定吗?看起来它正在远程处理其他事情,这可能只是将异常冒泡(这可能是实际问题所在,远程调用 SessStatsLookup() 可能与 Oracle 对话?)
  • 我确定。该应用程序不会对任何 oracle 实例执行任何操作。
  • 我应该留下这个答案(它修复了两个应用程序之一吗?),还是删除它?
  • 我已经设置了 debugdiag 以查看它是否会提供更多关于崩溃原因的信息。所以,不要删除答案。
猜你喜欢
  • 2010-12-18
  • 2013-09-29
  • 1970-01-01
  • 1970-01-01
  • 2020-05-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-12-11
相关资源
最近更新 更多