microsoftgraph / microsoftgraph/microsoft-graph-comms-samples

Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt

Open
#499 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
253
Forks
275
Avg merge
1d 5h
Merged PRs (30d)
1

Description

Describe the issue
Copied from: https://docs.microsoft.com/en-us/answers/questions/561588/unhandled-exception-systemaccessviolationexception.html

Hi,

I am intermittently getting the following error while running the recording bot (https://github.com/microsoftgraph/microsoft-graph-comms-samples/tree/master/Samples/V1.0Samples/AksSamples/teams-recording-bot).

Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at Microsoft.Skype.Bots.Media.AudioFramePlayer.CopyMemory(IntPtr dest, IntPtr src, UInt32 count) at Microsoft.Skype.Bots.Media.AudioFramePlayer.d_46.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.Skype.Bots.Media.AudioFramePlayer.CopyAndSendData(AudioMediaBuffer sourceBuffer, MediaBuffer destinationBuffer) at Microsoft.Skype.Bots.Media.AudioFramePlayer.d47.MoveNext() 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.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>cDisplayClass4_0.b0() at System.Runtime.CompilerServices.TaskAwaiter.<>cDisplayClass11_0.b_0() at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(Action action, Boolean allowInlining, Task& currentTask) at System.Threading.Tasks.Task.FinishContinuations() at System.Threading.Tasks.Task.Finish(Boolean bUserDelegateExecuted) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution) at System.Threading.ThreadPoolWorkQueue.Dispatch()

Can you help me resolve this?

More Info:
Just to add bit more details - I have published a video from the recording bot and after every 30 seconds I publish some audio as well...
So this issue often (not everytime) occurs when audio is published and the AudioFramePlayer is running low on video frames.

Code Snippet
https://github.com/microsoftgraph/microsoft-graph-comms-samples/tree/master/Samples/V1.0Samples/AksSamples/teams-recording-bot

Expected behavior
A clear and concise description of what you expected to happen.

Graph SDK (please complete the following information):

  • Version [e.g. 22]

Call ID
Provide the list call ids that encountered this issue. Include the time in UTC/GMT when these call have occurred.

Logs
If required, please add logs from the SDK. (Please remove any PII from the logs before uploading)

Additional context
Add any other context about the problem here.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the recording bot sample at Samples/V1.0Samples/AksSamples/teams-recording-bot and inspect AudioFramePlayer.CopyMemory, CopyAndSendData, and DequeueAndProcessAsync. Reproduce the intermittent failure while audio is published as video frames run low, then use the call IDs and SDK logs requested in the issue to identify the cause. Done means the recording bot no longer raises AccessViolationException in that scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
audio-video-rtc
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.