Wolfgang Stöggl [Tue, 5 Apr 2022 20:36:31 +0000 (22:36 +0200)]
Remove autogenerated files
The removed files are generated using bootstrap
(libtoolize, autoreconf) and they are available in release tarballs.
- Avoids outdated configure file in git
- Resolves #1163
- The following commands have been used for removal:
git rm configure
git rm -r conftools/
git rm Makefile.in
git rm *Makefile.in
git rm src/rrd_config.h.in
Wolfgang Stöggl [Fri, 1 Apr 2022 17:14:49 +0000 (19:14 +0200)]
Fix unsigned integer overflow in rrdtool first
This fixes a signed/unsigned conversion bug in the calculation of
"then". Background info:
pdp_cnt and pdp_step are both unsigned long, whereas timer is signed.
When multiplying signed and unsigned integers (same size), a signed is
implicitly typecast to unsigned.
- A similar fix has already been applied to rrd_dump.c
in commit e193975
- Resolves #1140
Wolfgang Stöggl [Fri, 25 Mar 2022 18:09:59 +0000 (19:09 +0100)]
Fix tests under MSYS2 (Windows)
This is a follow-up to commit 7cd748e considering running the tests
in Windows under MSYS2. A similar approach has already been used in
tests\graph2 and tests\xport1 (see also: 847d679)
- Updates the following tests:
graph1, rpn1, rpn2, vformatter1
- Avoid Windows drive letter in the path of DEF:vname=rrdfile
under MSYS or MSYS2. Use only the filename of the rrd and not
the full path if environmental variable MSYSTEM is set.
Wolfgang Stöggl [Thu, 24 Mar 2022 17:05:29 +0000 (18:05 +0100)]
ci-workflow.yml: Add autotools to msys2
- Add mingw-w64-x86_64-autotools to "install:"
Fixes:
./bootstrap: line 8: libtoolize: command not found
./bootstrap: line 11: autoreconf: command not found
- Minor modifications to ci-workflow.yml:
* Fix yamllint errors in line 8 and 10:
too many spaces inside brackets
* Add "workflow_dispatch:" to allow manual run of the Windows CI
workflow
Wolfgang Stöggl [Wed, 23 Mar 2022 16:58:45 +0000 (17:58 +0100)]
Fix BUILD_DATE in rrdtool help output
- This is a followup to #1102
- Fixes segfault when running "rrdtool --help"
- Change DATE_FMT to the same date format as the __DATE__ macro [1]:
mmm dd yyyy
Wolfgang Stöggl [Tue, 15 Mar 2022 17:13:35 +0000 (18:13 +0100)]
rrdtool-release: Create NUMVERS from VERSION file
In the script rrdtool-release, NUMVERS has been read from the
configure file so far, which may not be up-to-date.
Generate NUMVERS from the VERSION file instead. This ensures
that only one source is used vor the version - the VERSION file.
Use the same perl command for creating NUMVERS, as in configure.ac
This test was failing when LC_ALL was set to C.UTF-8 and using the C.UTF-8 locale which is part of glibc 2.35, which differs in a very minor way to that that has been used by Debian/Ubuntu for years. The tests sets LC_TIME to C, presumably to try to isolate itself from such things, but that does not have any effect if LC_ALL is set in the build environment.
Umer Saleem [Thu, 20 Jan 2022 14:29:36 +0000 (19:29 +0500)]
Fix for a race condition in journal_write
There is a race condition in journal_write() where journal_lock is
being acquired after checking whether journal_fh is NULL or not.
journal_fh is a static file handle that can be set to NULL by any
other thread, while current thread is blocked by
pthread_mutex_lock(). This commit fixes this race condition.
Dmitry Kalinkin [Thu, 21 Oct 2021 23:34:08 +0000 (19:34 -0400)]
Fix python bindings installation in case of empty DESTDIR
The current behaviour is to install the extension to ./usr/local (if
prefix is /usr/local), so it ends up in the temporary build directory
instead of the intended absolute prefix.
The slash after $(DESTDIR) is needed to make empty DESTDIR mean
installation to / instead of making the prefix to mean a relative
path. We make it triple slash as POSIX reserves double slashes to
possibly have a special treatment by the OS.
The change for travis is needed as "make install" is run as root, and
once the python extension is actually installed, it leaves a
root-owned .egg-info file.
Wolfgang Stöggl [Tue, 13 Jul 2021 18:23:54 +0000 (20:23 +0200)]
Add escapeJSON() to legend entries
Double quotes in legends are currently not escaped, if JSON imgformat
is used for rrdtool graph. This produces invalid JSON files.
See comment in #409 for further details.
Wolfgang Stöggl [Tue, 29 Jun 2021 19:16:53 +0000 (21:16 +0200)]
Update Windows GitHub Actions
- Update ci-workflow.yml and add GitHub Actions for Windows builds
using MSVC and vcpkg. Both, x64 and x86 builds are part of the CI.
The required vcpkg ports are installed and cached using
lukka/run-vcpkg@v7
- Add release-windows.yml, which enables building Windows binaries of
RRDtool. This GitHub action is run automatically upon new tags and
can be triggered manually. The required .exe and .dll files are
copied using collect_rrdtool_vcpkg_files.bat and deployed by
actions/upload-artifact@v2
- Makefile_vcpkg.msc:
Add include\harfbuzz, which is required for building pango. Fixes: pango-coverage.h(28): fatal error C1083:
Cannot open include file: 'hb.h': No such file or directory
Sven Panne [Mon, 22 Mar 2021 11:55:26 +0000 (12:55 +0100)]
Avoid segfault: Don't read and write into the same buffer.
Using CTX->rrd_error as a source *and* destination buffer at the same time
provokes undefined behavior. In real life you get funny error messages
and/or segfaults within vs(n)printf().
Simple solution: Use a temporary copy of the error message while writing
into it.
Wolfgang Stöggl [Sat, 13 Mar 2021 09:06:06 +0000 (10:06 +0100)]
Switch to pkgconf (MSYS2, MinGW-w64)
The MSYS2 project has switched from pkg-config to pkgconf as default.
For details, see: https://github.com/msys2/MSYS2-packages/pull/2197
Both packages work when building RRDtool for Windows using MSYS2.
- Switch to pkgconf instead of pkg-config
- Update the following files:
.github/workflows/ci-workflow.yml
win32/README-MinGW-w64
- This avoids the following warning in the Windows CI-build:
warning: removing 'mingw-w64-x86_64-pkg-config' from target list
because it conflicts with 'mingw-w64-x86_64-pkgconf'
Simon Arlott [Fri, 11 Dec 2020 18:38:42 +0000 (18:38 +0000)]
Use a separate pango fontmap per thread
Reusing the same fontmap from multiple threads is not safe, despite
the attempts to use a mutex to protect it there are other instances
where it behaves unexpectedly if graphs are created from multiple
threads at the same time, e.g.:
(process:76234): Pango-WARNING **: 11:47:25.823: failed to create cairo scaled font, expect ugly output. the offending font is 'DejaVu Sans Mono 8'
(process:76234): Pango-WARNING **: 11:47:25.823: font_face status is: no error has occurred
(process:76234): Pango-WARNING **: 11:47:25.823: scaled_font status is: invalid matrix (not invertible)
(process:76234): Pango-WARNING **: 11:47:25.823: shaping failure, expect ugly output. shape-engine='PangoFcShapeEngine', font='DejaVu Sans Mono 8', text='Apparent temp (?C)'
This error results in boxes instead of characters on the graph. In the
worst case scenario there are memory management errors that cause GLib
to complain or the process to abort.
Calling pango_cairo_font_map_get_default() multiple times from the same
thread will return the same object, so this satisfies the performance
expectations of reusing it within a single thread. Trying to lock a
mutex for even more pango/cairo function calls is likely to decrease
performance when multiple threads are used concurrently.
Wolfgang Stöggl [Sun, 9 Aug 2020 19:20:02 +0000 (21:20 +0200)]
Add -no-undefined automatically for MinGW-w64
The linker flag -no-undefined is required, when building the dll for
Windows using MinGW-w64. Add -no-undefined to librrd_la_LDFLAGS in
Makefile.am in case of MinGW-w64 builds. This way it is not necessary
anymore to add LDFLAGS=-no-undefined to the make command.
Allow to generate a graph as if the current timezone was UTC (e.g set TZ=UTC).
This allows to easily calculate daily average ranging from midgnight to midnight rather than say the last 24 hours.