{"action":"opened","issue":{"url":"https://api.github.com/repos/goldshtn/msos/issues/67","repository_url":"https://api.github.com/repos/goldshtn/msos","labels_url":"https://api.github.com/repos/goldshtn/msos/issues/67/labels{/name}","comments_url":"https://api.github.com/repos/goldshtn/msos/issues/67/comments","events_url":"https://api.github.com/repos/goldshtn/msos/issues/67/events","html_url":"https://github.com/goldshtn/msos/issues/67","id":216423439,"number":67,"title":"Unable to run !ClrStack -a because of duplicite stack frames","user":{"login":"stej","id":253560,"avatar_url":"https://avatars3.githubusercontent.com/u/253560?v=3","gravatar_id":"","url":"https://api.github.com/users/stej","html_url":"https://github.com/stej","followers_url":"https://api.github.com/users/stej/followers","following_url":"https://api.github.com/users/stej/following{/other_user}","gists_url":"https://api.github.com/users/stej/gists{/gist_id}","starred_url":"https://api.github.com/users/stej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stej/subscriptions","organizations_url":"https://api.github.com/users/stej/orgs","repos_url":"https://api.github.com/users/stej/repos","events_url":"https://api.github.com/users/stej/events{/privacy}","received_events_url":"https://api.github.com/users/stej/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-03-23T13:15:15Z","updated_at":"2017-03-23T13:15:15Z","closed_at":null,"body":"I'm running `!ClrStack -a` and I get this error message for some threads\r\n\r\n```\r\nException during command execution -- InvalidOperationException: 'Sequence contains more than one matching element'\r\n   at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)\r\n   at msos.ClrThreadExtensions.FrameArgumentsAndLocalsRetriever.ProcessFrame(IXCLRDataStackWalk stackWalk) in C:\\dev\\github\\msos\\msos\\ClrThreadExtensions.cs:line 288\r\n   at msos.ClrThreadExtensions.FrameArgumentsAndLocalsRetriever.ProcessStackWalk(UInt32 osThreadId) in C:\\dev\\github\\msos\\msos\\ClrThreadExtensions.cs:line 216\r\n   at msos.ClrThreadExtensions.FrameArgumentsAndLocalsRetriever..ctor(ClrThread thread, IList`1 stackTrace, CommandExecutionContext context) in C:\\dev\\github\\msos\\msos\\ClrThreadExtensions.cs:line 200\r\n   at msos.ClrThreadExtensions.WriteStackTraceToContext(ClrThread thread, IList`1 stackTrace, CommandExecutionContext context, Boolean displayArgumentsAndLocals) in C:\\dev\\github\\msos\\msos\\ClrThreadExtensions.cs:line 64\r\n   at msos.ClrThreadExtensions.WriteCurrentStackTraceToContext(ClrThread thread, CommandExecutionContext context, Boolean displayArgumentsAndLocals) in C:\\dev\\github\\msos\\msos\\ClrThreadExtensions.cs:line 54\r\n   at msos.CLRStack.Execute(CommandExecutionContext context) in C:\\dev\\github\\msos\\msos\\CLRStack.cs:line 31\r\n   at msos.CommandExecutionContext.ExecuteOneCommand(String command) in C:\\dev\\github\\msos\\msos\\CommandExecutionContext.cs:line 122\r\nProceed at your own risk, or restart the debugging session.\r\n```\r\n\r\nThe callstack looks like this\r\n```\r\n -> HelperMethodFrame_1OBJ\r\n -> System.Threading.WaitHandle.InternalWaitOne(System.Runtime.InteropServices.SafeHandle, Int64, Boolean, Boolean)\r\n -> System.Threading.WaitHandle.WaitOne(System.TimeSpan, Boolean)\r\n -> System.Threading.WaitHandle.WaitOne(System.TimeSpan)\r\n -> Gmc.Cloud.Scaling.FollowerEventListener.<StartHeartBeatMonitor>b__17_0()\r\n -> System.Threading.Tasks.Task.Execute()\r\n -> System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)\r\n -> System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)\r\n -> System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef)\r\n -> System.Threading.Tasks.Task.ExecuteEntry(Boolean)\r\n -> System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)\r\n -> System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)\r\n -> System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)\r\n -> System.Threading.ThreadHelper.ThreadStart(System.Object)\r\n -> GCFrame\r\n```\r\n\r\nThe code crashes on inspeciting the frame `System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)` \r\non this line `var matchingFrame = _stackTrace.SingleOrDefault(f => f.DisplayString == frameArgsLocals.MethodName);` (see ClrThreadExtensions, method `ProcessFrame`, my line numbers are a little bit different from the ones on github).\r\n\r\nPossible solutions \r\n  * replace the `SingleOrDefault` with `Where` and ignore cases where count is != 1\r\n  * pass frame index into `ProcessFrame` and use this index like this `var matchingFrame = _stackTrace[index]` - this looks obvious, so there was probably a catch, right?"}}
{"actor":{"display_login":"stej"}}