I run ubuntu docker and install cppcheck in container. Most cppcheck actions are fine. But when I ran cppcheck with config file which is tested fine on host machine, got message "cppcheck: Failed to load library configuration file“.
I tried "strace -o /tmp/strace.out cppcheck --library=config.file" and got :
open("std", O_RDONLY) = -1 ENOENT (No such file or directory)
open("std.cfg", O_RDONLY) = -1 ENOENT (No such file or directory)
open("cfg/std.cfg", O_RDONLY) = -1 ENOENT (No such file or directory)
open("soter.cfg", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0664, st_size=123, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f318e90e000
fstat(3, {st_mode=S_IFREG|0664, st_size=123, ...}) = 0
lseek(3, 0, SEEK_SET) = 0
read(3, "<?xml version=\"1.0\"?>\n<def>\n<res"..., 123) = 123
lseek(3, 123, SEEK_SET) = 123
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f318e90d000
write(1, "cppcheck: Failed to load library"..., 64) = 64
exit_group(1) = ?
It seems config file was read out and finished with error immediatlly.
Any tip will be appreciated!
James
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
in that output it looks to me as it failed to load std.cfg.
but you wrote "Most cppcheck actions are fine". So that can't be the problem.
The code that writes that error message is:
std::stringerrmsg;switch(err.errorcode){caseLibrary::OK:break;caseLibrary::FILE_NOT_FOUND:errmsg="File not found";break;caseLibrary::BAD_XML:errmsg="Bad XML";break;caseLibrary::UNKNOWN_ELEMENT:errmsg="Unexpected element";break;caseLibrary::MISSING_ATTRIBUTE:errmsg="Missing attribute";break;caseLibrary::BAD_ATTRIBUTE_VALUE:errmsg="Bad attribute value";break;caseLibrary::UNSUPPORTED_FORMAT:errmsg="File is of unsupported format version";break;caseLibrary::DUPLICATE_PLATFORM_TYPE:errmsg="Duplicate platform type";break;caseLibrary::PLATFORM_TYPE_REDEFINED:errmsg="Platform type redefined";break;}if(!err.reason.empty())errmsg+=" '"+err.reason+"'";std::cout<<"cppcheck: Failed to load library configuration file '"<<filename<<"'. "<<errmsg<<std::endl;
Is there no reason why it failed written?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I run ubuntu docker and install cppcheck in container. Most cppcheck actions are fine. But when I ran cppcheck with config file which is tested fine on host machine, got message "cppcheck: Failed to load library configuration file“.
I tried "strace -o /tmp/strace.out cppcheck --library=config.file" and got :
It seems config file was read out and finished with error immediatlly.
Any tip will be appreciated!
James
strange.
in that output it looks to me as it failed to load std.cfg.
but you wrote "Most cppcheck actions are fine". So that can't be the problem.
The code that writes that error message is:
Is there no reason why it failed written?