The following snippet drives cppcheck to segfault when using it with --clang
#include <type_traits> #include <stdint.h> std::enable_if_t<sizeof(uint64_t)==8> foo() { } float bar() { } int main() { foo(); bar(); }
With head I get
Checking bar.cpp... Bailing out from checking bar.cpp since there was an internal error: invalid stoull argument
What is your exact command line?
~/Downloads/cppcheck-2.8/cppcheck --clang main.cpp Checking main.cpp... Segmentation fault (core dumped)
$ clang --version Ubuntu clang version 15.0.0-++20220706104508+5d8077565e41-1~exp1~20220706104611.584 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin
Backtrace:
Program received signal SIGSEGV, Segmentation fault. 0x00005555557e7b23 in Token::tokAt(int) const () (gdb) bt #0 0x00005555557e7b23 in Token::tokAt(int) const () #1 0x000055555579b225 in isUnknownType(Token const*, Token const*) () #2 0x000055555579e89b in Function::returnsReference(Function const*, bool) () #3 0x00005555558792dd in valueFlowLifetimeFunction(Token*, TokenList*, ErrorLogger*, Settings const*) () #4 0x0000555555883bfb in valueFlowLifetime(TokenList*, SymbolDatabase*, ErrorLogger*, Settings const*) [clone .constprop.0] () #5 0x0000555555887a1b in ValueFlow::setValues(TokenList*, SymbolDatabase*, ErrorLogger*, Settings const*) () #6 0x0000555555712ef5 in CppCheck::check(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () #7 0x00005555558af15f in CppCheckExecutor::check_internal(CppCheck&) () #8 0x00005555558b15cc in CppCheckExecutor::check(int, char const* const*) () #9 0x00005555555ffcf2 in main ()
See https://sourceforge.net/p/cppcheck/discussion/general/thread/728d08b726/
Log in to post a comment.
The following snippet drives cppcheck to segfault when using it with --clang
With head I get
What is your exact command line?
~/Downloads/cppcheck-2.8/cppcheck --clang main.cpp
Checking main.cpp...
Segmentation fault (core dumped)
$ clang --version
Ubuntu clang version 15.0.0-++20220706104508+5d8077565e41-1~exp1~20220706104611.584
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Backtrace:
See https://sourceforge.net/p/cppcheck/discussion/general/thread/728d08b726/