Commit Graph

920 Commits

Author SHA1 Message Date
Paul Fultz II 12f4353d40 Add build scripts for triage tool (#1862) 2019-06-01 10:48:39 +02:00
Carlo Marcelo Arenas Belón bf5c71bdca sync (#1835)
* build: remove -Wabi and add -Wundef

gcc >= 8 throws a warning about -Wabi (without a specific ABI version)
being ignored, while -Wundef seems more useful (as shown by the change
in config.h, which was probably an unfortunate typo)

travis.yaml should probably be updated soon, but was left out from this
change as the current images don't yet need it

* lib: unused function in valueflow

refactored out since 8c03be3212

lib/valueflow.cpp:3124:21: warning: unused function 'endTemplateArgument' [-Wunused-function]

* readme: include picojson

* make: also clean exe
2019-05-17 09:31:41 +02:00
Daniel Marjamäki ece13033b2 dmake: use -isystem for externals to avoid compiler warnings 2019-04-19 14:52:49 +02:00
Daniel Marjamäki b0e1138f80 pr.py: fix 2019-04-16 20:13:38 +02:00
Daniel Marjamäki 0c3a6b44f8 tools/pr.py: add --rebase=true to pull command and abort if there are conflicts 2019-04-15 06:59:28 +02:00
IOBYTE 2b6d599f1e donate-cpu.py: show size of results sent to server (#1784) 2019-04-05 14:11:03 +02:00
Oliver Stöneberg 6e6cdae20e donate-cpu.py: improved error handling when fetching cppcheck version (#1780)
During a local scan it did not get any cppcheck versions causing the script to fail with an exception when creating the diff.
2019-04-04 13:09:35 +02:00
versat 20814d37d0 donate-cpu-server.py: Fix wrong detection of invalid messageIds.
Packages now can contain something like:
```
    head results:
    Checking temp/openvdb/Platform.cc: __GNUC__=1...
    [New Thread 7892.0x91c]
```
"New Thread 7892.0x91c" was wrongly identified as messageId in the HEAD
report.
This commit adds code to skip lines that start with `[` or where the
messageId contains at least one space.
2019-04-03 11:46:45 +02:00
Oliver Stöneberg 8c26d4ee6a donate-cpu.py: more error detection improvements / properly update data on server (#1768)
* donate-cpu.py: made exitcodes > 0 negative so they will be detected a crash / changed the ThreadExecutor error to -222

* donate-cpu.py: unconditionally upload results and info now that errors are properly handled - will also properly clear the result/info in case there are no more messages

* donate-cpu.py: bumped version

* donate-cpu.py: added stdout to output in case of exitcode != 0

* donate-cpu.py: do not scan packages with no relevant files

* donate-cpu.py: bumped version
2019-04-03 09:27:04 +02:00
versat 6b9a25869e donate-cpu.py: Improve upload error handling, remove old "fast" code.
If an upload fails, the reason (exception text) is now printed.
Fix: If the last retry failed do not wait until continuing.
Remove some obsolete "fast" code in the uploadResults() function.

Tested with Python 2.7.16 and Python 3.6.8.
2019-04-02 10:23:57 +02:00
versat a05cdadbf4 donate-cpu-server.py: Remove obsolete experimental "fast" code.
Since the directory for the results does no longer exist on the server,
the server currently crashes every time older clients try to upload
experimental fast results via "write-fast" command.
Now this command is just ignored so the server is instantly ready
again after a "write-fast" command.
2019-03-29 12:52:27 +01:00
Oliver Stöneberg 36950d7d0d donate-cpu-server.py: added stale report / cleanups (#1767)
* donate-cpu.server.py: increased "Package" column width for latest report and small cleanup

* donate-cpu.server.py: added date and time to crash report

* donate-cpu.server.py: simplified strDateTime()

* donate-cpu.server.py: add stale report to show results which are older than 30 days

* donate-cpu-server.py: added version and some logging
2019-03-29 12:12:16 +01:00
versat cdb449a1b8 donate-cpu.py: Only some cosmetic / coding style fixes. 2019-03-29 09:51:56 +01:00
Oliver Stöneberg 8d7d93aea7 donate-cpu.py: improved error detection (#1766)
* threadexecutor.cpp: streamlined error messages

* donate-cpu.py: detect additional signals and exitcode != 0 as crash as well and (ab)use elapsedTime to make the errorcode visible in the output / also detect ThreadExecutor issues

* donate-cpu.py: bumped version

* donate-cpu.py: fixed detection of ThreadExecutor errors
2019-03-29 06:53:40 +01:00
Oliver Stöneberg 7d383d1684 donate-cpu.py: add stack traces for daca@home crashes / bugfixes (#1764)
* Get stack traces for daca@home crashes

If a command in daca@home crashes, execute it again within gdb to get a stack trace.

* donate-cpu.py: added "gdb" to checkRequirements()

* donate-cpu.py: handle wget failures

* donate-cpu.py: added --no-upload option to disable all uploads

* donate-cpu.py: set max_packages to 1 if --package is provided to avoid endless processing of the same package

* donate-cpu.py: no longer treat missing sources as a crash

* donate-cpu.py: fixed wget "http://: Invalid host name." error caused by empty argument in subprocess.call()

* donate-cpu.py: added --no-upload to --help

* donate-cpu.py: detect crashes when using -j1

* donate-cpu.py: added -g to compiler flags

* donate-cpu.py: fixed gdb call and stacktrace printing / always pass "-j1" to gdb call so the exception will actually occur in the application

* donate-cpu.py: removed left-over --verbose from wget call

* donate-cpu.py: removed unnecessary break

* donate-cpu.py: only use gdb for crash in head run / actually provide the stack trace for the output

* donate-cpu.py: include the last checked file with the stack trace

* donate-cpu.py: removed unnecessary wget() call and a sleep in it / also inverted some logic

* donate-cpu.py: small hasInclude() optimization

* donate-cpu.py: bumped version number

* donate-cpu.py: detect start of gdb output when Cygwin is used

The Cygwin output looks like this:

Thread 1 "cppcheck" received signal SIGSEGV, Segmentation fault.

Co-Authored-By: firewave <firewave@users.noreply.github.com>
2019-03-28 15:49:20 +01:00
Daniel Marjamäki 8231912af9 daca2-getpackages: more protection when it goes wrong 2019-03-27 06:41:35 +01:00
Daniel Marjamäki 8f7eae2948 daca2-getpackages: terminate with an exit code if download fails 2019-03-27 06:33:08 +01:00
Daniel Marjamäki c7155a8e08 Removed '--experimental-fast' flag 2019-03-17 08:19:56 +01:00
versat 4e051ef865 donate-cpu.py: Improve Python library detection.
The official documentation recommends to include the Python C API via
`#include "Python.h"`:
https://docs.python.org/3/c-api/intro.html
And many projects do it exactly this way, that is why the client script
often does not detect the usage of the Python C API.
2019-03-15 16:16:38 +01:00
versat 49f2fd6d4a donate-cpu.py: Detect and use ruby library. 2019-03-15 15:34:06 +01:00
Sebastian 1230357146
Library: Add initial configuration with tests for SQLite3 library. (#1737) 2019-03-13 13:57:40 +01:00
Daniel Marjamäki 35bbe5617a Revert "Add semver import for sorting ls-lR list (#1735)"
This reverts commit e61343f213.
2019-03-12 06:25:11 +01:00
Bo Rydberg e61343f213 Add semver import for sorting ls-lR list (#1735) 2019-03-12 06:14:31 +01:00
Daniel Marjamäki 5915fd50a5 triage: add options 'show 100 random results' and 'version' 2019-03-09 11:01:22 +01:00
orbitcowboy b9623eb4a6 donate-cpu.py: Do not used windows.cfg in daca@home for now. 2019-03-08 17:30:39 +01:00
orbitcowboy 267074964d donate-cpu.py: Auto detect <windows.h> and activate windows.cfg. 2019-03-07 00:59:57 +01:00
versat e64c631dea start_donate_cpu_client_productive.sh: Update client script regularly.
Use the new option `--max-packages=` to update the client script (and
the repository) regularly.
2019-03-06 08:41:16 +01:00
orbitcowboy fee5639fc8 donate-cpu.py: Enable microsoft_sal library in case <sal.h> is found by scanPackage(). 2019-03-05 18:18:24 +01:00
versat 0498b9ec34 opgengl.cfg: Introduce OpenGL library configuration file.
Prepare donate-cpu.py to detect OpenGL library usage but comment it
out for now.
2019-03-04 14:10:06 +01:00
Daniel Marjamäki d84dbf6b5f reduce.py: Improved help text 2019-03-03 20:18:54 +01:00
orbitcowboy d4511d3a22 donate-cpu.py: Auto detect cppunit configuration after next release. 2019-03-03 17:05:40 +01:00
orbitcowboy d1b42434f3 donate-cpu.py: Auto detect cppunit configuration after next release. 2019-03-03 17:04:03 +01:00
Daniel Marjamäki cb575576c7 tools/readme.md: the tools/reduce.cpp has been removed and tools/reduce.py should be used instead 2019-03-02 18:48:44 +01:00
Daniel Marjamäki 5e88258005 Makefile: Remove reduce target 2019-03-02 12:11:04 +01:00
Daniel Marjamäki 71a1290ef0 Remove reduce.cpp, let's use reduce.py instead 2019-03-02 08:13:21 +01:00
Sebastian 1877476f61
donate-cpu.py: Add new argument `--max-packages=N`. (#1718)
The client script will exit after the specified number of packages
have been processed. 0 means infinitely.
Useful for example to regularly quit the script, check for updates to
the client and start it again. Or as an alternative to the `--stop-time`
argument.
2019-03-01 22:34:50 +01:00
orbitcowboy 2a8f42d0f4 donate-cpu.py: Also extract 'h++'-files. 2019-02-28 22:41:21 +01:00
versat e64fc279f0 donate-cpu-server.py: Format total times like the package times.
Without formatting it could happen sometimes that the time is printed
like this: 245.099999999, now only one digit after the decimal point
is shown.
2019-02-28 13:46:40 +01:00
Sebastian c10ddaef4a
donate-cpu-server.py: Replace syntax that is deprecated in Python 3. (#1712)
The function `iteritems()` of `dict`s is deprecated. The recommended
alternative is to use `items()`, this function also works with Python 2.

The next issue is that lambdas can no longer unpack tuple parameters
in Python 3. It would be possible to use some workaround and still use
a lambda, but using `operator.itemgetter(1)` instead is faster and the
recommended method in such a case.

The syntax is now compatible with Python 2 and 3 but the server script
still does not work with Python 3. For example `socket.recv()` returns
`bytes` in Python 3 and `str` in Python 2. Currently `str` is expected
so it does not work with Python 3.
2019-02-28 13:34:23 +01:00
Sebastian 4e90922e5b Donate CPU: Also use and accept .tar.bz2 package files. (#1707)
In my tests there were about 1500 additional packages
available as bz2 on the server.
For some packages a newer version is now used if it is
only available as .tar.bz2 archive.
The donate-cpu.py client is tested to work with .tar.bz2
files under Python 2.7.15 and 3.6.8.
2019-02-28 08:40:07 +01:00
Sebastian 8c32cfe853
donate-cpu.py: Fix crash during decoding under Python 3. (#1710)
Python 3 directly decodes the text when it is read(). If there is any
invalid UTF-8 character in the text an exception is thrown (IIRC it is
UnicodeDecodeError). Opening the file with `error='ignore'` avoids
throwing an exception and just ignores the invalid character. Since
this is only possible since Python version 3 there must be extra code
for older versions.
The test script has been enhanced. It now also uses a package which
contains a file with at least one invalid UTF-8 character.
2019-02-27 20:01:38 +01:00
Sebastian 117eed2255
donate-cpu.py: Also extract .qml files. (#1708)
.qml files are used when the Qt library is loaded.
2019-02-27 14:59:19 +01:00
versat bcd7830fcb donate-cpu.py: Detect and use googletest library 2019-02-23 18:47:19 +01:00
Sebastian 9379266a52
donate-cpu.py: Improve regex to find more includes. (#1688)
Now also found:
- Includes directly at the beginning of a file
- Indented includes
- Includes where there is no white-space between
  "include" and header name
2019-02-23 17:13:35 +01:00
orbitcowboy 52c7a1b1c2 donate-cpu.py: Auto detect TinyXML2 cfg. 2019-02-22 17:51:47 +01:00
Sebastian 70ea6bfb9b
libcerror.cfg: Add libcerror configuration file. (#1684)
The function libcerror_error_set() is currently the function for which
daca@home most often reports a missing configuration (more than 80000
times).
Official repository of libcerror: https://github.com/libyal/libcerror
The library configuration has been tested with the library libvhdi:
ftp://ftp.se.debian.org/debian/pool/main/libv/libvhdi/libvhdi_20181227.orig.tar.gz
2019-02-22 12:52:07 +01:00
Sebastian e27a44a0ea
donate-cpu.py: Improve header detection by using regex. (#1679)
This detects more includes / headers. For example includes like
"# include <gtk/gtk.h>" with a space before "include" as it is used in
the package http://cppcheck.osuosl.org:8000/gbatnav are now also
detected.
The regex search also searches all includes for one library in one go
instead of one include per loop.
Tested with several packages to make sure libraries that were detected
before are still detected.
2019-02-21 08:14:47 +01:00
versat eeedb44e92 donate-cpu.py: Fix regression: Also upload results if only crashes happened
If "head" and "OLD_VERSION" both crash there are no messages and the
variable `results_exist" is set to False. But still the results must be uploaded
for the crashes to be saved also.
Tested with the package http://cppcheck.osuosl.org:8000/double-conversion
2019-02-19 13:29:32 +01:00
rikardfalkeborn 1c1778e4df donate_cpu: Refactor library checks (#1675) 2019-02-19 11:50:39 +01:00
Sebastian 8a9f97b5c8
donate-cpu-server.py: Verify compared Cppcheck version (#1673)
Ignore normal results (not fast or info) where the diff was made against the wrong OLD_VERSION. This avoids unwanted results when some client still analyzes an old package but the OLD_VERSION in the server script is changed for example.
Results missing the Cppcheck version info completely are also ignored.
Tested locally with correct and wrong version numbers.
2019-02-18 10:13:18 +01:00