Donate cpu server crash locations#2276
Conversation
This adds the number of crashes per file and line to the crash report. Example output: HEAD Crash location Count lib/symboldatabase.h:342 2 build/valueflow.cpp:3775 1 lib/token.h:201 1
|
sounds good! |
|
What about creating a hash from the callstack? It could be shown in the crash report to quickly identify problems. |
Yes, that would make it possible to separate crashes in say Or what about just printing the entire call stack and the number of crashes that resulted in it? With a cap of the depth to avoid printing out everything when we have infinite recursion... Something like: 10 crashes 3 crashes Etc. |
I was also thinking about doing a report like this. I also wasn't sure how to handle it, but my idea was to make a different report which just lists the library with the date and the signature of the function the crash happened in so you get a brief overview. |
|
Here is a crash report created with Cygwin: |
|
I decided to try to print the entire call stack. I've tested by downloading all available crash files on the daca@home server, oneliner below for f in $(curl -s http://cppcheck1.osuosl.org:8000/crash.html | grep -o '".*"' | tr -d '"'); do curl -s -O http://cppcheck1.osuosl.org:8000/$f; doneNow, after the list of all crashes, stack traces are printed too, with the most common one at the top together with the packages that had that specific stack trace. Example output (the packages are linked in the report, but I couldn't be bothered trying to get that to work in this comment). As you can see, the line with the packages is quite long for the most common crash. Also, it prints Packages even if the stack trace comes from a single package : Stack traces |
Example output: Packages: psi xenomai Token::hasKnownValue (this=0x0) at lib/token.h:988 988 return mImpl->mValues && std::any_of(mImpl->mValues->begin(), mImpl->mValues->end(), std::mem_fn(&ValueFlow::Value::isKnown)); #0 Token::hasKnownValue (...) at lib/token.h:988 #1 valueFlowReverse (...) at build/valueflow.cpp:3775 danmar#2 valueFlowBeforeCondition (...) at /usr/include/c++/8/bits/stl_list.h:301 danmar#3 ValueFlow::setValues (...) at build/valueflow.cpp:8403 danmar#4 Tokenizer::simplifyTokens1 (...) at build/tokenize.cpp:11095 danmar#5 CppCheck::checkFile (...) at build/cppcheck.cpp:513 danmar#6 CppCheck::check (...) at /usr/include/c++/8/bits/basic_string.h:936 danmar#7 CppCheckExecutor::check_internal (...) at cli/cppcheckexecutor.cpp:884 danmar#8 CppCheckExecutor::check (...) at cli/cppcheckexecutor.cpp:198 danmar#9 main (...) at cli/main.cpp:95 Packages: broker valueFlowReverse (tokenlist=tokenlist@entry=0x7fffffffbce0, tok=tok@entry=0x555555cc9930, varToken=varToken@entry=0x555555cc9b70, val=..., val2=..., errorLogger=errorLogger@entry=0x7fffffffcb20, settings=0x7fffffffcd40) at build/valueflow.cpp:3775 3775 if (!assignTok->hasKnownValue()) { #0 valueFlowReverse (...) at build/valueflow.cpp:3775 #1 valueFlowBeforeCondition (...) at build/valueflow.cpp:4092 danmar#2 ValueFlow::setValues (...) at build/valueflow.cpp:8406 danmar#3 Tokenizer::simplifyTokens1 (...) at build/tokenize.cpp:11095 danmar#4 CppCheck::checkFile (...) at build/cppcheck.cpp:513 danmar#5 CppCheck::check (...) at build/cppcheck.cpp:197 danmar#6 CppCheckExecutor::check_internal (...) at cli/cppcheckexecutor.cpp:884 danmar#7 CppCheckExecutor::check (...) at cli/cppcheckexecutor.cpp:198 danmar#8 main (...) at cli/main.cpp:95
a983159 to
faf95ea
Compare
|
The improved crash report is great. |
Co-Authored-By: Sebastian <versat@users.noreply.github.com>
|
Thanks for testing, I applied your suggestion about the regex (tested locally). |
donate-cpu-server: Print grouped stack traces in crash report Example output: Packages: psi xenomai Token::hasKnownValue (this=0x0) at lib/token.h:988 988 return mImpl->mValues && std::any_of(mImpl->mValues->begin(), mImpl->mValues->end(), std::mem_fn(&ValueFlow::Value::isKnown)); #0 Token::hasKnownValue (...) at lib/token.h:988 #1 valueFlowReverse (...) at build/valueflow.cpp:3775 danmar#2 valueFlowBeforeCondition (...) at /usr/include/c++/8/bits/stl_list.h:301 danmar#3 ValueFlow::setValues (...) at build/valueflow.cpp:8403 danmar#4 Tokenizer::simplifyTokens1 (...) at build/tokenize.cpp:11095 danmar#5 CppCheck::checkFile (...) at build/cppcheck.cpp:513 danmar#6 CppCheck::check (...) at /usr/include/c++/8/bits/basic_string.h:936 danmar#7 CppCheckExecutor::check_internal (...) at cli/cppcheckexecutor.cpp:884 danmar#8 CppCheckExecutor::check (...) at cli/cppcheckexecutor.cpp:198 danmar#9 main (...) at cli/main.cpp:95 Packages: broker valueFlowReverse (tokenlist=tokenlist@entry=0x7fffffffbce0, tok=tok@entry=0x555555cc9930, varToken=varToken@entry=0x555555cc9b70, val=..., val2=..., errorLogger=errorLogger@entry=0x7fffffffcb20, settings=0x7fffffffcd40) at build/valueflow.cpp:3775 3775 if (!assignTok->hasKnownValue()) { #0 valueFlowReverse (...) at build/valueflow.cpp:3775 #1 valueFlowBeforeCondition (...) at build/valueflow.cpp:4092 danmar#2 ValueFlow::setValues (...) at build/valueflow.cpp:8406 danmar#3 Tokenizer::simplifyTokens1 (...) at build/tokenize.cpp:11095 danmar#4 CppCheck::checkFile (...) at build/cppcheck.cpp:513 danmar#5 CppCheck::check (...) at build/cppcheck.cpp:197 danmar#6 CppCheckExecutor::check_internal (...) at cli/cppcheckexecutor.cpp:884 danmar#7 CppCheckExecutor::check (...) at cli/cppcheckexecutor.cpp:198 danmar#8 main (...) at cli/main.cpp:95
Refactor
donate-cpu-server.pyslightly, then add the number of crashes per file and line.I think this could be useful when there are lots of crashes in daca@home (like now for example), to get an overview where the crashes occur, if there are multiple problems, etc. Some input on this would be good (for example, should it be formatted differently? Would it be useful to generate new html-pages for each file/line with links to the packages that crashed?). The changes are easiest to review if you ignore white-space changes, since a fairly large chunk had its indentation changed in
crashReport().Example output:
Crash report