Skip to content

clang-tidy crashes when running -dump-config on Windows #50876

@zeroxia

Description

@zeroxia
Bugzilla Link 51534
Version unspecified
OS Windows NT

Extended Description

versions:

C:\temp>C:\opt\LLVM13\bin\clang-tidy --version
LLVM (http://llvm.org/):
LLVM version 13.0.0-rc1
Optimized build with assertions.
Default target: x86_64-pc-windows-msvc
Host CPU: skylake

C:\temp>C:\opt\LLVM12\bin\clang-tidy --version
LLVM (http://llvm.org/):
LLVM version 12.0.0
Optimized build.
Default target: x86_64-pc-windows-msvc
Host CPU: skylake

Crashes:

C:\temp>C:\opt\LLVM13\bin\clang-tidy -dump-config
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0. Program arguments: C:\opt\LLVM13\bin\clang-tidy -dump-config
#​0 0x00007ff6828816df (C:\opt\LLVM13\bin\clang-tidy.exe+0x18516df)
#​1 0x00007ff682881989 (C:\opt\LLVM13\bin\clang-tidy.exe+0x1851989)
#​2 0x00007ff68288f20b (C:\opt\LLVM13\bin\clang-tidy.exe+0x185f20b)
#​3 0x00007ff68288f114 (C:\opt\LLVM13\bin\clang-tidy.exe+0x185f114)
#​4 0x00007ff6810506b5 (C:\opt\LLVM13\bin\clang-tidy.exe+0x206b5)
#​5 0x00007ff6811f04fe (C:\opt\LLVM13\bin\clang-tidy.exe+0x1c04fe)
#​6 0x00007ff6811e3c47 (C:\opt\LLVM13\bin\clang-tidy.exe+0x1b3c47)
#​7 0x00007ff68288d2b6 (C:\opt\LLVM13\bin\clang-tidy.exe+0x185d2b6)
#​8 0x00007ff68287618e (C:\opt\LLVM13\bin\clang-tidy.exe+0x184618e)
#​9 0x00007ff6828765e1 (C:\opt\LLVM13\bin\clang-tidy.exe+0x18465e1)
#​10 0x00007ff6810330f6 (C:\opt\LLVM13\bin\clang-tidy.exe+0x30f6)
#​11 0x00007ff6833b7d40 (C:\opt\LLVM13\bin\clang-tidy.exe+0x2387d40)
#​12 0x00007ff8c4f47034 (C:\Windows\System32\KERNEL32.DLL+0x17034)
#​13 0x00007ff8c6182651 (C:\Windows\SYSTEM32\ntdll.dll+0x52651)

C:\temp>C:\opt\LLVM12\bin\clang-tidy -dump-config
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0. Program arguments: C:\opt\LLVM12\bin\clang-tidy -dump-config
#​0 0x00007ff6485dea3f (C:\opt\LLVM12\bin\clang-tidy.exe+0x12eea3f)
#​1 0x00007ff6485dec99 (C:\opt\LLVM12\bin\clang-tidy.exe+0x12eec99)
#​2 0x00007ff6485eaf45 (C:\opt\LLVM12\bin\clang-tidy.exe+0x12faf45)
#​3 0x00007ff647433b45 (C:\opt\LLVM12\bin\clang-tidy.exe+0x143b45)
#​4 0x00007ff64742c827 (C:\opt\LLVM12\bin\clang-tidy.exe+0x13c827)
#​5 0x00007ff6485e9636 (C:\opt\LLVM12\bin\clang-tidy.exe+0x12f9636)
#​6 0x00007ff6485d422e (C:\opt\LLVM12\bin\clang-tidy.exe+0x12e422e)
#​7 0x00007ff6485d45ce (C:\opt\LLVM12\bin\clang-tidy.exe+0x12e45ce)
#​8 0x00007ff6472f2f1e (C:\opt\LLVM12\bin\clang-tidy.exe+0x2f1e)
#​9 0x00007ff648fd7680 (C:\opt\LLVM12\bin\clang-tidy.exe+0x1ce7680)
#​10 0x00007ff8c4f47034 (C:\Windows\System32\KERNEL32.DLL+0x17034)
#​11 0x00007ff8c6182651 (C:\Windows\SYSTEM32\ntdll.dll+0x52651)

.clang-tidy file:

https://pastebin.com/9RJ3yLKC

Curiously, I use clangd on VS Code with this .clang-tidy file, there is no issue, and clang-tidy version 10 is also OK.

Content:


Checks: >
clang-analyzer-,
clang-diagnostic-
,

bugprone-argument-comment,
bugprone-assert-side-effect,
bugprone-bad-signal-to-kill-thread,
bugprone-bool-pointer-implicit-conversion,
bugprone-branch-clone,
bugprone-copy-constructor-init,
bugprone-dangling-handle,
bugprone-dynamic-static-initializers,
bugprone-exception-escape,
bugprone-fold-init-type,
bugprone-forward-declaration-namespace,
bugprone-forwarding-reference-overload,
bugprone-inaccurate-erase,
bugprone-incorrect-roundings,
bugprone-infinite-loop,
bugprone-integer-division,
bugprone-lambda-function-name,
bugprone-macro-parentheses,
bugprone-macro-repeated-side-effects,
bugprone-misplaced-operator-in-strlen-in-alloc,
bugprone-misplaced-widening-cast,
bugprone-move-forwarding-reference,
bugprone-multiple-statement-macro,
bugprone-narrowing-conversions,
bugprone-not-null-terminated-result,
bugprone-parent-virtual-call,
bugprone-posix-return,
bugprone-signed-char-misuse,
bugprone-sizeof-container,
bugprone-sizeof-expression,
bugprone-string-constructor,
bugprone-string-integer-assignment,
bugprone-string-literal-with-embedded-nul,
bugprone-suspicious-enum-usage,
bugprone-suspicious-memset-usage,
bugprone-suspicious-missing-comma,
bugprone-suspicious-semicolon,
bugprone-suspicious-string-compare,
bugprone-swapped-arguments,
bugprone-terminating-continue,
bugprone-throw-keyword-missing,
bugprone-too-small-loop-variable,
bugprone-undefined-memory-manipulation,
bugprone-undelegated-constructor,
bugprone-unhandled-self-assignment,
bugprone-unused-raii,
bugprone-unused-return-value,
bugprone-use-after-move,
bugprone-virtual-near-miss,

cppcoreguidelines-avoid-c-arrays,
cppcoreguidelines-avoid-goto,
-cppcoreguidelines-avoid-magic-numbers,
cppcoreguidelines-c-copy-assignment-signature,
cppcoreguidelines-explicit-virtual-functions,
cppcoreguidelines-init-variables,
cppcoreguidelines-interfaces-global-init,
cppcoreguidelines-macro-usage,
cppcoreguidelines-narrowing-conversions,
cppcoreguidelines-no-malloc,
cppcoreguidelines-non-private-member-variables-in-classes,
cppcoreguidelines-owning-memory,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
cppcoreguidelines-pro-bounds-constant-array-index,
cppcoreguidelines-pro-bounds-pointer-arithmetic,
cppcoreguidelines-pro-type-const-cast,
cppcoreguidelines-pro-type-cstyle-cast,
cppcoreguidelines-pro-type-member-init,
cppcoreguidelines-pro-type-reinterpret-cast,
cppcoreguidelines-pro-type-static-cast-downcast,
cppcoreguidelines-pro-type-union-access,
cppcoreguidelines-pro-type-vararg,
cppcoreguidelines-slicing,
cppcoreguidelines-special-member-functions,

google-build-explicit-make-pair,
google-build-namespaces,
-google-build-using-namespace,
google-default-arguments,
google-explicit-constructor,
google-global-names-in-headers,
-google-objc-avoid-nsobject-new,
-google-objc-avoid-throwing-exception,
-google-objc-function-naming,
-google-objc-global-variable-declaration,
google-readability-braces-around-statements,
google-readability-casting,
google-readability-avoid-underscore-in-googletest-name,
-google-readability-todo,
google-runtime-int,
google-runtime-operator,
-google-runtime-references,
google-upgrade-googletest-case,

misc-definitions-in-headers,
misc-misplaced-const,
misc-new-delete-overloads,
misc-non-copyable-objects,
misc-non-private-member-variables-in-classes,
misc-redundant-expression,
misc-static-assert,
misc-throw-by-value-catch-by-reference,
misc-unconventional-assign-operator,
misc-uniqueptr-reset-release,
misc-unused-alias-decls,
-misc-unused-parameters,
misc-unused-using-decls,

modernize-avoid-bind,
modernize-avoid-c-arrays,
modernize-concat-nested-namespaces,
modernize-deprecated-headers,
modernize-deprecated-ios-base-aliases,
modernize-loop-convert,
modernize-make-shared,
modernize-make-unique,
modernize-pass-by-value,
modernize-raw-string-literal,
modernize-redundant-void-arg,
modernize-replace-auto-ptr,
modernize-replace-random-shuffle,
modernize-return-braced-init-list,
modernize-shrink-to-fit,
modernize-unary-static-assert,
modernize-use-auto,
modernize-use-bool-literals,
modernize-use-default-member-init,
modernize-use-emplace,
modernize-use-equals-default,
modernize-use-equals-delete,
modernize-use-nodiscard,
modernize-use-noexcept,
modernize-use-nullptr,
modernize-use-override,
-modernize-use-trailing-return-type,
modernize-use-transparent-functors,
modernize-use-uncaught-exceptions,
modernize-use-using,

performance-faster-string-find,
performance-for-range-copy,
performance-implicit-conversion-in-loop,
performance-inefficient-algorithm,
performance-inefficient-string-concatenation,
performance-inefficient-vector-operation,
performance-move-const-arg,
performance-move-constructor-init,
performance-noexcept-move-constructor,
performance-trivially-destructible,
performance-type-promotion-in-math-fn,
performance-unnecessary-copy-initialization,
performance-unnecessary-value-param,

readability-avoid-const-params-in-decls,
readability-braces-around-statements,
readability-const-return-type,
readability-container-size-empty,
readability-convert-member-functions-to-static,
readability-delete-null-pointer,
readability-deleted-default,
readability-else-after-return,
readability-function-size,
readability-identifier-naming,
readability-implicit-bool-conversion,
readability-inconsistent-declaration-parameter-name,
readability-isolate-declaration,
-readability-magic-numbers,
readability-make-member-function-const,
readability-misleading-indentation,
readability-misplaced-array-index,
readability-named-parameter,
readability-non-const-parameter,
readability-qualified-auto,
readability-redundant-access-specifiers,
readability-redundant-control-flow,
readability-redundant-declaration,
readability-redundant-function-ptr-dereference,
readability-redundant-member-init,
readability-redundant-preprocessor,
readability-redundant-smartptr-get,
readability-redundant-string-cstr,
readability-redundant-string-init,
readability-simplify-boolean-expr,
readability-simplify-subscript-expr,
readability-static-accessed-through-instance,
readability-static-definition-in-anonymous-namespace,
readability-string-compare,
readability-uniqueptr-delete-release,
readability-uppercase-literal-suffix,
hicpp-exception-baseclass,
hicpp-multiway-paths-covered

Turn all the warnings from the checks above into errors.

#WarningsAsErrors: '*'

HeaderFilterRegex: '.*'

AnalyzeTemporaryDtors: false

CheckOptions:

  • key: cppcoreguidelines-no-malloc.Allocations
    value: '::malloc;::calloc'
  • key: cppcoreguidelines-no-malloc.Deallocations
    value: '::free'
  • key: cppcoreguidelines-no-malloc.Reallocations
    value: '::realloc'
  • key: cppcoreguidelines-owning-memory.LegacyResourceConsumers
    value: '::free;::realloc;::freopen;::fclose'
  • key: cppcoreguidelines-owning-memory.LegacyResourceProducers
    value: '::malloc;::aligned_alloc;::realloc;::calloc;::fopen;::freopen;::tmpfile'
  • key: cppcoreguidelines-pro-bounds-constant-array-index.GslHeader
    value: ''
  • key: cppcoreguidelines-pro-bounds-constant-array-index.IncludeStyle
    value: '0'
  • key: cppcoreguidelines-pro-type-member-init.IgnoreArrays
    value: '0'
  • key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctions
    value: '1'
  • key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor
    value: '1'
  • key: google-readability-braces-around-statements.ShortStatementLines
    value: '1'
  • key: google-readability-function-size.StatementThreshold
    value: '800'
  • key: google-readability-namespace-comments.ShortNamespaceLines
    value: '10'
  • key: google-readability-namespace-comments.SpacesBeforeComments
    value: '2'
  • key: modernize-loop-convert.MaxCopySize
    value: '16'
  • key: modernize-loop-convert.MinConfidence
    value: reasonable
  • key: modernize-loop-convert.NamingStyle
    value: CamelCase
  • key: modernize-pass-by-value.IncludeStyle
    value: llvm
  • key: modernize-replace-auto-ptr.IncludeStyle
    value: llvm
  • key: modernize-use-nullptr.NullMacros
    value: 'NULL'
  • key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic¶
    value: 'true'
  • key: misc-non-private-member-variables-in-classes.IgnorePublicMemberVariables¶
    value: 'true'
  • key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
    value: 'true'
    ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang-tidycrashPrefer [crash-on-valid] or [crash-on-invalid]

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions