首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SharpSvn SvnClient.GetLog抛出AccessViolationException

SharpSvn SvnClient.GetLog抛出AccessViolationException
EN

Stack Overflow用户
提问于 2012-12-02 08:46:04
回答 1查看 547关注 0票数 1

我的应用程序崩溃了,出现了以下未处理的异常:

代码语言:javascript
复制
System.AccessViolationException was unhandled
  HResult=-2147467261
  Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
  Source=SharpSvn
  StackTrace:
       at apr_pool_destroy(apr_pool_t* )
       at SharpSvn.Implementation.AprPool.Destroy()
       at SharpSvn.Implementation.AprPool.Dispose(Boolean )
       at SharpSvn.Implementation.AprPool.Dispose()
       at SharpSvn.SvnClient.InternalLog(ICollection`1 targets, Uri logRoot, SvnRevision altPegRev, SvnLogArgs args, EventHandler`1 logHandler)
       at SharpSvn.SvnClient.Log(Uri target, SvnLogArgs args, EventHandler`1 logHandler)
       at SharpSvn.SvnClient.GetLog(Uri target, SvnLogArgs args, Collection`1& logItems)
       at SourceLog.Plugin.Subversion.SubversionPlugin.CheckForNewLogEntries(Object state)
       at System.Threading.TimerQueueTimer.CallCallbackInContext(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.TimerQueueTimer.CallCallback()
       at System.Threading.TimerQueueTimer.Fire()
       at System.Threading.TimerQueue.FireQueuedTimerCompletion(Object state)
       at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
       at System.Threading.ThreadPoolWorkQueue.Dispatch()
       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
  InnerException: 

对SharpSvn.SvnClient.GetLog的调用在这里:https://github.com/tomhunter-gh/SourceLog/blob/2fa0632665550c18c9cd23500610704e3eaa35a2/SourceLog.Plugin.Subversion/SubversionPlugin.cs#L39

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-12-02 08:49:36

看起来这是由于多个计时器回调实例同时调用GetLog,并且该方法(通常是SharpSvn?)不是线程安全的。我添加了一个静态锁对象,以确保一次只有一个线程调用GetLog。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13665340

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档