- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在我们的一项服务中抛出 AccessViolationException。我们注册了 AppDomain.CurrentDomain.UnhandledException
并且我们从事件中得到了调用堆栈。该事件在 2 秒内在三个不同的线程上被引发了三次,并且具有完全相同的堆栈。所以一切都应该清楚
另一方面 - Windows 事件日志中的相关日志条目根本不显示任何堆栈。我们的应用程序也使用非托管库,我的猜测是异常是由滥用它们(例如 oci)而不是显示的托管堆栈引起的。
我是否可以相信所报告的堆栈是导致问题的堆栈 - 或者这只是一个有根据的猜测?
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at System.Linq.EnumerableSorter`2.ComputeKeys(TElement[] elements, Int32 count)
at System.Linq.EnumerableSorter`1.Sort(TElement[] elements, Int32 count)
at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__0.MoveNext()
at System.Linq.Enumerable.<TakeIterator>d__3a`1.MoveNext()
at System.Data.Services.QueryResultInfo.MoveNext()
at System.Data.Services.DataService`1.SerializeResponseBody(RequestDescription description, IDataService dataService, IODataResponseMessage responseMessage)
at System.Data.Services.DataService`1.HandleRequest()
at System.Data.Services.DataService`1.ProcessRequestForMessage(Stream messageBody)
at SyncInvokeProcessRequestForMessage(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
at System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext request, Boolean cleanThread, OperationContext currentOperationContext)
at System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext request, OperationContext currentOperationContext)
at System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
at System.Runtime.InputQueue`1.AsyncQueueReader.Set(Item item)
at System.Runtime.InputQueue`1.EnqueueAndDispatch(Item item, Boolean canDispatchOnThisThread)
at System.Runtime.InputQueue`1.EnqueueAndDispatch(T item, Action dequeuedCallback, Boolean canDispatchOnThisThread)
at System.ServiceModel.Channels.SingletonChannelAcceptor`3.Enqueue(QueueItemType item, Action dequeuedCallback, Boolean canDispatchOnThisThread)
at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.CompleteParseAndEnqueue(IAsyncResult result)
at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.HandleParseIncomingMessage(IAsyncResult result)
at System.Runtime.AsyncResult.SyncContinue(IAsyncResult result)
at System.ServiceModel.Channels.HttpPipeline.EmptyHttpPipeline.BeginProcessInboundRequest(ReplyChannelAcceptor replyChannelAcceptor, Action dequeuedCallback, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.HttpChannelListener`1.HttpContextReceivedAsyncResult`1.ProcessHttpContextAsync()
at System.ServiceModel.Channels.HttpChannelListener`1.BeginHttpContextReceived(HttpRequestContext context, Action acceptorCallback, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.SharedHttpTransportManager.EnqueueContext(IAsyncResult listenerContextResult)
at System.ServiceModel.Channels.SharedHttpTransportManager.OnGetContextCore(IAsyncResult listenerContextResult)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.ListenerAsyncResult.IOCompleted(ListenerAsyncResult asyncResult, UInt32 errorCode, UInt32 numBytes)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
备注:从 Windows 事件日志中的异常代码猜测,我认为这是一个“真正的”Windows AccessViolationException (0xc000005) 而不是 throw new AccessViolationException
(0xe043452)
最佳答案
AccessViolationException 的堆栈跟踪是否指示对访问冲突负责的代码?答案是否。
它仅显示哪个调用检测到访问冲突。随后的调用将失败,实际上整个应用程序将终止,因为 AccessViolationException
不是 catchable by default和 you should not catch it .这意味着内存已被其中一些(并非详尽列表)损坏:
您对非托管依赖项的潜在滥用的猜测可能是 AccessViolationException 的根本原因。
请记住,内存损坏不是确定性的:即使发生,运行时也不一定总能检测到。
以下代码是在Console.WriteLine()
中获取AccessViolationException
的方法。但是,它也可能引发 ExecutionEngineException
。
class Program
{
static void Main(string[] args)
{
AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
Thread.CurrentThread.Name = "Main";
ThreadPool.QueueUserWorkItem(Corrupt, Thread.CurrentThread);
ThreadPool.QueueUserWorkItem(RunMethod);
Console.ReadLine();
}
private static void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
{
Console.WriteLine(e.ExceptionObject);
}
private static void Corrupt(object state)
{
unsafe
{
var thread = (Thread)state;
fixed (char* str = thread.Name)
{
char* increment = str;
char* decrement = str;
while (true)
{
*(decrement--) = 'f';
*(increment++) = 'b';
Thread.Sleep(10);
}
}
}
}
[HandleProcessCorruptedStateExceptions ]
public static void RunMethod(object state)
{
try
{
while (true)
{
Console.WriteLine("I'm Alive");
Thread.Sleep(5000);
}
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
关于c# - 可以信任 AccessViolationException 的 Stacktrace,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32087755/
从今天早上开始,我的证书在 Android 上不再受信任,然后我的应用程序无法再连接: Catch exception while startHandshake: javax.net.ssl.SSL
我想知道是否有人有解决方案允许从usize类型(从访问数组索引或获取矢量长度中获得)的隐式转换为i32?可能吗? 当然,我假设矢量长度和数组范围在i32限制之内。 最佳答案 您可以在函数参数中使用 T
我用 mitmproxy从离开我们网络的出站 AS2 (HTTP) 请求中收集情报。架构是这样的: Mendelson AS2 ➡ mitmproxy ➡ partner AS2 server
我有几个实例,我的 Javascript 代码似乎在泄漏内存,但我不确定我应该从垃圾收集器那里得到什么。 例如 var = new Object() 在 Firefox 中运行的间隔计时器函数似乎会随
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwa
我想我在这里没有想法。 我正在尝试使用具有 ssl 证书的 java 中的 Web 服务。 我创建了一个 keystore 文件,并在其中添加了证书。该文件位于我的项目文件夹中。 我使用以下方式导入它
我在/etc/pki/ca-trust/source/anchors 中添加了一个 crt,这样服务器证书就可以被 ssl 客户端信任。所以,例如,当我 curl https://证书自动受信任。 有
我搜索了很多帖子,但找不到任何解决方案或问题的答案。如何从安装了中间证书的站点下载文件?使用 DownloadManager 时,出现错误“java.security.cert.CertPathVal
我无法使用 SSL: 我从服务器下载了证书,它运行良好。 我还使用本文中的代码将 myCertificate.cert 添加到我的 iPhone 钥匙串(keychain)线程:Importing a
首先,我知道信任所有证书可能存在的风险,但是出于某些测试目的,我必须实现这一点。 如何强制我的客户信任所有证书?我正在使用 javax.websocket 来实现 我所做的只是像连接到 ws 一样 W
信任 $_SERVER['REMOTE_ADDR'] 是否安全?可以通过更改请求的 header 或类似的东西来代替吗? 这样写安全吗? if ($_SERVER['REMOTE_ADDR'] ==
我有一个产品由内部 ASP.NET/MVC 网站组成,所有网站都使用 WIF 通过自定义 STS/IdP 服务启用 SSO。我们现在有一个新的合作伙伴站点托管在我们网络之外的另一个域上,并且希望在用户
我在我开始构建的 Rails 应用程序上使用 sendgrid。我处于测试模式,主要做本地工作,但我发送了很多电子邮件来检查我的流程或电子邮件布局。 我用来接收电子邮件的电子邮件是在 Gmail 上。
我一直在研究我得到的原因: java.util.concurrent.ExecutionException: javax.net.ssl.SSLException: Received fatal al
我有 SVN 服务器通过 HTTPS 在 Apache 下运行 这是我的服务器端配置,“/etc/httpd/conf.d/subversion.conf”: SSLRequireSSL S
我有一个用于开发测试的自签名证书。我已将它添加到证书管理器中的“受信任的根证书颁发机构”文件夹下,当在 IE 或 Chrome 下访问该站点时,它被认为是有效的(在 Firefox 下它不喜欢它是自签
我遇到了 android 4 设备的问题,这些设备在连接到服务器时收到以下异常: java.security.cert.CertPathValidatorException: Trust anchor
我是一个安卓新手。这个问题已经被问过很多次了,但我已经解决了这里几乎所有的问题。 我正在尝试在 Node.Js 服务器(使用 express)和 Android 上的 Volley 上使用自签名证书。
我想使用 WebClient 从安全服务器检索 JSON 文件,但我的 Windows Phone 8 不允许我这样做,因为如果 WebCLient 不信任 SSL 证书,它会抛出异常。 问题在于它不
我正在编写服务器以支持适用于 iOS 和 Android 的基于位置的应用程序。该应用程序要求我们验证用户的身份及其位置。我知道如何做前者,但不知道后者。 是否可以验证客户端发送给我的纬度/经度实际上
我是一名优秀的程序员,十分优秀!