Hi,
We are calling the SCC api from our application WayPointer. WayPointer is
written in C# (managed code), and is calling SVNSCC functions (unmanaged
code). A customer is reporting memory access violations from the SVNSCC
calls. The errors occur now and then, intermittently. Here is an example
call stack:
Attempted to read or write protected memory. This is often an indication
that other memory is corrupt.
Exception type: System.AccessViolationException
Source: SccIntegration
Thread: EvaluationEngine
Stack trace:
at WayPointer.SccIntegration.SccOpenProjectInvoker.Invoke(UIntPtr
ppvContext, IntPtr hWnd, StringBuilder lpUser, StringBuilder lpProjName,
StringBuilder lpLocalProjPath, StringBuilder lpAuxProjPath, String
lpComment, TextOutProcCallback lpTextOutProc, Int32 dwFlags)
at WayPointer.SccIntegration.SccAPI.SccOpenProject(UIntPtr ppvContext,
IntPtr hWnd, StringBuilder lpUser, StringBuilder lpProjName, StringBuilder
lpLocalProjPath, StringBuilder lpAuxProjPath, String lpComment,
TextOutProcCallback lpTextOutProc, Int32 dwFlags)
at WayPointer.SccIntegration.SccClient.OpenProject()
at WayPointer.WayPointerSccServer.WayPointerSccServer.QueryStatus(String
fullpath)
at
WayPointer.WayPointerSccServer.WayPointerSccServer.IsSourceControlled(String
fullpath)
at
WayPointer.RulePackage.FileIsNotVersionControlled.FindConclusions(AgentInstance
agent, Hashtable _contextBinders, JRLCollection _environment,
EvaluationTask _evaluationTask)
at
WayPointer.ApplicationManagement.PrecedenceRule.FindConclusions(Hashtable
context, EvaluationTask task)
at
WayPointer.ApplicationManagement.EvaluationEngine.EvaluationTimer.FindConclusions()
at
WayPointer.ApplicationManagement.EvaluationEngine.EvaluationTask.FindConclusions()
at
WayPointer.ApplicationManagement.EvaluationEngine.EvaluationTask.Evaluate()
at
WayPointer.ApplicationManagement.EvaluationEngine.EvaluationTaskScheduler.EvaluateOneTask()
at
WayPointer.ApplicationManagement.EvaluationEngine.EvaluationEngine.RunEngineThread()
The explanation for exception System.AccessViolationException is as
follows:
http://msdn.microsoft.com/en-us/library/ms164911(VS.80).aspxAn access violation occurs in unmanaged or unsafe code when it attempts to
read or write to memory that has not been allocated, or to which it does
not have access. Not all reads or writes through bad pointers lead to
access violations, so an access violation usually indicates that several
reads or writes have occurred through bad pointers, and that memory might
be corrupted.
In managed code, all references are either valid or null. Any operation
that attempts to reference a null reference in verifiable code throws
NullReferenceException.
An access violation that occurs in unsafe managed code can be expressed as
either a NullReferenceException or a AccessViolationException, depending on
the platform.
Access violations in unmanaged code that bubble up to managed code are
always wrapped in an AccessViolationException.