Caphyon / clang-power-tools

Bringing clang-tidy magic to Visual Studio C++ developers.
http://www.clangpowertools.com
Apache License 2.0
472 stars 57 forks source link

Crashes VS 2022 when running clang-tidy #1297

Closed Sil3ntStorm closed 9 months ago

Sil3ntStorm commented 1 year ago

Right clicking on a simple project in the solution explorer and then choosing clang-power-tools -> Tidy it thinks for a second or two before it ultimately hard crashes Visual Studio. There do not appear to be any log files or any information as to what it is doing or what exactly is going wrong.

Using 2023.6.0 from the marketplace

mariru27 commented 1 year ago

Hi @Sil3ntStorm,

Thank you for reporting this issue

Regards, Marina

mariru27 commented 1 year ago

Do you have the same problem on Clang Power Tools v2023.5.0 (don't forget to disable auto update after reinstalling this version)?

What version of Visual Studio you using?

Sil3ntStorm commented 1 year ago

Closing all tabs, before running Tidy brings up a "Clang Power Tools - Tidy" window within the file editor section of the VS Window that has a progress bar. It also switches the Output window to Clang Power Tools and seems to run some script, which produces a bunch of errors:

--- CLANG TIDY STARTED ---

Test-Path : Illegal characters in path.
At %UserProfile%\appdata\local\microsoft\visualstudio\17.0_ea9bccf5\extensions\pireukoz.rvq\Tooling\v1\psClang\get-llv
m-helper.ps1:49 char:9
+     if (Test-Path -LiteralPath "$locationLLVM\$clangToolWeNeed")
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (C:\Program File...clang-tidy.exe":String) [Test-Path], ArgumentExcepti 
   on
    + FullyQualifiedErrorId : ItemExistsArgumentError,Microsoft.PowerShell.Commands.TestPathCommand
Test-Path : Illegal characters in path.
At %UserProfile%\appdata\local\microsoft\visualstudio\17.0_ea9bccf5\extensions\pireukoz.rvq\Tooling\v1\psClang\get-llv
m-helper.ps1:49 char:9
+     if (Test-Path -LiteralPath "$locationLLVM\$clangToolWeNeed")
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (C:\Program File...clang-tidy.exe":String) [Test-Path], ArgumentExcepti 
   on
    + FullyQualifiedErrorId : ItemExistsArgumentError,Microsoft.PowerShell.Commands.TestPathCommand
Test-Path : Illegal characters in path.
At %UserProfile%\appdata\local\microsoft\visualstudio\17.0_ea9bccf5\extensions\pireukoz.rvq\Tooling\v1\psClang\get-llv
m-helper.ps1:60 char:7
+   if (Test-Path $llvmLiteToolPath)
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (%UserProfile%\...clang-tidy.exe":String) [Test-Path], ArgumentExcepti 
   on
    + FullyQualifiedErrorId : ItemExistsArgumentError,Microsoft.PowerShell.Commands.TestPathCommand
Test-Path : Illegal characters in path.
At %UserProfile%\appdata\local\microsoft\visualstudio\17.0_ea9bccf5\extensions\pireukoz.rvq\Tooling\v1\psClang\get-llv
m-helper.ps1:29 char:6
+   if(Test-Path "$llvmLiteDir\$clangToolWeNeed")
+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (%UserProfile%\...clang-tidy.exe":String) [Test-Path], ArgumentExcepti 
   on
    + FullyQualifiedErrorId : ItemExistsArgumentError,Microsoft.PowerShell.Commands.TestPathCommand
Test-Path : Illegal characters in path.
At %UserProfile%\appdata\local\microsoft\visualstudio\17.0_ea9bccf5\extensions\pireukoz.rvq\Tooling\v1\psClang\get-llv
m-helper.ps1:91 char:11
+       if (Test-Path  $llvmLiteToolPath)
+           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (%UserProfile%\...clang-tidy.exe":String) [Test-Path], ArgumentExcepti 
   on
    + FullyQualifiedErrorId : ItemExistsArgumentError,Microsoft.PowerShell.Commands.TestPathCommand
Invoke-WebRequest : The request was aborted: The connection was closed unexpectedly.
At %UserProfile%\appdata\local\microsoft\visualstudio\17.0_ea9bccf5\extensions\pireukoz.rvq\Tooling\v1\psClang\get-llv
m-helper.ps1:99 char:7
+       Invoke-WebRequest -Uri $clangCompilerWebPath -OutFile $llvmLite ...
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc 
   eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
PROJECT: 

However it ultimately seems to work.

mariru27 commented 1 year ago

@Sil3ntStorm, try manually download LLVM (from Settings -> LLVM)

Sil3ntStorm commented 1 year ago

But I already have LLVM installed, why would I have to download it again?

mariru27 commented 1 year ago

Hi @Sil3ntStorm, then there is no need to reinstall LLVM.

The error message we received suggests that our tool is attempting to download LLVM tools. If possible, could you kindly provide us with the complete log? It would greatly help us investigate and understand the problem more thoroughly

Kind regards, Marina

Sil3ntStorm commented 1 year ago

That was the entire log in the output window, After it just listed the files in the project followed by the found diagnostics.

mariru27 commented 1 year ago

Hi @Sil3ntStorm,

If is not confidential can you tell us the exact path to your project and LLVM? Do you have any suspicious characters in your path? For example: $%^&(!`

Kind regards, Marina

mariru27 commented 9 months ago

I'll be closing this issue due to insufficient information