Im just running cppcheck --enable=all with this code and I'm getting segfault
#include"SBPAudioFileFormatChecker.h"#include"SBPAudioFileFormatCheckerBase.h"#include"SBPAudioFileFormatCheckerWav.h"#include"SBPAudioValidFormats.h"#include<map>#include<memory>///! Privateclassbasic_factory_file_format_checker{public:basic_factory_file_format_checker(){m_factory[WAV]=std::unique_ptr<base_file_format_checker>(newSBPAudioFileFormatCheckerWav());}/** * Factory with the list of file loaders * if not file is found we will return a nullptr */std::map<SBPAudioValidFormat,std::unique_ptr<base_file_format_checker>>m_factory;};staticbasic_factory_file_format_checkerg_factory;///! Privatestd::shared_ptr<SBPAudioFile>SBPAudioFileFormatLoader::Load(conststd::string&filename){if(filename.empty()){returnnullptr;}for(auto&element: g_factory.m_factory){if(element.second->checks(filename)){}}}
This is the gdb output
(gdb) bt
#0 0x0000003e68ccf04d in std::string::compare(char const*) const () from /lib64/libstdc++.so.6
#1 0x000000000050761e in UninitVar::parse(Token const&, std::list<ExecutionPath*, std::allocator<ExecutionPath*> >&) const ()
#2 0x000000000052ad9d in ExecutionPath::checkScope(Token const*, std::list<ExecutionPath*, std::allocator<ExecutionPath*> >&) ()
#3 0x000000000052bd5e in checkExecutionPaths(SymbolDatabase const*, ExecutionPath*) ()
#4 0x00000000004fe6b9 in CheckUninitVar::executionPaths() ()
#5 0x0000000000508f6a in CheckUninitVar::runSimplifiedChecks(Tokenizer const*, Settings const*, ErrorLogger*) ()
#6 0x000000000051922a in CppCheck::checkFile(std::string const&, char const*, std::set<unsigned long long, std::less<unsigned long long>, std::allocator<unsigned long long> >&) ()
#7 0x000000000051bf05 in CppCheck::processFile(std::string const&, std::istream&) ()
#8 0x000000000051d7db in CppCheck::check(std::string const&) ()
#9 0x0000000000443f8d in CppCheckExecutor::check_internal(CppCheck&, int, char const* const*) ()
#10 0x0000000000444fef in CppCheckExecutor::check(int, char const* const*) ()
#11 0x00000000004390f3 in main ()
(gdb)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks! This segfault should be fixed already. This ExecutionPath stuff has been removed in latest git head. If you want, feel free to download the latest source code and verify that it works.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Im just running cppcheck --enable=all with this code and I'm getting segfault
This is the gdb output
Thanks! This segfault should be fixed already. This ExecutionPath stuff has been removed in latest git head. If you want, feel free to download the latest source code and verify that it works.