I just recently pushed 1.87 into Fedora. Someone using the program got a program crash which was reported via the abort daemon. You can see the back trace here:
It looks like its related to commit 9490d0db8c323c16933da54e1c3621da1e9c335f but a different path resulting in the same crash. Is there another commit that also addresses this? Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I get "Bug Access Denied". Not sure if someone from the Cppcheck team has an account and also the necessary rights.
Can you anonymize the bug report somehow if necessary and post it here maybe?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Backtrace is:
Thread no. 1 (10 frames)
0 Token::tokAt at /usr/src/debug/cppcheck-1.87-1.fc29.x86_64/lib/token.cpp:332
2 TemplateSimplifier::simplifyTemplateAliases at /usr/src/debug/cppcheck-1.87-1.fc29.x86_64/lib/templatesimplifier.cpp:931
3 TemplateSimplifier::simplifyTemplates at /usr/src/debug/cppcheck-1.87-1.fc29.x86_64/lib/templatesimplifier.cpp:3106
4 Tokenizer::simplifyTemplates at /usr/src/debug/cppcheck-1.87-1.fc29.x86_64/lib/tokenize.cpp:2336
5 Tokenizer::simplifyTokenList1 at /usr/src/debug/cppcheck-1.87-1.fc29.x86_64/lib/tokenize.cpp:3911
6 Tokenizer::simplifyTokens1 at /usr/include/c++/8/bits/basic_string.h:2290
7 CppCheck::checkFile at /usr/src/debug/cppcheck-1.87-1.fc29.x86_64/lib/cppcheck.cpp:406
8 CppCheck::check at /usr/include/c++/8/bits/basic_string.h:936
9 CppCheckExecutor::check_internal at /usr/include/c++/8/ext/aligned_buffer.h:74
10 CppCheckExecutor::check at /usr/src/debug/cppcheck-1.87-1.fc29.x86_64/cli/cppcheckexecutor.cpp:198
hmm.. I fail to reproduce when I scan that project without --project. Then I tried to create the compile commands with cmake but it fails, it seems there are missing dependencies.. sorry but I won't look into reproducing this further. But maybe somebody else will.
I am interested to have a single file that reproduce the problem. It should be a reduced file so we can create a regression test.
Last edit: Daniel Marjamäki 2019-02-21
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have downloaded the source code of the master branch.
I am able to create the compile_commands.json by using the commands like they are used by travis and let Cppcheck analyze the project.
It took some time to analyze the 14 files but it finished without problems:
Argh. I guess the text length of my previous post triggered some moderation limit.
In short:
I was able to create a compile_commands.json via cmake on Cygwin 64.
I analyzed the sources with the --project option of Cppcheck but it finished successfully.
I am trying other parameters now, but analysis takes some time.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have created one big file with Cppchecks -E parameter that causes Cppcheck 1.87 to segfault.
The backtrace for this segfault is this:
Thread1"cppcheck"receivedsignalSIGSEGV,Segmentationfault.Token::tokAt(this=this@entry=0x0,index=index@entry=-2)atlib/token.cpp:332332tok=tok->previous();(gdb)bt#0 Token::tokAt (this=this@entry=0x0, index=index@entry=-2) at lib/token.cpp:332#1 0x000000010051d9d7 in Token::tokAt (index=-2, this=0x0) at lib/token.h:190#2 TemplateSimplifier::simplifyTemplateAliases (this=this@entry=0x602d1b3e0) at lib/templatesimplifier.cpp:931#3 0x0000000100524aff in TemplateSimplifier::simplifyTemplates (this=0x602d1b3e0, maxtime=0, codeWithTemplates=@0xffffb5e0: true) at lib/templatesimplifier.cpp:3106#4 0x0000000100545962 in Tokenizer::simplifyTemplates (this=this@entry=0xffffb530) at lib/tokenize.cpp:2336#5 0x000000010055eb5c in Tokenizer::simplifyTokenList1 (this=this@entry=0xffffb530, FileName=<optimized out>) at lib/tokenize.cpp:3913#6 0x000000010055ebc6 in Tokenizer::simplifyTokens1 (this=this@entry=0xffffb530, configuration=...) at lib/tokenize.cpp:1754#7 0x00000001004b7f4e in CppCheck::checkFile (this=this@entry=0xffffbeb0, filename=..., cfgname=..., fileStream=...) at lib/cppcheck.cpp:406#8 0x00000001004ba7f9 in CppCheck::check (this=this@entry=0xffffbeb0, path=...) at lib/cppcheck.cpp:97#9 0x000000010058c7a3 in CppCheckExecutor::check_internal (this=this@entry=0xffffc950, cppcheck=..., argv=argv@entry=0xffffcc20) at cli/cppcheckexecutor.cpp:872#10 0x000000010058da9f in CppCheckExecutor::check (this=this@entry=0xffffc950, argc=argc@entry=2, argv=argv@entry=0xffffcc20) at cli/cppcheckexecutor.cpp:198#11 0x00000001005fa14e in main (argc=2, argv=0xffffcc20) at cli/main.cpp:95
I attach the segfault.cpp in a zip file. It is over 7MB in size.
I do not know how to further debug this and create a reduced example.
Hello,
I just recently pushed 1.87 into Fedora. Someone using the program got a program crash which was reported via the abort daemon. You can see the back trace here:
https://bugzilla.redhat.com/show_bug.cgi?id=1679121
It looks like its related to commit 9490d0db8c323c16933da54e1c3621da1e9c335f but a different path resulting in the same crash. Is there another commit that also addresses this? Thanks!
I get "Bug Access Denied". Not sure if someone from the Cppcheck team has an account and also the necessary rights.
Can you anonymize the bug report somehow if necessary and post it here maybe?
Hmm. Sorry about that. There is a retrace server instance here:
https://retrace.fedoraproject.org/faf/reports/2470624/
Backtrace is:
Thread no. 1 (10 frames)
0 Token::tokAt at /usr/src/debug/cppcheck-1.87-1.fc29.x86_64/lib/token.cpp:332
2 TemplateSimplifier::simplifyTemplateAliases at /usr/src/debug/cppcheck-1.87-1.fc29.x86_64/lib/templatesimplifier.cpp:931
3 TemplateSimplifier::simplifyTemplates at /usr/src/debug/cppcheck-1.87-1.fc29.x86_64/lib/templatesimplifier.cpp:3106
4 Tokenizer::simplifyTemplates at /usr/src/debug/cppcheck-1.87-1.fc29.x86_64/lib/tokenize.cpp:2336
5 Tokenizer::simplifyTokenList1 at /usr/src/debug/cppcheck-1.87-1.fc29.x86_64/lib/tokenize.cpp:3911
6 Tokenizer::simplifyTokens1 at /usr/include/c++/8/bits/basic_string.h:2290
7 CppCheck::checkFile at /usr/src/debug/cppcheck-1.87-1.fc29.x86_64/lib/cppcheck.cpp:406
8 CppCheck::check at /usr/include/c++/8/bits/basic_string.h:936
9 CppCheckExecutor::check_internal at /usr/include/c++/8/ext/aligned_buffer.h:74
10 CppCheckExecutor::check at /usr/src/debug/cppcheck-1.87-1.fc29.x86_64/cli/cppcheckexecutor.cpp:198
Description of problem:
1. running cppcheck using --project option from buildbot on internal project
2. failed on checking https://github.com/rbock/sqlpp11-connector-sqlite3
Hope this helps...
hmm.. I fail to reproduce when I scan that project without --project. Then I tried to create the compile commands with cmake but it fails, it seems there are missing dependencies.. sorry but I won't look into reproducing this further. But maybe somebody else will.
I am interested to have a single file that reproduce the problem. It should be a reduced file so we can create a regression test.
Last edit: Daniel Marjamäki 2019-02-21
I have downloaded the source code of the master branch.
I am able to create the compile_commands.json by using the commands like they are used by travis and let Cppcheck analyze the project.
It took some time to analyze the 14 files but it finished without problems:
Tested with Cygwin 64 on Windows 7 64bit with Cppcheck master branch.
Argh. I guess the text length of my previous post triggered some moderation limit.
In short:
I was able to create a compile_commands.json via cmake on Cygwin 64.
I analyzed the sources with the --project option of Cppcheck but it finished successfully.
I am trying other parameters now, but analysis takes some time.
I can reproduce the segfault with 1.87, but not with git head. So it seems to be fixed now.
I have created one big file with Cppchecks
-E
parameter that causes Cppcheck 1.87 to segfault.The backtrace for this segfault is this:
I attach the segfault.cpp in a zip file. It is over 7MB in size.
I do not know how to further debug this and create a reduced example.