llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
26.71k stars 10.94k forks source link

crash of tidy #95709

Open NissimBendanan opened 2 weeks ago

NissimBendanan commented 2 weeks ago

FAILED: utils/general_utils/CMakeFiles/gen_utils.dir/http_utils.cpp.obj "C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E __run_co_compile --tidy="C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/Llvm/bin/clang-tidy.exe;-header-filter=.C:/Users/nbendana/Projects/enterprise-client-connector/(?!build-)(?!vendor).;-p=C:/Users/nbendana/Projects/enterprise-client-connector/build-win64-release;--warnings-as-errors=*;--extra-arg-before=--driver-mode=g++" --source=C:\Users\nbendana\Projects\enterprise-client-connector\utils\general_utils\httputils.cpp -- C:\PROGRA~1\MICROS~4\2022\PROFES~1\VC\Tools\Llvm\bin\CLANG~1.EXE -DBUNDLED_FMT=1 -DEMP_PRODUCTION=1 -DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE -DSPDLOG_COMPILED_LIB -IC:/Users/nbendana/Projects/enterprise-client-connector/utils/general_utils/include -IC:/Users/nbendana/Projects/enterprise-client-connector/vendor/akamai/enterprise-client-ipc/ipc_utils/include -IC:/Users/nbendana/Projects/enterprise-client-connector/vendor/github.com/nlohmann/json/include -IC:/Users/nbendana/Projects/enterprise-client-connector/utils/emp_logger/include -IC:/Users/nbendana/Projects/enterprise-client-connector/vendor/github.com/gabime/spdlog/include -IC:/Users/nbendana/Projects/enterprise-client-connector/windows/win_utils/include --target=amd64-pc-windows-msvc -fdiagnostics-absolute-paths -O3 -DNDEBUG -std=gnu++17 -D_DLL -D_MT -Xclang --dependent-lib=msvcrt -g -gcodeview -D_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING -Werror -Wall -Wextra -Wno-c++98-compat -Wno-c++98-compat-pedantic -MD -MT utils/general_utils/CMakeFiles/gen_utils.dir/http_utils.cpp.obj -MF utils\general_utils\CMakeFiles\gen_utils.dir\http_utils.cpp.obj.d -o utils/general_utils/CMakeFiles/gen_utils.dir/http_utils.cpp.obj -c C:/Users/nbendana/Projects/enterprise-client-connector/utils/general_utils/http_utils.cpp Error running 'C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/Llvm/bin/clang-tidy.exe': PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace. Stack dump:

  1. Program arguments: "C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/Llvm/bin/clang-tidy.exe" -header-filter=.C:/Users/nbendana/Projects/enterprise-client-connector/(?!build-)(?!vendor). -p=C:/Users/nbendana/Projects/enterprise-client-connector/build-win64-release --warnings-as-errors=* --extra-arg-before=--driver-mode=g++ C:\Users\nbendana\Projects\enterprise-client-connector\utils\general_utils\httputils.cpp -- C:\PROGRA~1\MICROS~4\2022\PROFES~1\VC\Tools\Llvm\bin\CLANG~1.EXE -DBUNDLED_FMT=1 -DEMP_PRODUCTION=1 -DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE -DSPDLOG_COMPILED_LIB -IC:/Users/nbendana/Projects/enterprise-client-connector/utils/general_utils/include -IC:/Users/nbendana/Projects/enterprise-client-connector/vendor/akamai/enterprise-client-ipc/ipc_utils/include -IC:/Users/nbendana/Projects/enterprise-client-connector/vendor/github.com/nlohmann/json/include -IC:/Users/nbendana/Projects/enterprise-client-connector/utils/emp_logger/include -IC:/Users/nbendana/Projects/enterprise-client-connector/vendor/github.com/gabime/spdlog/include -IC:/Users/nbendana/Projects/enterprise-client-connector/windows/win_utils/include --target=amd64-pc-windows-msvc -fdiagnostics-absolute-paths -O3 -DNDEBUG -std=gnu++17 -D_DLL -D_MT -Xclang --dependent-lib=msvcrt -g -gcodeview -D_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING -Werror -Wall -Wextra -Wno-c++98-compat -Wno-c++98-compat-pedantic -MD -MT utils/general_utils/CMakeFiles/gen_utils.dir/http_utils.cpp.obj -MF utils\general_utils\CMakeFiles\gen_utils.dir\http_utils.cpp.obj.d -o utils/general_utils/CMakeFiles/gen_utils.dir/http_utils.cpp.obj -c C:/Users/nbendana/Projects/enterprise-client-connector/utils/general_utils/http_utils.cpp Exception Code: 0xC0000005

    0 0x015760c0 C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\Llvm\bin\clang-tidy.exe 0x8760c0

NissimBendanan commented 2 weeks ago

C:\Users\nbendana\Projects\enterprise-client-connector>clang-tidy.exe --version LLVM (http://llvm.org/): LLVM version 17.0.3 Optimized build.

C:\Users\nbendana\Projects\enterprise-client-connector>clang --version clang version 17.0.3 Target: i686-pc-windows-msvc Thread model: posix

NissimBendanan commented 2 weeks ago

point is that in addition to: C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build

the following was also defined in the PATH: C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\Llvm\bin

When removing this last folder from the PATH, then clang-tidy.exe is now working.

C:\Users\nbendana\Projects\enterprise-client-connector>where clang C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\Llvm\bin\clang.exe

C:\Users\nbendana\Projects\enterprise-client-connector>where clang-tidy.exe C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\Llvm\bin\clang-tidy.exe

C:\Users\nbendana\Projects\enterprise-client-connector>clang --version clang version 17.0.3 Target: i686-pc-windows-msvc Thread model: posix InstalledDir: C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\Llvm\bin

C:\Users\nbendana\Projects\enterprise-client-connector>clang-tidy --version LLVM (http://llvm.org/): LLVM version 17.0.3 Optimized build.

llvmbot commented 2 weeks ago

@llvm/issue-subscribers-clang-tidy

Author: Nissim Armand Ben Danan (NissimBendanan)

FAILED: utils/general_utils/CMakeFiles/gen_utils.dir/http_utils.cpp.obj "C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E __run_co_compile --tidy="C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/Llvm/bin/clang-tidy.exe;-header-filter=.*C:/Users/nbendana/Projects/enterprise-client-connector/(?!build-)(?!vendor).*;-p=C:/Users/nbendana/Projects/enterprise-client-connector/build-win64-release;--warnings-as-errors=*;--extra-arg-before=--driver-mode=g++" --source=C:\Users\nbendana\Projects\enterprise-client-connector\utils\general_utils\http_utils.cpp -- C:\PROGRA~1\MICROS~4\2022\PROFES~1\VC\Tools\Llvm\bin\CLANG_~1.EXE -DBUNDLED_FMT=1 -DEMP_PRODUCTION=1 -DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE -DSPDLOG_COMPILED_LIB -IC:/Users/nbendana/Projects/enterprise-client-connector/utils/general_utils/include -IC:/Users/nbendana/Projects/enterprise-client-connector/vendor/akamai/enterprise-client-ipc/ipc_utils/include -IC:/Users/nbendana/Projects/enterprise-client-connector/vendor/github.com/nlohmann/json/include -IC:/Users/nbendana/Projects/enterprise-client-connector/utils/emp_logger/include -IC:/Users/nbendana/Projects/enterprise-client-connector/vendor/github.com/gabime/spdlog/include -IC:/Users/nbendana/Projects/enterprise-client-connector/windows/win_utils/include --target=amd64-pc-windows-msvc -fdiagnostics-absolute-paths -O3 -DNDEBUG -std=gnu++17 -D_DLL -D_MT -Xclang --dependent-lib=msvcrt -g -gcodeview -D_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING -Werror -Wall -Wextra -Wno-c++98-compat -Wno-c++98-compat-pedantic -MD -MT utils/general_utils/CMakeFiles/gen_utils.dir/http_utils.cpp.obj -MF utils\general_utils\CMakeFiles\gen_utils.dir\http_utils.cpp.obj.d -o utils/general_utils/CMakeFiles/gen_utils.dir/http_utils.cpp.obj -c C:/Users/nbendana/Projects/enterprise-client-connector/utils/general_utils/http_utils.cpp Error running 'C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/Llvm/bin/clang-tidy.exe': PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace. Stack dump: 0. Program arguments: "C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/Llvm/bin/clang-tidy.exe" -header-filter=.*C:/Users/nbendana/Projects/enterprise-client-connector/(?!build-)(?!vendor).* -p=C:/Users/nbendana/Projects/enterprise-client-connector/build-win64-release --warnings-as-errors=* --extra-arg-before=--driver-mode=g++ C:\\Users\\nbendana\\Projects\\enterprise-client-connector\\utils\\general_utils\\http_utils.cpp -- C:\\PROGRA~1\\MICROS~4\\2022\\PROFES~1\\VC\\Tools\\Llvm\\bin\\CLANG_~1.EXE -DBUNDLED_FMT=1 -DEMP_PRODUCTION=1 -DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE -DSPDLOG_COMPILED_LIB -IC:/Users/nbendana/Projects/enterprise-client-connector/utils/general_utils/include -IC:/Users/nbendana/Projects/enterprise-client-connector/vendor/akamai/enterprise-client-ipc/ipc_utils/include -IC:/Users/nbendana/Projects/enterprise-client-connector/vendor/github.com/nlohmann/json/include -IC:/Users/nbendana/Projects/enterprise-client-connector/utils/emp_logger/include -IC:/Users/nbendana/Projects/enterprise-client-connector/vendor/github.com/gabime/spdlog/include -IC:/Users/nbendana/Projects/enterprise-client-connector/windows/win_utils/include --target=amd64-pc-windows-msvc -fdiagnostics-absolute-paths -O3 -DNDEBUG -std=gnu++17 -D_DLL -D_MT -Xclang --dependent-lib=msvcrt -g -gcodeview -D_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING -Werror -Wall -Wextra -Wno-c++98-compat -Wno-c++98-compat-pedantic -MD -MT utils/general_utils/CMakeFiles/gen_utils.dir/http_utils.cpp.obj -MF utils\\general_utils\\CMakeFiles\\gen_utils.dir\\http_utils.cpp.obj.d -o utils/general_utils/CMakeFiles/gen_utils.dir/http_utils.cpp.obj -c C:/Users/nbendana/Projects/enterprise-client-connector/utils/general_utils/http_utils.cpp Exception Code: 0xC0000005 #0 0x015760c0 C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\Llvm\bin\clang-tidy.exe 0x8760c0
EugeneZelenko commented 2 weeks ago

Could you please try 18 or main branch? https://godbolt.org should be helpful.

Could you please provide reproducer?

PiotrZSL commented 2 weeks ago

Could you also verify what check is causing a crash ?

NissimBendanan commented 2 weeks ago

Could you please try 18 or main branch? https://godbolt.org should be helpful.

Could you please provide reproducer?

Simply add this directory to the PATH environment variable: C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\Llvm\bin

Then relaunch visual studio and build.

I have this in the cmakefile:

find_program(CLANG_TIDY_EXE clang-tidy)

if(NOT CLANG_TIDY_EXE)
    message(WARNING "!!! clang-tidy not found !!!")
    set(RUN_CLANG_TIDY OFF CACHE BOOL "Run Clang-Tidy" FORCE)
else()
    message(STATUS "Found clang-format: ${CLANG_TIDY_EXE}")
    if(FIX_CLANG_TIDY)
        set(CLANG_TIDY_FIX_ARG --fix;)
    else()
        set(CLANG_TIDY_FIX_ARG)
    endif()

    if(STRICT_CLANG_TIDY)
        set(CLANG_TIDY_WARN_ARG --warnings-as-errors=*;)
    else()
        set(CLANG_TIDY_WARN_ARG )
    endif()

    set(RUN_CLANG_TIDY_CMD ${CLANG_TIDY_EXE};
            -header-filter=.*${CMAKE_SOURCE_DIR}/\(?!build-\)\(?!vendor\).*;
            -p=${CMAKE_BINARY_DIR};
            ${CLANG_TIDY_WARN_ARG}
            ${CLANG_TIDY_FIX_ARG}
            )
endif()
NissimBendanan commented 2 weeks ago

Could you also verify what check is causing a crash ?

don't know, but I have this in the output:

Exception Code: 0xC0000005

0 0x013460c0 C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\Llvm\bin\clang-tidy.exe 0x8760c0

0x013460C0, C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\Llvm\bin\clang-tidy.exe(0x0000000000AD0000) + 0x8760C0 byte(s)

Access violation