question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

clang-format editor crash

See original GitHub issue

Today (12.04.2023) i update clang-power-tools to 2023.4.0 version and clang-format editor began to crash. I try reinstall clang-format editor or clang-power-tools, don’t to help.

Application: ClangFormatEditor.exe
CoreCLR Version: 5.0.1722.21314
.NET Version: 5.0.17
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Collections.Generic.KeyNotFoundException: The given key 'LE_DeriveLF' was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at ClangFormatEditor.DiffStyle.StyleDetector.SetOptionInput(FormatOptionInputModel inputModel, String input, FormatStyle formatStyle, List`1 formatOptions)
   at ClangFormatEditor.DiffStyle.StyleDetector.<>c__DisplayClass15_0.<DetectFileOptionsAsync>b__0()
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.<>c.<.cctor>b__277_0(Object obj)
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at ClangFormatEditor.DiffStyle.StyleDetector.DetectFileOptionsAsync(String content, FormatStyle style, CancellationToken cancelToken)
   at ClangFormatEditor.DiffStyle.StyleDetector.<>c__DisplayClass12_1.<<DetectOptionsForFilesAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at ClangFormatEditor.DiffStyle.StyleDetector.DetectOptionsForFilesAsync(CancellationToken cancelToken)
   at ClangFormatEditor.DiffStyle.StyleDetector.DetectAsync(CancellationToken cancelToken)
   at ClangFormatEditor.DiffStyle.StyleDetector.DetectStyleOptionsAsync(List`1 filesContent, CancellationToken cancelToken)
   at ClangFormatEditor.MVVM.Controllers.DiffController.GetFormatOptionsAsync(List`1 filesContent, CancellationToken cancelToken)
   at ClangFormatEditor.MVVM.ViewModels.DetectorViewModel.DiffDocumentsAsync(List`1 filesPath, Window detectingWindowOwner)
   at ClangFormatEditor.MVVM.Views.DetectorView.ShowDiffAsync(List`1 filesPath, Window detectingWindowOwner)
   at ClangFormatEditor.MVVM.ViewModels.FileSelectorViewModel.DetectFormatStyleAsync()
   at ClangFormatEditor.TaskExtensions.SafeFireAndForget(Task task, Boolean continueOnCapturedContext, Action`1 onException)
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__140_0(Object state)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run()
   at ClangFormatEditor.App.Main()

Issue Analytics

  • State:closed
  • Created 5 months ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
coolfrikcommented, Apr 12, 2023

@mariru27 thanks for super fast fix. version 2023.4.1 works successfully!

Best regards, Alex.

1reaction
mariru27commented, Apr 12, 2023

@coolfrik, thank you so much for taking the time to give such a thorough and detailed explanation. I can reproduce the problem

We are working on a fix, I will let you know as progress are made A release with a fix may be available next week, but in the meantime you can use a previous version of Clang Format Editor

Best regards, Marina

Read more comments on GitHub >

github_iconTop Results From Across the Web

clang-format crashes
Current 16.6.5 level is installed. Running clang-format results in a stack dump as show below. There is no style file provided on disk...
Read more >
Issues · Caphyon/clang-format-editor
Clang-Format Editor is a tool that helps you find the best Clang-Format Style ... Crash due to EqualizeDocumentLength() sometimes result in unequal lengths...
Read more >
clang-format crash raises a null pointer exception : CPP-27922
clang-format crash raises a null pointer exception · Create a C++ project with the following .clang-format file: · Enable clang-format in Editor ->...
Read more >
clang-format file not working in Visual Studio code
I've just suffered from this issue, but it appears to be a minor bug in VS Code. In my settings I had Editor:...
Read more >
Release Notes
Bug Fixes. Clang Format Editor crashes when the Style Detector is run; Animated building icon in the status bar never clears ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found