libqb/ChangeLog
2025-10-04 20:23:54 +02:00

7366 lines
272 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

2025-09-16 Fabio M. Di Nitto <fdinitto@redhat.com>
ipc: fix clang build on openindiana
2025-07-31 Chrissie Caulfield <ccaulfie@redhat.com>
Solaris port (#504)
and a few misc bug fixes
Skiplist casts from OpenIndiana project (#503)
2025-06-25 Chrissie Caulfield <ccaulfie@redhat.com>
Check returns from setsockopt() calls (#498)
Also, fix doxygen comment for qb_util_timespec_from_epoch_get()
2024-08-28 Stanisław Pitucha <git@viraptor.info>
Add fdatasync declaration on darwin (#496)
2024-05-18 wferi <wferi@debian.org>
doxygen2man: Fix typos and inconsistencies in help text (#497)
2024-01-31 Ken Gaillot <kgaillot@redhat.com>
Make some logs less noisy (#495)
* log: lower IPC connection issues to info level
... in handle_new_connection(). The caller has better context for whether a
problem merits a warning or error, and the function's return code is
sufficiently descriptive to do so. Some problems may be expected or able to be
worked around.
For example, Pacemaker's crm_mon attempts to contact pacemakerd IPC. On a
Pacemaker Remote node, that IPC will be unavailable, and crm_mon can check the
libqb return code to detect and handle that situation gracefully.
* log: lower some ringbuffer debug messages to trace level
They're rather noisy, with every shm-based IPC connection generating multiple
obscure messages like:
debug: shm size:1048589; real_size:1052672; rb->word_size:263168
and every disconnect generating the rather unhelpful:
debug: qb_ipcc_disconnect()
along with multiple messages like:
debug: Closing ringbuffer: /dev/shm/qb-10986-11014-34-26VRvs/qb-request-cmap-header
All of these seem appropriate to trace level.
2023-11-20 Chrissie Caulfield <ccaulfie@redhat.com>
doxygen2man: Include libxml/parser.h (#494)
This seems to be needed for newer versions of libxml
but shouldn't break older ones (CI to confirm!)
2023-11-15 Chrissie Caulfield <ccaulfie@redhat.com>
tests: Fix shebang on ipc_sock_test (#493)
Change assert in ringbuffer to a return code (#492)
Why just this one?
There are LOADS of asserts in libqb, some are OK and some may be
overkill. This one in particular is causing CI failures
and so annoys me more than the rest.
2023-07-21 Christine Caulfield <ccaulfie@redhat.com>
Update library version for 2.0.8
2023-07-20 Chrissie Caulfield <ccaulfie@redhat.com>
log: fix potential overflow with long log messages (#490)
qb_vsnprintf_serialize was called with 'max_size' as the
limiting number for the length of the formatted log
message. But the buffer also needs to contain the
log header (given by 'actual_size'), so we now pass
't->max_line_length' as the maximum length of the
formatted log message to limit space to the actual
bytes left
Also added error checks to the blackbox calls at
the end of the test, as these now provide a proper
test that the BB is functioning. Before they were
masking failures.
2023-06-10 Chrissie Caulfield <ccaulfie@redhat.com>
test - fix test dependancies (#489)
Fix a ridiculous thinko in the test deps for -j
2023-06-07 Christine Caulfield <ccaulfie@redhat.com>
Update -version info for 2.0.7
2023-06-07 Jan Friesse <jfriesse@redhat.com>
spec: Migrate to SPDX license (#487)
Both Fedora and openSUSE now recommends to use SPDX shortname format
for License.
2023-06-05 Chrissie Caulfield <ccaulfie@redhat.com>
blackbox: fix potential overlow/memory corruption (#486)
if the message was too long, then msg_len was added to the
buffer size twice, thus causing potential data corruption
(seen VERY rarely in the CI test - or, at least, I think it was
this).
Also fix a double close() spotted by gcc13's -fanalyzer
2023-05-26 Chrissie Caulfield <ccaulfie@redhat.com>
tests: allow -j to work (#485)
build: fix several issues with building tests
- MAINTAINERCLEANFILES should not rely on conditionals
that could or could not clean files.
- EXTRA_DIST should not rely on conditonals that could
or could not add files to the final tarball.
sources should always ship.
- CLEANFILES should not rely on conditionals as
./configure can be done in between builds leaving
stray files around.
- (cosmetic) move distclean-local: target with clean-local.
- drop old ipc_sock.test, start.test and resources.test
shell files.
- fix make distcheck -j:
- stop shipping or not shipping libstat_wrapper.so.
libtool will only generate the .so when installing
a shared library (--enable-install-tests).
- make libstat_wrapper a module in a similar fashion
of _failure_injection.
- build ipc_sock.test in a similar fashion as ipc.test
and link as module _libstat_wrapper.la.
this solves multiple issues of having the binary
in the final test builddir, no need to detect if
libstat_wrapper.so is installed or not and workaround
libtool different linking methods for inst vs noinst
libraries.
- fix ipc.test linking with GLIB that should not be
dependent on HAVE_FAILURE_INJECTION.
Run tests in parallel with dependancies
Make sure the two IPC tests use different socket names
Shortedn some names so they fit with the new ipc-names
remove ipc-test-name-sock
Fix resources.test now that ipc_sock is being run properly
2023-03-23 Chrissie Caulfield <ccaulfie@redhat.com>
test: Remove gnu/lib-names.h from libstat_wrapper.c (#482)
It doesn't appear to be needed!
2023-03-23 wferi <wferi@debian.org>
strlcpy: avoid compiler warning from strncpy (#473)
Otherwise GCC complains about __builtin_strncpy specified bound
depends on the length of the source argument.
2023-03-23 Fabrice Fontaine <fontaine.fabrice@gmail.com>
Add --disable-tests option (#475)
Add --disable-tests to allow the user to disable tests. As a
side-effect, this will avoid the following build failure when check is
found:
libstat_wrapper.c:11:10: fatal error: gnu/lib-names.h: No such file or directory
11 | #include <gnu/lib-names.h>
| ^~~~~~~~~~~~~~~~~
This build failure is raised since version 2.0.5 and
https://github.com/ClusterLabs/libqb/commit/78df90b180740712d0c90b6d982b78241cc99d72
Fixes:
- http://autobuild.buildroot.org/results/450cfc36d4fd6dc71c138bec45f05b5a2d92a08d
2023-03-23 wferi <wferi@debian.org>
m4/ax_pthread.m4: update to latest upstream version (serial 31) (#472)
To avoid the warning: $as_echo is obsolete message.
2023-01-06 Chrissie Caulfield <ccaulfie@redhat.com>
tests: Close race condition in check_loop (#480)
Start the "check_time_left" timer before the "stop_job" timer so
that we can be sure that it exists when "check_time_left" is run.
2023-01-05 Chrissie Caulfield <ccaulfie@redhat.com>
timer: Move state check to before time check (#479)
A timer in QB_POLL_ENTRY_JOBLIST doesn't necessarily
have a t->timerlist_handle so that deref can segv. Also
the comment assumes the timers are threaded - which as we have
decided is definitely not true. So it's safe to move the check
earlier.
In the tests, I've adjusted the timeouts so that they definitely
happen at different times. On some architectures they can fire
concurrently and in the wrong order.
2022-11-25 Chrissie Caulfield <ccaulfie@redhat.com>
ipc: Retry receiving credentials if the the message is short (#476)
ipc: Retry receiving credentials if the the message is short
rhbz#2111711 refers
2022-10-31 growdu <1819770177@qq.com>
add simplified chinese readme (#474)
2022-08-17 Chrissie Caulfield <ccaulfie@redhat.com>
lib: Fix some small bugs spotted by newest covscan (#471)
* lib: Fix some small bugs spotted by newest covscan
2022-07-27 Jan Friesse <jfriesse@redhat.com>
configure: Modernize configure.ac a bit (#470)
... to make 2.71 happy. Also increase minimum version to 2.69 (10 years
old version so should be compatible enough).
2022-07-07 Chrissie Caulfield <ccaulfie@redhat.com>
tests: Fix tests on FreeBSD-devel (#469)
FreeBSD-devel can allocate more space than requested which causes
the check to fail. So check for >= allocated rather than ==
2022-06-16 Chrissie Caulfield <ccaulfie@redhat.com>
doxygen2man: Fix function parameter alignment (#468)
Also, prevent truncation of parameter descriptions in the
body of the man page due to strtok() usage.
tests: cleanup the last of the empty directories (#467)
This should, FINALLY, allow the libqb tests to run
and properly cleanup up after themselves.
2022-06-08 Chrissie Caulfield <ccaulfie@redhat.com>
tests: Make ipc test more portable (#466)
fix a couple of errors reported by covscan
1. /usr/lib64/libqb/tests/resources.test:8:34: warning[SC2039]: In POSIX sh, UID is undefined.
1. /usr/lib64/libqb/tests/resources.test:8:30: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
1. /usr/lib64/libqb/tests/ipc_sock.test:10:34: warning[SC2039]: In POSIX sh, UID is undefined.
1. /usr/lib64/libqb/tests/ipc_sock.test:10:30: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
2022-03-23 Chrissie Caulfield <ccaulfie@redhat.com>
test: Include ipc_sock.test in the libqb-tests rpm (#463)
...but don't run it unless we are root
2022-03-21 Christine Caulfield <ccaulfie@redhat.com>
Bump version for 2.0.5 release
2022-03-21 Chrissie Caulfield <ccaulfie@redhat.com>
tests: Run IPC with use-filesystem-sockets active (#455)
* tests: Run IPC with use-filesystem-sockets active
Provide an LD_PRELOAD library that simulates the presence
of /etc/libqb/use-filesystem-sockets so that we can test
that functionality without actually having the file on
the system and affecting everything else running on the
box.
* use $() rather than ``
* Cope with spaces in directory names
* Docs: quote DOXYGEN2MAN in Makefile.am rather than configure.ac
2022-03-18 Chrissie Caulfield <ccaulfie@redhat.com>
blackbox: Sanitize items read from the blackbox header (#438)
covscan complained we don't check the blackbox header when
reading it in. (quite reasonably)
Note that we still get a covscan error for ->shared_data, but that's
really impossible to verify in the read routine, so I'll leave the
covscan waiver to handle that.
test: Clean /dev/shm a bit better (#459)
* test: Clean /dev/shm a bit better
This isn't perfect, but it does tidy more of /dev/shm than
previously. Because some of the tests leave empty directories
we have no way of telling (in resources.test) whether they
belong to this test run, another test run, or a running
application.
2022-03-17 Chrissie Caulfield <ccaulfie@redhat.com>
unix: Don't fail on FreeBSD running ZFS (#461)
* unix: Don't fail on FreeBSD running ZFS
ZFS doesn't support posix_fallocate() so libqb IPC or RB would
always fail with EINVAL.
As there seems to be no prospect of a more useful return code,
trap it in a QB_BSD #ifdef. That way if we do have actual errors
in the posix_fallocate() call the Linux tests should still find them.
Also, stick a small sleep in the test_ipc_disconnect_after_created
test to allow the server to shutdown before killing it with SIGTERM
and causing a test failure. all the other uses of it seem to have this
sleep!
2022-03-03 Christine Caulfield <ccaulfie@redhat.com>
ipcc: Fix errno returned from qb_ipcc_connect
The errno value from qb_ipcc_connect was incorrectly negated
when I introduced qb_ipcc_async_connect()
2022-02-14 Ken Gaillot <kgaillot@redhat.com>
util: reimplement time functions as a series of fallbacks
Previously, when clock_gettime() was available, the time functions would use
that (regardless of success or failure), otherwise they would use
gettimeofday() if available.
Now, the functions first try clock_gettime() if available, but if that is
unavailable or fails, they then try gettimeofday() if available, but if that is
not available or fails, they try time().
util: use HAVE_GETTIMEOFDAY where appropriate
configure.ac already defined HAVE_GETTIMEOFDAY, but the uses of gettimeofday()
weren't guarded by it. It obviously doesn't matter on any currently supported
platforms, but it will be needed for planned changes.
util: drop HAVE_CLOCK_GETRES_MONOTONIC configure constant
It doesn't provide a significant benefit over just trying the call.
It was added by 6bd3f086 for Hurd support.
util: add constant for which realtime clock to use
... to reduce code duplication and improve readability
util: refactor so ifdef's are withing each time-related function
The time-related functions have two implementations, one if clock_gettime() is
available and the other if not.
Previously, there was one big ifdef-else with the clock_gettime()
implementation of each function followed by the other implementation of each
function.
With this commit, each function is defined once, with an ifdef-else inside it
with the two implementations of that function. For ease of review, no other
code changes are made, but the intent will become obvious with later changes.
2022-02-02 Chrissie Caulfield <ccaulfie@redhat.com>
Bring the INSTALL guide up-to-date (#456)
2022-01-19 Chrissie Caulfield <ccaulfie@redhat.com>
Tidy some scripts (#454)
* Tidy some scripts
Errors reported by Centos covscan
I changed %N to %s as BSD's date command doesn't support %N.
Seconds + PID should be enough ....
* Shrink the name of the dlock tests as they cause random failures
When the PID numbers get big, the socket name overflows the allowed
limit
* Increase timeout of thread check.
It's been seen to time out too early and fail the tests
2022-01-14 Jakub Jankowski <shasta@toxcorp.com>
Retry if posix_fallocate is interrupted with EINTR (#453)
Every now and then Pacemaker reports errors:
(pcmk__new_client) debug: New IPC client 3efdbecf-c2d9-44bc-b4a6-9bcd48021ba1 for PID 27492 with uid 0 and gid 0
(handle_new_connection) debug: IPC credentials authenticated (/dev/shm/qb-7271-27492-12-hfPbKY/qb)
(qb_ipcs_shm_connect) debug: connecting to client [27492]
(qb_rb_open_2) debug: shm size:524301; real_size:528384; rb->word_size:132096
(qb_rb_open_2) debug: shm size:524301; real_size:528384; rb->word_size:132096
(qb_sys_mmap_file_open) error: couldn't allocate file /dev/shm/qb-7271-27492-12-hfPbKY/qb-event-cib_rw-data: Interrupted system call (4)
(qb_rb_open_2) error: couldn't create file for mmap
(qb_ipcs_shm_rb_open) error: qb_rb_open:/dev/shm/qb-7271-27492-12-hfPbKY/qb-event-cib_rw: Interrupted system call (4)
(qb_rb_close_helper) debug: Free'ing ringbuffer: /dev/shm/qb-7271-27492-12-hfPbKY/qb-response-cib_rw-header
(qb_rb_close_helper) debug: Free'ing ringbuffer: /dev/shm/qb-7271-27492-12-hfPbKY/qb-request-cib_rw-header
(qb_ipcs_shm_connect) error: shm connection FAILED: Interrupted system call (4)
(handle_new_connection) error: Error in connection setup (/dev/shm/qb-7271-27492-12-hfPbKY/qb): Interrupted system call (4)
While it probably might be addressed in Pacemaker code, a simple retry
loop in case posix_fallocate(3) returns EINTR seems to be a decent
workaround.
Fixes: #451
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2022-01-05 Chrissie Caulfield <ccaulfie@redhat.com>
ipcc: Add an async connect API (#450)
2021-11-12 Christine Caulfield <ccaulfie@redhat.com>
Bump library version for v2.0.4
2021-11-10 Chrissie Caulfield <ccaulfie@redhat.com>
poll: Don't log in a signal handler (#447)
qb_log calls malloc() and probably many other non-signal-safe
functions, so don't call it in the signal handler.
Thanks to Honza for spotting this
2021-08-11 Chrissie Caulfield <ccaulfie@redhat.com>
Fix pthread returns (#444)
pthread calls do not set errno, they return the error directly
2021-07-01 Chrissie Caulfield <ccaulfie@redhat.com>
doxygen2man: print structure descriptions (#443)
* doxygen2man: print structure descriptions
* get rid of double-cast as it doesn't seem to do anything
2021-03-18 Jan Friesse <jfriesse@gmail.com>
Implement heap based timer list (#439)
* tlist: Add heap based implementation of timer list
Previous timer was sorted list implementation of priority queue
and very slow when number of timers increased. This is mostly
not a problem because usually only few timers are used.
But for application where bigger number of timers are needed
it may become problem.
Solution is to use binary heap based priority queue which is much
faster.
API is unchanged, just timerlist_destroy is added which should be called
to free heap array. This function also destroys mutex (omitted when
mutex was added).
* tests: Fix check loop mt test
test_th was accesed both by main thread and loop_timer thread resulting in
failure. Fix is to access test_tht in loop_timer thread.
Speed test is adding only 10000 items so it is reasonable
fast even with sorted linked list implementation.
2021-03-17 orbea <orbea@riseup.net>
build: Fix undefined pthread reference. (#440)
2021-03-03 Christine Caulfield <ccaulfie@redhat.com>
release: bump library version for 2.0.3 release
2021-03-01 Aleksei Burlakov <alex_burlakov@gmx.de>
root <Aleksei Burlakov>
syslog: Add a message-id parameter for messages (#433)
The message-id parameter will enable systemd catalogs.
To enable message-id's the libqb should be configured with the
--enable-systemd-journal option.
2021-02-08 Chrissie Caulfield <ccaulfie@redhat.com>
tests: Fix up resources.test (#435)
resources.test has not checked the right filenames for a while.
Fix this, and also make sure we don't count (but remove) the dlock
test files.
timers: Add some locking (#436)
Fix several locking issues reported by helgrind
2021-01-25 Chrissie Caulfield <ccaulfie@redhat.com>
ipcc: Have a few goes at tidying up after a dead server (#434)
This is an attempt to make sure that /dev/shm is cleaned up when a
server exits unexpectedly. Normally it's the server's responsibility
to tidy up sockets, but if it crashes or is killed with SIGKILL then
the client (us) makes a reasonable attempt to tidy up the server sockets
we have connected. The extra delay here just gives the server chance to
disappear fully. As a client we can get here pretty quickly but shutting
down a large server may take a little longer even when SIGKILLed.
The 1/100th of a second is an arbitrary delay (of course) but seems to
catch most servers in 2 tries or less.
2021-01-13 Chrissie Caulfield <ccaulfie@redhat.com>
strlcpy: Check for maxlen underflow (#432)
* strlcpy: Check for maxlen underflow
https://github.com/ClusterLabs/libqb/issues/429
* Always terminate the string if maxlen is > 0
2021-01-07 Chrissie Caulfield <ccaulfie@redhat.com>
doxygen2man: fix printing of lines starting with '.' (#431)
if a line starts with a '.' (eg the '...' in qbarray.h) then
nroff thinks it's looking for a macro called '..'.
The easiest solution is to add a dummy format at the start of the line
(just adding \ seems not to work).
2021-01-04 wferi <wferi@debian.org>
doxygen2man: ignore all-whitespace brief descriptions (#430)
2020-12-03 Christine Caulfield <ccaulfie@redhat.com>
lib: Update library version for 2.0.2 release
2020-12-03 Hideo Yamauchi <renayama19661014@ybb.ne.jp>
ipcs : Decrease log level. (#426)
of ipcs event notification 'errors' that can occur in normal use.
2020-12-03 Chrissie Caulfield <ccaulfie@redhat.com>
cov: Quieten some covscan warnings (#427)
2020-10-22 Chrissie Caulfield <ccaulfie@redhat.com>
doxygen2man: Fix a couple of covscan-detected errors (#425)
doxygen2man: Fix a couple of covscan-detected errors
also check for strings longer than 4096
2020-10-05 Chrissie Caulfield <ccaulfie@redhat.com>
ipcs: ftruncate is not support on WIN32 (#424)
https://github.com/microsoft/WSL/issues/902
ipcs: Add missing qb_list_del when freeing server (#423)
* ipcs: Remove list not used
Thanks to minhbq for pointing this out
2020-09-28 Chrissie Caulfield <ccaulfie@redhat.com>
ipc: add qb_ipcc_auth_get() API call (#418)
* ipc: addd qb_ipcc_auth_get() API call
We can't use SO_PEERCRED on the client fd when using socket IPC
becayse it's a DGRAM socket (pacemaker tries this). So provide
an API to get the server credentials that libqb has already
squirreled away for its own purposes.
Also, fix some unused-variable compiler warnings in unix.c
when building on systems without posix_fallocate().
2020-09-25 wferi <wferi@debian.org>
doc related fixups (#421)
* Fix documentation typo in qbrb.h
* Fix section number in doxygen2man manual
* Point Doxygen to our examples
* No HTML documentation anymore
2020-09-25 Chrissie Caulfield <ccaulfie@redhat.com>
doxygen2man: Remove horrible hack (#420)
It caused \f macros to get truncated and doesn't actually affect
the groffed output anyway
2020-09-24 Chrissie Caulfield <ccaulfie@redhat.com>
doxygen2man: Add support for @code blocks (#417)
* doxygen2man: Add support for @code blocks
Thanks Fabio for the review
2020-09-16 Chrissie Caulfield <ccaulfie@redhat.com>
man: Tidy man pages (#416)
Fix doxygen2man to add a RETURN section even if the file has
no @return stanza.
Add support for @c tags
Quote the % signs in qb_log_format_add manpage
2020-09-09 Chrissie Caulfield <ccaulfie@redhat.com>
doxygen2man: Add option to read copyright line from the header file (#415)
* doxygen2man: Add option to read copyright line from the header file
This should help make builds reproducible.
I tried various methods of getting the date, using 'git' is no use as
it could be run from a tarball, using the file date doesn't work either
so this seems a reasonable compromise.
* man: Use SOURCE_EPOCH to make manpage dates reproducible
Also add build-aux/update-copyright.sh to keep header file
copyright lines up-to-date.
All code taken from knet
2020-07-29 Chrissie Caulfield <ccaulfie@redhat.com>
tests: Remove deprecated check macros (#412)
fail_if() and fail_unless() macros are deprecated in more
recent versions of check and are buggy in 0.15, so replace
them with ck_assert() instead.
2020-07-29 Christine Caulfield <ccaulfie@redhat.com>
Bump version for 2.0.1
2020-07-29 wladmis <vseleznv@altlinux.org>
Ivan Zakharyaschev <imz@altlinux.org>
unix.c: use posix_fallocate() (#409)
Using of posix_fallocate() guarantees that, if it succeed, the
attempting to write to allocated space range does not fail because of
lack of storage space. This prevents SIGBUS when trying to write to
mmaped file and no space left.
Co-Authored-by: Ivan Zakharyaschev <imz@altlinux.org>
Reported-by: Mikhail Kulagin <m.kulagin at postgrespro dot ru>
2020-07-15 Fabio M. Di Nitto <fdinitto@redhat.com>
[doxy] fix build when more aggressive -W options are used (#410)
make[2]: Entering directory '/builddir/build/BUILD/kronosnet-1.17/man'
gcc -DHAVE_CONFIG_H -I. -I.. -O3 -ggdb3 -Werror -Wall -Wextra -Wno-unused-parameter -pthread -I/usr/include/libxml2 -c -o doxyxml-doxyxml.o `test -f 'doxyxml.c' || echo './'`doxyxml.c
doxyxml.c: In function 'allcaps':
doxyxml.c:414:13: error: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Werror=sign-compare]
414 | for (i=0; i< strlen(name); i++) {
| ^
cc1: all warnings being treated as errors
make[2]: *** [Makefile:623: doxyxml-doxyxml.o] Error 1
make[2]: Leaving directory '/builddir/build/BUILD/kronosnet-1.17/man'
make[1]: *** [Makefile:567: all-recursive] Error 1
2020-07-02 Christine Caulfield <ccaulfie@redhat.com>
doxygen2man: Tidy RETURN VALUE
2020-07-02 Chrissie Caulfield <ccaulfie@redhat.com>
doxygen2man - Print structure descriptions (where available) (#408)
Tidy 'description' fields (get rid of superfluous newlines)
and fix a couple of crashes
2020-06-29 Fabio M. Di Nitto <fdinitto@redhat.com>
[docs] fix man page distribution (#407)
2020-06-26 Chrissie Caulfield <ccaulfie@redhat.com>
Fabio M. Di Nitto <fdinitto@redhat.com>
Make manpages (#405)
* man: Use doxygen2man to make the API manpages
* [build] drop unused target
* [build] update gitignore
* [docs] make build -j safe and drop unnecessary dox config files
* man: Use doxygen2man to generate *.h.3 man pages
so we don't need to use the awful doxygen ones
2020-06-26 Chrissie Caulfield <ccaulfie@redhat.com>
CI: Remove .travis.yml (#406)
Travis is too old to be any use. It's just ceating work for no good
reason
2020-06-22 Chrissie Caulfield <ccaulfie@redhat.com>
doxygen2man: Fix a couple of the worst coverity errors (#404)
doxygen2man - Lots of new features & fixes for parsing libqb manpages (#402)
doxygen2man: Lots of fixes and features
a) Make it quieter in normal operation
b) add options for hard coded things (like company name)
c) handle typedef members of structures
d) tidy function pointers in structs
e) get header file name from the XML or commandline
d) Add support for @ref tags in description
e) add support for @note annotations
f) Don't print (null) if there is no @brief description
g) Add include prefix option
h) use strncat rather than strcat
2020-06-08 Chrissie Caulfield <ccaulfie@redhat.com>
array: More locking fixes (#400)
* array: More locking fixes
helgrind threw out a couple more locking errors in the logging/array
code and we also need to protect a->max_elements
2020-06-03 Chrissie Caulfield <ccaulfie@redhat.com>
test: Add unit test for ipcs_connection_auth_set() (#397)
Only if we are root
2020-06-01 Chrissie Caulfield <ccaulfie@redhat.com>
log: Fix threading races (#396)
It's possible that cs->filename or cs->format could be read
in the 'fast' path while the 'slow' path is still constructing
the object. So we need to lock arr_next_lock before copying them
out for the caller.
Also wthread_should_exit was unprotected.
2020-05-28 Chrissie Caulfield <ccaulfie@redhat.com>
Some bugs spotted by coverity (#399)
2020-05-04 Jan Pokorný <jpokorny@redhat.com>
log: journal: fix forgotten syslog reload when flipped from journal
2020-05-01 Ferenc Wágner <wferi@debian.org>
Let remote_tempdir() assume a NUL-terminated name
This is the case already. We also fix a buffer overflow opportunity in
the memcpy() call by this change.
Conflicts:
lib/ipc_shm.c
Make it impossible to truncate or overflow the connection description
It's hard to predict the length of formatted output, so we'd better
notice (and abort) if the description is truncated. Incidentally,
mkdtemp() does this for us in the shared memory branch, but do an
explicit check there as well for consistency, and get rid of the wrongly
parametrized strncat() risking a buffer overflow (CONNECTION_DESCRIPTION
is not the length of the source "/qb").
Similar truncation checks should be added to qb_ipcs_{shm,us}_connect()
where they build the request/response names, and possibly to other
places using snprintf().
2020-04-29 Chris Murphy <cmurphycode@gmail.com>
master: Issue 390: Clarify documentation of qb_loop_timer_expire_time_get and provide new function to return previously documented behavior (#391)
Includes unit test addition by chrissie-c
2020-03-18 Fabio M. Di Nitto <fdinitto@redhat.com>
Christine Caulfield <ccaulfie@redhat.com>
Doxygen2man (#388)
* doxygen2man: Add utility to generate man pages from doxygen
This is in here from kronosnet so it cna be used by other parts
of the cluster stack.
* [man] drop trailing white spaces
* [build] cleanup variable names
* [build] add conditionals to use internal or external doxygen2man
* Update .gitignore
2020-03-09 Chrissie Caulfield <ccaulfie@redhat.com>
trie: Don't assume that chars are unsigned < 126 (#386)
* trie: Don't assume that chars are unsigned < 126
Trie fails on systems with unsigned chars when using characters over
126.
2020-02-26 Jan Friesse <jfriesse@redhat.com>
qblist: Retype ptr in qb_list_entry to char* (#385)
This allows pointer arithmetics without issuing warning.
2020-02-21 Chrissie Caulfield <ccaulfie@redhat.com>
list: #include <stddef.h> in qblist.h (#384)
Some platforms require it.
2020-02-20 Chrissie Caulfield <ccaulfie@redhat.com>
list: fix list handling for gcc10 (#383)
-Wpointer-arith has been removed from warnings as with GCC10 that warns every time qb_list_entry is used, which is just noise.
2020-02-10 Jonas Witschel <diabonas@gmx.de>
Set correct ownership if qb_ipcs_connection_auth_set() has been used
When qb_ipcs_connection_auth_set() has been used, the ownership of the
temp directory initially set by handle_new_connection() must be updated
as well.
2020-02-10 Ferenc Wágner <wferi@debian.org>
Allow group access to the IPC directory
And don't abort if we aren't permitted to chown() it. The client might
still have the privileges to enter it.
Errors are represented as negative values
2020-01-10 Jan Pokorný <jpokorny@redhat.com>
build: allow for possible v1 branch continuity by generous SONAME offset
The main and the most ABI-touching thing for the envisioned 2.0 branch
is the usage of the linker-build-time allocated callsite info, avoiding
the non-economic evaluations and, under some circumstances dangerous,
heap allocations in the run-time.
Considering that v1.9.0 release (libqb.so.20) was expressly marked as
tech-preview[1,2] (hence something that shall not make it to production
use), there should be no harm for master branch (that is headed towards
2.0 and beyond) to receive noticable SONAME bump (libqb.so.100) so as to
- leave enough of space for a possible v1-compatible branch evolution
(for use cases where recompile-everything is a no-go).
in particular, with resuming with libqb.so.30, there would
be a room for 99-33 = 63 add-new-drop-nothing compatible
changes for that branch (which is more than plentiful)
- indicate some big change is going on more clearly towards client space
This is supposed to be a reasonable trade-off solution that would still
leave enough wiggle space, and would represent responsible approach to the
development (like the original attempt to prevent ABI break in the first
place was), allowing for more than an enforced unanimity (rather
antagonistic in the free software realms).
[1] https://lists.clusterlabs.org/pipermail/users/2019-December/026690.html
[2] https://github.com/ClusterLabs/libqb/releases/tag/1.9.0
2020-01-07 Jan Pokorný <jpokorny@redhat.com>
build: bump version for inter-release "plain repo" generated tarballs
2020-01-07 Fabio M. Di Nitto <fdinitto@redhat.com>
[build] chown the right file
Closes: #377
Also, for original issue, closes: #375
Reviewed-by: Jan Pokorný <jpokorny@redhat.com>
2020-01-06 Fabio M. Di Nitto <fdinitto@redhat.com>
[build] fix configure.ac in release tarball
only mingle with configure.ac if configure.ac-t exists
2019-12-11 Chrissie Caulfield <ccaulfie@redhat.com>
make: Remove splint tests (#374)
Now that splint is actually contradicting errors that come from
the compilers I think it's time to retire it. I could cope with it
being a minor nuisance on the argument that "another check can't
hurt", but contradicting the actual compilers is too much.
The CI has Coverity installed which is much more up-to-date anyway.
Splint hasn't been updated since 2010
2019-12-11 Christine Caulfield <ccaulfie@redhat.com>
lib: Fix some minor warnings from newer compilers
and doxygen
2019-12-06 Chrissie Caulfield <ccaulfie@redhat.com>
tests: Shorted deadlock test names (#372)
On newer Fedora systems that can have 32 bit PIDs, these long test
names can get truncated in the libqb internal buffers and thus break the
tests, so I've shortened the names.
2019-11-08 Jan Friesse <jfriesse@redhat.com>
ipc: Always initialize response struct
Response structure was not initialized completely,
when mkdtemp/chown failed, server was not accepting connection yet or
connect failed for some reason.
This is not an issue, but valgrind reports this
as a problem so it is easy to miss real problem then.
Solution is to initialize response before it is used.
2019-10-09 Fabio M. Di Nitto <fdinitto@redhat.com>
[build] add --with-sanitizers= option for sanitizer builds (#366)
this option is stricly meant for runtime debugging purposes.
do NOT use in production.
check gcc/clang man pages on how to use ASAN/UBSAN/TSAN.
Also allow to users to specificy SANITIZERS_CFLAGS and SANITIZERS_LDFLAGS
for advanced use.
2019-07-26 Jan Pokorný <jpokorny@redhat.com>
ringbuffer: fix mistaken errno handling around _rb_chunk_reclaim
Previously, there were two separate logical issues:
- errno could be set negative in qb_rb_chunk_alloc when
when "reclaim" notifier failed
- _rb_chunk_reclaim (note: local scoped, hence comfortable for changes)
was already setting errno at a single (coincidentally, in a correct
way, but that'd be overwritten with the inverse because of the
previous logical issue in qb_rb_chunk_alloc), so make it set errno
at each failure path (now also when internal integrity in
_rb_chunk_reclaim failed(), sparing the callers to double on that task
2019-07-26 Ken Gaillot <kgaillot@redhat.com>
array,log: Never set errno to a negative value
These are clearly a logical mistake due to the standard practice of returning
-errno on error, but errno itself should never be negative.
log: Set errno when qb_log_target_alloc() fails
The callers of qb_log_target_alloc() return -errno when it fails.
However, qb_log_target_alloc() wasn't setting errno.
The only failure case is when QB_TARGET_LOG_MAX (32) logs have been opened, so
it's unlikely to ever be a real-world problem. But in that case, now set errno
to EMFILE ("Too many open files").
2019-06-27 Christine Caulfield <ccaulfie@redhat.com>
ipc: Remove kqueue EOF log message
It's not logged for epoll systems and just clutters up logs
and slows things down without telling us anything useful.
tests: Speed up IPC tests, especially on FreeBSD
After much discussion on IRC it was decided that 70000 iterations
of the stress patch didn't achieve anything significant over a
reasonable but smaller number. So it has been reduced to 5000 on
all platforms.
This patch also fixes a bug where test_ipc_disconnect_after_created
committed a use-after-free which could cause a crash on FreeBSD-devel.
2019-06-24 Christine Caulfield <ccaulfie@redhat.com>
ipc: fix force-filesystem-sockets
the /etc/libqb/force-filesystem-sockets option got broken for some
applications in the last security update.
2019-06-20 Jan Friesse <jfriesse@redhat.com>
ipc: Fix named socket unlink on FreeBSD
Terminating NUL on FreeBSD is not part of the sun_path.
Add it to use sun_path as a parameter of unlink.
2019-06-12 Jan Pokorný <jpokorny@redhat.com>
tests: ipc: fix the no-GLib conditionalizing
In particular, qb_ipcs_rate_limit() needs to be outside the
"#ifdef HAVE_GLIB" conditional, since it gets used regardless.
This should have been like this as of 28e7259.
2019-06-07 Jan Pokorný <jpokorny@redhat.com>
CI: travis: add (redundant for now, but...) libglib2.0-dev prerequisite
We want to run every and each test we can, without reliance on
transitive deoendencies and environment "invariants".
doc: qbloop.h: document pros/cons of using built-in event loop impl
Make the qbipcs.h module interdependence clear (also shedding light to
some semantic dependencies) as well.
2019-06-05 Jan Pokorný <jpokorny@redhat.com>
IPC: server: fix debug message wrt. what actually went wrong
It's misleading towards a random code observer, at least,
hiding the fact that what failed is actually the queing up
of some handling to perform asynchronously in the future,
rather than invoking it synchronously right away.
IPC: server: avoid temporary channel priority loss, up to deadlock-worth
It turns out that while 7f56f58 allowed for less blocking (thus
throughput increasing) initial handling of connections from clients
within the abstract (out-of-libqb managed) event loop, it unfortunately
subscribes itself back to such polling mechanism for UNIX-socket-check
with a default priority, which can be lower than desired (via explicit
qb_ipcs_request_rate_limit() configuration) for particular channel
(amongst attention-competing siblings in the pool, the term here
refers to associated communication, that is, both server and
on-server abstraction for particular clients). And priority-based
discrepancies are not forgiven in true priority abiding systems
(that is, unlikele with libqb's native event loop harness as detailed
in the previous commit, for which this would be soft-torelated hence
the problem would not be spotted in the first place -- but that's
expliicitly excluded from further discussion).
On top of that, it violates the natural assumption that once (single
threaded, which is imposed by libqb, at least between initial accept()
and after-said-UNIX-socket-check) server accepts the connection, it
shall rather take care of serving it (at least within stated initial
scope of client connection life cycle) rather than be rushing to accept
new ones -- which is exactly what used to happen previously once the
library user set the effectively priority in the abstract poll
above the default one.
It's conceivable, just as with the former case of attention-competing
siblings with higher priority whereby they could _infinitely_ live on
at the expense of starving the client in the initial handling phase
(authentication) despite the library user's as-high-as-siblings
intention (for using the default priority for that unconditionally
instead, which we address here), the dead lock is imminent also in
this latter accept-to-client-authentication-handling case as well
if there's an _unlimited_ fast-paced arrival queue (well, limited
by with number of allowable open descriptors within the system,
but for the Linux built-in maximum of 1M, there may be no practical
difference, at least for time-sensitive applications).
The only hope then is that such dead-locks are rather theoretical,
since a "spontaneous" constant stream of either communication on
unrelated, higher-prio sibling channels, or of new connection arrivals
can as well testify the poor design of the libqb's IPC application.
That being said, unconditional default priority in the isolated
context of initial server-side client authentication is clearly
a bug, but such application shall apply appropriate rate-limiting
measures (exactly on priority basis) to handle unexpected flux
nonetheless.
The fix makes test_ipc_dispatch_*_glib_prio_deadlock_provoke tests pass.
2019-06-04 Jan Pokorný <jpokorny@redhat.com>
tests: ipc: check deadlock-like situation due to mixing priorities
Compared to the outer world, libqb brings rather unintuitive approach
to priorities within a native event loop (qbloop.h) -- it doesn't do
an exhaustive high-to-low priorities in a batched (clean-the-level)
manner, but rather linearly adds a possibility to pick the handling
task from the higher priority level as opposed to lower priority ones.
This has the advantage of limiting the chances of starvation and
deadlock opportunities in the incorrectly constructed SW, on the other
hand, it means that libqb is not fulfilling the architected intentions
regarding what deserves a priority truthfully, so these priorities are
worth just a hint rather than urgency-based separation.
And consequently, a discovery of these deadlocks etc. is deferred to
the (as Murphy's laws have it) least convenient moment, e.g., when
said native event loop is exchanged for other (this time priority
trully abiding, like GLib) implementation, while retaining the same
basic notion and high-level handling of priorities on libqb
side, in IPC server (service handling) context.
Hence, demonstration of such a degenerate blocking is not trivial,
and we must defer such other event loop implementation. After this
hassle, we are rewarded with a practical proof said "high-level
handling [...] in IPC server (service handling) context" contains
a bug (which we are going to subsequently fix) -- this is contrasted
with libqb's native loop implementation that works just fine even
prior that fix.
tests: ipc: refactor/split test_ipc_dispatch part into client_dispatch
This way, this core part can be easily reused where needed.
Note that "ready_signaller" similarity with run_ipc_server is not
accidental, following commit will justify it.
tests: ipc: allow for easier tests debugging by discerning PIDs/roles
Roles specifications are currently not applied and are rather
a preparation for the actual meaningful use to come.
tests: ipc: speed the suite up with avoiding expendable sleep(3)s
Using i7-6820HQ CPU yields these results:
Before: ~2:54
After: ~2:26
Speedup: ~16%
The main optimization lies in how run_function_in_new_process helper is
constructed, since now, there's an actual synchronization between the
parent and its child (that needs to be prioritized here, which is
furthermore help with making the parent immediately give up it's
processor possession) after the fork, so that a subsequent sleep is
completely omitted -- at worst (unlikely), additional sleep round(s)
will need to be undertaken as already arranged for (and now, just
400 ms is waited rather than excessive 1 second).
Another slight optimization is likewise in omission of sleep where
the control gets returned to once the waited for process has been
suceesfully examined post-mortem, without worries it's previous
life is still resounding.
tests: ipc: avoid problems when UNIX_PATH_MAX (108) limits is hit
There's some slight reserve for when bigger PID ranges are in use.
The method to yield the limit on prefix string was derived from
practical experience (rather than based on exact calculations).
2019-05-07 Ferenc Wágner <wferi@debian.org>
doc: qbarray: reword comment about index partitioning
doc: qbarray.h: remove stray asterisk and parentheses
2019-04-08 Christine Caulfield <ccaulfie@redhat.com>
ipc: Use mkdtemp for more secure IPC files
Use mkdtemp makes sure that IPC files are only visible to the
owning (client) process and do not use predictable names outside
of that.
This is not meant to be the last word on the subject, it's mainly a
simple way of making the current libqb more secure. Importantly, it's
backwards compatible with an old server.
It calls rmdir on the directory created by mkdtemp way too often, but
it seems to be the only way to be sure that things get cleaned up on
the various types of server/client exit. I'm sure we can come up with
something tidier for master but I hope this, or something similar, will
be OK for 1.0.x.
ipc: fixes
Use O_EXCL on IPC files
ipc: use O_EXCL on SHM files, and randomize the names
2019-03-26 Christine Caulfield <ccaulfie@redhat.com>
tests: allow blackbox-segfault.sh to run out-of-tree
2019-03-26 Fabio M. Di Nitto <fdinitto@redhat.com>
[tests] first pass at fixing test execution
[tests] enable building / shipping of libqb-tests.rpm
[tests] allow installation of test suite
[tests] export SOCKETDIR from tests/Makefile.am
allows make check to be executed correctly from tests/ dir.
[test-rpm] build test binaries by default
build test binaries at "make" or "make all" instead of "make check".
this is necessary if it´s not possible to run make check during make rpm.
2019-01-14 Jan Pokorný <jpokorny@redhat.com>
build: configure: fix "snapshot consumption" feature on FreeBSD
There were a few missed leftovers in d6875f2 regarding compatibility
with sed on FreeBSD (some commands do require a newline and/or
backslash separation).
Merges: #335
2018-12-13 wferi <wferi@debian.org>
Add Pthreads (and possibly other) flags to the pkg-config file (#332)
Proper Libs.private enables linking applications statically against
libqb: static archives (.a) don't carry their own dependency
information, unlike shared libraries (.so). Modern libc versions
include socket and RT functions, so socket_LIBS and rt_LIBS will be
empty there, but we include them for strict correctness on older
platforms; basically, we're matching libqb_la_LIBADD here.
Consequently, nsl_LIBS and GLIB_LIBS don't enter this field, since they
are only used in the examples and tests, not in the library proper.
Cflags, on the other hand, is emitted all the time and (under GCC)
propagates the -pthread option (which also affects the preprocessing
stage) to all users of libqb even when compiling modules or linking
everything dynamically.
2018-12-12 Christine Caulfield <ccaulfie@redhat.com>
skiplist: Fix previous skiplist fix
The last fix to skiplist never ran the code that patched up the level
list as it updated the current level before runnign the loop.
This now works.
Merges: https://github.com/ClusterLabs/libqb/pull/333
Reviewed-by: Jan Pokorný <jpokorny@redhat.com>
2018-11-12 Chrissie Caulfield <ccaulfie@redhat.com>
log: Remove more dead code from linker callsites (#331)
Thanks for the review
2018-11-09 Chrissie Caulfield <ccaulfie@redhat.com>
Add the option of hi-res (millisecond) timestamps (#329)
* log: Add high-resolution timestamp option for log files
This adds the %T option to the log format for millisecond timestamps. There's a feature test macro QB_FEATURE_LOG_HIRES_TIMESTAMPS so that applications know that they are available.
Because this changes the internal logging API, applications that use custom loggers will also need to change their custom logging destinations to take a struct timespec instead of a time_t. The above feature test macro will help in deciding which is appropriate.
2018-11-08 Fabio M. Di Nitto <fdinitto@redhat.com>
[build] fix supported compiler warning detection (#330)
move from AC_PREPROC_IFELSE (strongly discouraged) to AC_COMPILE_IFELSE
our detection system was very weak and recent versions of clang did
show that PREPROC_IFELFE (cpp) would enable warning options that
the compiler does not support (clang).
use a full compilation test to detect what works and what doesn't.
Also expand the warning list to include new / renamed clang options
of equivalents already enabled for older versions of clang and gcc.
2018-10-26 Chrissie Caulfield <ccaulfie@redhat.com>
log: Add configure-time option to use systemd journal instead of syslog (#327)
* log: add systemd journal as a logging option
systemd journal can be configured as a logging option
at ./configure time (--enable-systemd-journal).
If libqb is buit with this then the syslog target can be switched
to sending to the journal using
qb_log_ctl(QB_LOG_SYSLOG, QB_LOG_CONF_USE_JOURNAL, 1);
2018-10-23 Yusuke Iida <iidayuus@intellilink.co.jp>
configure: Fixed the problem that librt was explicitly needed in RHEL 6 (#328)
2018-10-16 Chrissie Caulfield <ccaulfie@redhat.com>
log: Add option to re-open a log file (#326)
As this patch also brought up some locking issues with re-configuring the logging while threaded logging was enabled, it also includes locking around qb_log_ctl2() and conversion of in_logger to an atomic.
2018-10-15 Christine Caulfield <ccaulfie@redhat.com>
skiplist: fix use-after-free in the skiplist traversal
(Patch from poki, only committed under my name because github is being
weird)
This used to happen when an iterator contained a reference on the item
to continue with, which got outdated when such item had been removed in
the interim, though it's original memory would still be -- mistakenly --
accessed. Actually such a condition is exercised with an existing
"test_map_iter_safety(ordered=true)" test, though it likely never run
under valgrind's supervision and standard memory checking harness was
too coarse (perhaps because of low memory pressure or other "lucky"
coincidence). Thankfully, the default, paranoid approach towards dynamic
memory handling in OpenBSD (free(3) call makes small chunks "junked",
i.e., filled with 0xdf bytes, see malloc.conf(5)) resulted in the
explicit segmentation fault when tripping over the happens-to-be-freed
pointer in the assumed iteration chain.
We solve the "out-of-sync iterator" issue with a twist, inverting
the responsibility to carry (and more widely, to contribute in the
propagation of) the up-to-date "forward" pointers, as clearly,
iterating over and over through the items would not be very scalable
(and it was not done, which had resulted in the first place).
So now, when any skiplist item is to be removed, its preceding item
gets the "forward" pointers recomputed as before, but then, they are
copied into "forward" pointers for the item to be removed, original
area containing them is disposed, and this preceding item just points
to the area primarily managed by the to-be-removed item (procedure
dubbed "takeover-and-repoint" in the comment). This itself gets
a special mark so that this area won't be dropped when that item gets
disposed, which rather happens with the disposal of the preceding item
that points to the "forward" memory area at hand and is not marked so.
This is believed to be sufficient to address out-of-band (iterator
based) access versus interim future iteration chain mangling, as these
operate de facto on the non-sparse, linear level of the skiplist.
Alternative approaches include:
turning pointers-to-arrays into pointers-to-pointers-to-arrays to
allow for explicit setting to NULL after free, and sharing this
additional indirection -- this straightforward extension was
attempted first, but shortly after, it became apparent it would
be a nightmare with the current interprocedural dependencies
extra tagging of the structures and adding complexities around
checking the eligibility, like every other manipulation with the
skiplist
completely split life-cycle of "node" and "node->forward", i.e.,
separate reference-counting etc.
Also said test was extended to push the corner case to the limit:
when to-resume-with item in the chain is being figured out, the
predecessors may be consulted (it is in that test), but the very
first predecessor is now removed as well, for good measure, as
it makes for boundary condition ^ 2.
Signed-off-by: Jan Pokorný jpokorny@redhat.com
2018-09-27 Chrissie Caulfield <ccaulfie@redhat.com>
logging: Remove linker 'magic' and just use statics for logging callsites (#322)
It is my (and several others') opinion that the linker 'magic' used to maintain callsite data in libqb is hugely over complicated and unnecessarily fragile. It's main purpose seems to have been to improve performance but empirical testing shows this to be tiny at best. The overhead of sprintf makes minor optimisations in this code pointless.
With this code removed, libqb allocates callsites using a C static variable at run-time. This sounds bad but in actuality it merely moves the allocation from program load time to the first few milliseconds of program run-time. Applications like corosync and pacemaker spend most of their time in small loops doing the same work over and over again so the overhead doesn't apply and jitter does not occur.
We've tested this with corosync and pacemaker under valgrind and massif and the differences are minimal and even then only show up under artificial stress testing.
For this change I've bumped the soname up to 20 to indicate this is an incompatible change. I'm open to suggestions as to a release number but am currently thinking of 2.0.0
2018-09-25 Chrissie Caulfield <ccaulfie@redhat.com>
UPDATED: doc (ABI comparison) and various other fixes (#324)
* doc: qbarray.h: fix garbled Doxygen markup
* build: follow-up for and fine-tuning of a rushed 6d62b64 commit
(It made a service as-was, but being afforded more time, this would
have accompanied that commit right away, for better understanding,
brevity and uniformity.)
* build: prune superfluous Makefile declarations within tests directory
There was a significant redundancy wrt. build flags and EXTRA_DIST
assignment (the latter become redundant as of f6e4042 at latest)
spread all over the place (vivat copy&paste). Also, in one instance,
CPPFLAGS (used) was confused with CFLAGS (meant).
* maint: check abi: fix two issues with abi-compliance-checker/libstdc++
1. ABICC >= 2 needs to be passed -cxx-incompatible switch because C is
no longer a default for this tool (used to be vice versa),
plus current version will stop choking on C vs. C++ (our C code with
C++ compatibility wrapping being viewed from C++ perspective for the
purpose of dumping the declared symbols, which somewhat conflicts
with internal masking of the C++ keywords being used as valid C
identifiers [yet some instances must not be masked here, see
https://github.com/lvc/abi-compliance-checker/issues/64) only
if _also_ something like this is applied:
https://github.com/lvc/abi-compliance-checker/pull/70
2. since 20246f5, libqb.so no longer poses a symlink to the actual
version-qualified shared library, but rather a standalone linker
script, which confuses ABICC, so blacklist that file for the scanning
purposes explicitly, together with referring to the library through
it's basic version qualification (which alone, sadly, is not
sufficient as ABICC proceeds to scan whole containing directory
despite particular file is specified)
* maint: check abi: switch to abi-dumper for creating "ABI dumps"
Beside avoiding issues with abi-compliance-checker in the role of ABI
dumps producer (see the preceding commit), it also seems to generate
more accurate picture (maybe because it expressly requires compiling
with debugging information requested).
* Low: qblist.h: fix incompatibility with C++ & check it regularly
* tests: check_list.c: start zeroing in on the gaps in tests' coverage
* tests: print_ver: make preprocessor emit "note" rather than warning
IIRC, Chrissie asked about this around inclusion of the test at
hand, and it seemed there was no way but to emit a warning to get
something output at all. Now it turns wrong, and moreover, we
make the code not fixed on GCC specific pragmas, with a bit of
luck, "#pragma message" approach is adopted more widely by compilers.
* Replace ck_assert_uint_eq() with ck_assert_int_eq()
it's not available in check 0.9
* Proper check for C++ compiler (from Fabio)
* add (c) to copyright dates
2018-09-13 Jan Pokorný <jpokorny@redhat.com>
build: allow for being consumed in a (non-endorsed) form of snapshots
This is meant as a lean, customized policy driven alternative
to the original proposal by Jan Friesse <jfriesse@redhat.com> that
balances the inherent trade-off in the opposite direction, so that the
configure.ac script is practically untouched and more weight and policy
is hardcoded in git-version-gen. Problem with that approach stems from
(avoidable) effective fork of the respective gnulib's module and imposed
maintenance burden.
Speaking for libqb in particular, we should nonetheless make it
absolutely clear such in-development snapshots are nothing more,
nothing binding (not to think of viral injection of these bits
into circle of dependent packages upon their rebuilds), since the
changes accumulated since the last official release should only be
assumed firmly committed at the point the new release is cut (may
happen 99% of time with snapshots but no accountability from our
side for the complementary inter-release twists...), which is exactly
when many possibly unanticipated variables like correct SONAME
versions get to reflect what's appropriate.
Also, OpenPGP signature constitutes something more eligible for
one's trust than (provably) bit/content unstable archives without
the possibility of an independent authenticity/integrity verification.
Therefore, the only thinkable and upstream-endorsed use cases
for such snapshots are development-only purposes (CI et al.)!
V2 of the patch:
Thanks to feedback from Jan Friesse, a glitch in "make rpm" et al.
not working with the snapshots was pointed out.
V3:
Only normalize configure.ac back when known to be previously affected
with "git archive" substitution logic, and do not use an exclamation
mark as short commit - decoration separator since that could be
ambiguous (it is a valid branch name character), stick with double
question marks instead (not allowed, doubled for good measure).
2018-09-04 Jan Pokorný <jpokorny@redhat.com>
build: configure: fix non-portable '\s' and '//{q}' in sed expression
Turned out that the current way of checking of symbol visibility
(introduced with the main linker compatibiity fixing commit 20246f54)
doesn't work on FreeBSD as caught thanks for Kronosnet's CI[0]:
> checking whether linker emits global boundary symbols for orphan
> sections... sed: 1: "/__start___verbose/{s/^ ...": extra characters
> at the end of q command
[0] https://ci.kronosnet.org/view/libqb/job/libqb-build-all-nonvoting/libqb-build-all-nonvoting=freebsd-devel-x86-64/lastBuild/consoleFull
2018-08-28 Daniel Black <daniel@linux.ibm.com>
build: dpkg-architecture on trusty (cf. Travis CI) uses -q{NAME}
Reviewed-by: Jan Pokorný <jpokorny@redhat.com>
build: split hack for splint to work on non-x86 architectures
Uses dpkg-architecture, if present, to return
DEB_HOST_GNU_TYPE, and use this appended to /usr/include
for form the path.
Reviewed-by: Jan Pokorný <jpokorny@redhat.com>
CI: travis: show logs of test failures
Reviewed-by: Jan Pokorný <jpokorny@redhat.com>
tests: blackbox-segfault test - remove residual core files
Reviewed-by: Jan Pokorný <jpokorny@redhat.com>
2018-05-14 Chrissie Caulfield <ccaulfie@redhat.com>
log: Use RTLD_NOOPEN when checking symbols (#310)
on FreeBSD 11 call dlopen on a shared library causes the constructors
to run again. As we're just getting symbols we don't need this to
happen.
Actually we don't WANT it to happen because it can cause qb_log_init to
be called twice (recursively) and the dlnames list gets corrupted. This
causess corosync (at leasT0 to crash at startup.
2018-05-03 Fabio M. Di Nitto <fdinitto@redhat.com>
tests: use RUNPATH instead of RPATH consistently (#309)
some vendors default to RPATH, others to RUNPATH. The former does not allow override
with LD_LIBRARY_PATH when running binaries such as test suite and it was causing
problems on platforms where RPATH is default, by running the test suite against
the wrong library (out-of-tree vs in-tree).
This change has no effect on libqb itself, but only on the binaries.
2018-05-03 Chrissie Caulfield <ccaulfie@redhat.com>
Allow customisable log line length (#292)
* log: Allow flexible size of logging buffer & ellipsis if it overflows.
Allow the logging line length to be changed. Any reasonable length is allowable, the default is 512 as before. Anything more than 512 incurs several mallocs.
Also add an option to set the last 3 characters as '...' if the line length overflows.
2018-04-20 Chrissie Caulfield <ccaulfie@redhat.com>
ipc_shm: Don't truncate SHM files of an active server (#307)
* ipc_shm: Don't truncate SHM files of an active server
I've put in an extra check so that clients don't truncate the
SHM file if the server still exists. Sadly on FreeBSD we can't
get the server PID for the client (unless someone has a patch handy!)
so we still do the truncate when disconnected. As a backstop (and also
to cover the BSD issue) I've added a SIGBUS trap to the server shutdown
so that it doesn't cause a server crash.
Reviewed by: Jan Friesse <jfriesse@redhat.com>
2018-03-27 Chrissie Caulfield <ccaulfie@redhat.com>
test: Fix 'make distcheck' (#303)
Miscellaneous fixes and cleanups to get 'make distcheck' to work on most
platforms.
2018-03-20 wferi <wferi@debian.org>
Fix comment typo (#296)
* Fix misleading comment on preprocessor conditional
* Fix spelling: plaform -> platform
2018-03-08 Chrissie Caulfield <ccaulfie@redhat.com>
tests: Improve test isolation (#298)
* tests: Improve test isolation
Make all the IPC tests run with a common date/pid stamp name, so that
the final resource.test only fails if it finds one of OUR files left
lying around and not those from another test.
Falls back to old IPC naming style if we can't create the file.
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2017-12-25 Jan Pokorný <jpokorny@redhat.com>
build: fix configure script neglecting, re-enable out-of-tree builds
For the former, a prototype and the final code got (hm, mysteriously)
intertwisted. For the latter, I am clearly guilty of (rare, anyway)
testing of the out-of-tree builds only with libqb-already-system-wide
scenario, which is rather shortsighted.
Thanks Fabio and his ci.kronosnet.org project for spotting that.
X-mas-present-for: Fabio M. Di Nitto <fdinitto@redhat.com>
2017-12-21 Jan Pokorný <jpokorny@redhat.com>
maint: fix "make maintainer-clean" not working in tests/functional
2017-12-21 Christine Caulfield <ccaulfie@redhat.com>
warnings cleanup: fix initialiser warning on RHEL7
2017-12-21 Jan Pokorný <jpokorny@redhat.com>
warnings cleanup: give up on some warning classes for now
warnings cleanup: Wunused-function: leave the test commented out
... as well as the test inclusion itself in make_soc_suite.
warnings cleanup: Wformat: sign-correct PRIu32 specifiers as appropriate
Looks like these are not accepted with splint checker. Also fix some
other minor type -- print format specifier discrepancies.
2017-12-20 Jan Pokorný <jpokorny@redhat.com>
warnings cleanup: Wsign-compare: log_format: int32_t -> size_t
When at it, also fix the related indentation.
warnings cleanup: Wsign-compare: hdb: uint32_t <-> int32_t
When at it, also document that qb_hdb_handle_get_always is an alias
to qb_hdb_handle_get.
warnings cleanup: Wsign-compare: array: int32_t -> size_t
maint: array: avoid magic constants, expose some in the API
... also to make it the documentation refer to the implementation limits
properly.
When at it, also document some nits on the implementation side, unify
qbarray.h with project's doxygen conventions a bit + fix a typo there.
warnings cleanup: hdb+loop_timerlist: Wsign-compare: (canary?) variables
In case of hdb.c, the problem is that `check` public API (qb_hdb_handle
member struct) item (which should not be exposed publicly like this
in the first place!) is typed as `int32_t`, whereas it was to be
compared to `uint32_t` implementation-possessed local variables
(presumably derived from the same source), which made the compiler
upset (even though there was no real reason, integer promotion to
unsigned type would happily occur, which is furthermore expected to
be fully defined as these values come from `random` that shall
return non-negative integers below `INT32_MAX`).
Hence:
- type these local variables to `int32_t` just as well, which allows to
- simplify `random` return value handling, since they are expected to be
zero-or-greater and the previously extra tested all-bits-on pattern
makes undoubtfully for a negative numeric value in case of a signed
integer with specified width (c.f. 7.18.1.1/C99), hence falling into
complement of zero-or-greater; zero itself is also excluded for the
reasons stated in the comment (which was pretty hazy and incorrect,
so it gets overhaul as well)
- also superfluous typecasts are removed
Similar situation is with loop_timerlist.c, where we are actually fully
in charge of the struct member (private API), but there are good reasons
to stay consistent with the former file as the same applies to the
source of that value -- it comes from `random` (equivalent comment
is added here for greater symmetry).
maint: replace 0xffffffff constants with UNIT32_MAX
warnings cleanup: Wshift-overflow: trigger arithmetic conv. to unsigned
warnings cleanup: log: Wextra -> Wimplicit-fallthrough (GCC7+)
See also:
https://www.gnu.org/software/gcc/gcc-7/changes.html
https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-fallthrough
2017-12-14 Jan Pokorný <jpokorny@redhat.com>
build: release.mk: deal with trailing whitespace-to-comment-delimiter
... that is preserved by design, see:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html#tag_20_76_13_05
> string1 = [string2]
> [...]
> where string2 is defined as all characters, if any, after the
> <equals-sign>, up to a comment character ( '#' ) or an unescaped
> <newline>. Any <blank> characters immediately before or after the
> <equals-sign> shall be ignored.
doc: qblog.h: further logging setup related tweaks
Amongst others, care to spell out meaning of "QB_LOG_CONF_PRIORITY_BUMP"
and "fsync'ed logs to file targets" a bit.
doc: qblog.h: syslog rarely appropriate for ordinary programs
Also fix qb-blackbox to follow this advice (and make it tab-consistent).
2017-12-12 Jan Pokorný <jpokorny@redhat.com>
Low: fix internal object symbol's leak & expose run-time lib version
The object in question has never been published through the header file,
hence it's presumably safe to make it static as it's meant to be.
On the other hand, QB_LOG_INIT_DATA macro from qblog.h has already
started to depend on that symbol so as to locate the library handle
for libqb itself correctly. This is trivially fixed by finally exposing
library versioning info in run-time ("online") as a structure with
members corresponding to compile-time ("offline") counterparts from
qbconfig.h header file, which are admittedly of very limited use
as opposed to the newly introduced dynamic info, plus lower-cased
equivalent of QB_VER_STR. Better than to roll out a futile data object
serving as an artificial anchor for the above purpose, and this was
due for a while, afterall.
In turn, also bump "current" and "age" of fields of the libtool's
"-version-info" versioning system.
High: bare fix for libqb logging not working with ld.bfd/binutils 2.29+
(or rather [read on]: "bare" fix, now that we established means to
analyse the impact of the linker-dependent misbehaviour and to detect
some of its symptoms in preceding two commits, respectively)
Initially with the help of the internal test suite and the failing log
test, it was eventually discovered[1] that these binutils commits going
to the recent 2.29 release affected the treatment of _start_SECNAME
and __stop_SECNAME symbols denoting the boundary start/stop addresses
of a SECNAME orphan section -- specifically in libqb context a custom
section (SECNAME=__verbose) used for link-time ("run-time amortizing")
callsite collection when there's a support in the toolchain[*]:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=cbd0eecf261c2447781f8c89b0d955ee66fae7e9
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b27685f2016c510d03ac9a64f7b04ce8efcf95c4
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7dba9362c172f1073487536eb137feb2da30b0ff
The first one explicitly states:
> Also __start_SECNAME and __stop_SECNAME symbols are marked as hidden
> by ELF linker so that __start_SECNAME and __stop_SECNAME symbols for
> section SECNAME in different modules are unique.
The problem is that libqb silently depends on the previous status quo
ld.bfd linker behaviour of keeping those symbols externally visible,
which was apparently not granted as it has deliberately changed per
above.
And then for 2.29.1 release of binutils once again, as someone actually
noticed something went overboard with the 2.29 changes:
http://lists.gnu.org/archive/html/bug-binutils/2017-08/msg00195.html
(overview of the original bug discussion, rather than directly
https://sourceware.org/bugzilla/show_bug.cgi?id=21964, which is
a result of a conflct resolution when restoring bugzilla backup)
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=487b6440dad57440939fab7afdd84a218b612796
At least that change doesn't invalidate all the effort being put into
the original version of the changeset, only the configure script check
had to be refined so as not to miss the "orphan section magic not
working properly out of the box, without band aid" observation
(see the inline comment) -- the workaround arrangement needs
to be applied in that case as well.
* * *
So regarding the solution itself, the core of the fix was sketched at
the original Fedora targeted bug against binutils[2]. In short, we are
using a custom linker script that (re)describes the mentioned custom
orphan output section, or better yet, assuredly pushes that section, and
more importantly, it's own boundary denoting symbols, through into the
resulting executable when it's being linked (as in compile-time step).
This solution alone, while working for the non-libqb (more on that
below) logging participants, is not good enough, as it requires all
libqb targets to start using new incantation (namely "-Wl,foo.t" switch)
in the final link step during compilation, which might be solvable
with a tweak in libqb's pkg-config file under assumption that practice
of using "pkg-config --libs libqb" is rigidly followed. Which is likely
a false expectation, and furthermore only for the regular consumption
model, as it doesn't cover the least bit the developmental one (refer
to previous-but-one "tests" commit message), e.g. applied for internal
examples + tests (but no local sub-checkout tree usage can be excluded).
So further extensions were devised to cover both consumption models:
- a. regular:
courtesy of binutils maintainer[3], we follow an idea to make libqb.so
(i.e. what the targets link against) rather a linker script on its
own, which first include the version-specified (e.g. libqb.so.0) file
into the link, then lists, in situ, the content of the linker script
per above, hence -lqb linking has the same effect as having both
"-lqb -Wl,foo.t" explicitly in the link command prior to this trick
- b. developmental:
to eliminate any kind of race condition arising from the attempt
to post-modify libqb.la libtool archive file generated internally
by libtool, we sort of abuse "inherited_linker_flags" variable
within this file format, as it forms an accumulative value across
the whole transitive dependencies chain (if not impaired per the
note below), fitting exactly our purpose of injecting "-Wl,foo.t"
switch equivalent for those libtool-linking by L{D,IB}ADD'ing
libqb.la; it's then enough to craft a custom libtool archive file
declaring that value, and hook it into such dependency chain through
libqb_la_LIBADD, and with a little bit of further fiddling, it works
as desired (note that double occurrence of "-Wl,foo.t" equivalent
present at some stages of sorting this trick turned out to be,
surprisingly, counter-productive, which should now demistify the
very existence of effectively empty qblog_script_noop.ld file);
NOTE: some forms of libtool distribution (debian + derivatives ones
in particular) undermine natural transitive dependency propagation
with a deliberate cut off (https://bugs.debian.org/702737), so we
need to ensure the "impairment" is not happening by force (corosync
precedent: https://github.com/corosync/corosync/commit/0f1dc5c1)
^ something like this needs to be applied for any such "private
consumer" (although it hopefully goes without saying this way
of consuming libqb outside of it's own playground is hardly
the Right Thing) if portability is important, nonetheless!
* * *
On the address of linker script workaround, there are linkers out there
that do not support the trick, for instance:
- ld.gold from binutils (but it has hardly ever been working with
orphan sections, anyway:
https://sourceware.org/bugzilla/show_bug.cgi?id=22291)
- ancient versions of ld.bfd, e.g. 10+ years old one used as a native
system linker even in the most recent releases of FreeBSD, unless
GCC toolchain is used instead
If these are hit when (because) the compiler has already demonstrated it
supports "section" attribute, the build system configuration is forcibly
stopped, simply to stay conceptually compatible with the prior state in
which the affinity to leverage that feature hasn't been called off
under any circumstances. One is, however, able to achieve exactly
this behaviour with --enable-nosection-fallback switch, but if some
other participants in the logging, possibly linked with a more friendly
linker, do utilize this orphan section, logging may silently break
(another reason to require an explicit sign-off).
Another note, the particular self-check change slightly touched in the
previous commit but otherwise predating this whole effort by far needs
to be modified now once again, this time because linker-script-based
workaround for newer linkers as stated causes the section boundary
symbols to be present regardless if that section is utilized, leading
to a self-inflicted breakage due to these empty section symbols suddenly
winning in the symbol resolution mechanism (previously the empty section
would be dropped incl. the boundary symbols), causing problems down the
line. It also makes this very check self-contained in the same
compilation unit that trigggers it, whereas previously it used to be the
said "arbitrary" winner and things kept silently working just because
failure condition -- empty section -- would be implicitly isolated.
Last but not least, libqb itself needs to be linked with the mentioned
"-Wl,foo.t" equivalent for its own outgoing log messages to be honoured
under all circumstances, which is already achieved with the arrangement
for b. above, and by experiments, further redefinition of those boundary
denoting symbols as weak was necessary so as to make them truly global
within libqb.so proper (at least with binutils 2.29).
* * *
To provide a high-level prioritized overview of what drove the approach:
- PRESERVATION OF BINARY COMPATIBILITY (ABI), which is achieved except
for a single "ABI nongracefulness" I am aware of but that's more
a consequence of slightly incorrect assumptions in the logic of
QB_LOG_INIT_DATA macro function predating this whole affair by
a long shot and which the patchset finally rectifies:
if in the run-time dynamic link, following is combined:
(. libqb, arbitrary variant: pre-/post-fix, binutils < / >= 2.29)
. an "intermediate" library (something that the end executable links
with) triggering QB_LOG_INIT_DATA macro and being built with
pre-fix libqb (and perhaps only with binutils < 2.29)
. end executable using no libqb's logging at all, but being built
with post-fix libqb (and arbitrary binutils < / >= 2.29)
then, unlike when executable is built with pre-fix libqb, the
special callsite data containing section in the ELF structure
of the executable is created + its boundary denoting symbols
defined within, despite the section being empty (did not happen
with pre-fix libqb), and because the symbols defined within the
target program have priority over that of shared libraries in the
symbol resolution fallback scheme, the assertion of QB_LOG_INIT_DATA
of the mentioned intermediate library will actually be evaluating
the inequality of boundaries for the section of the executable(!)
rather than it's own (or whatever higher prio symbols are hit,
presumably only present if the section at that level is non-empty,
basically a generalization of the story so far);
the problem then manifests as unability to run said executable
as it will fail because of the intermediate library inflicted
assertion (sadly with very unhelpful "Assertion `0' failed"
message);
fortunately, there's enough flexibility so as how to fix
this, either should be fine:
. have everything in the executable's library dependency closure
that links against libqb assurably (compile-time) linked with one
variant of libqb only (either all pre-fix or post-fix, mind the
apparent limitation of binutils' versions with the former)
. have the end executable (that does not use logging at all as
discussed precondition) linked using substitution like this:
s/-lqb/-l:libqb.so.0/ (you may need to adapt the number later)
and you may also need to add this CPPFLAG for the executable:
-DQB_KILL_ATTRIBUTE_SECTION
- as high level of isolation of the client space from the linker
(respectively toolchain) subtleties as possible (no new compilation
flags and such required, plus there's no way to hook any dynamic
computational ad-hoc decision when the compilation is about to
happen, anyway), and in turn, versatility is preserved as much as
possible
* * *
Finally, let's have a look how the already well-known test matrix
overview changes as of this commit, but first as a recap,
"X(Y)" denotes "X linked with linker Y":
X(a) .. ld.bfd < 2.29
X(b) .. ld.bfd = 2.29 (+ 2.29.1 and hopefully on)
and here you are (values in <angle brackets> denote non-trivial change
[not mere rewording] introduced as of this commit, in comparison to the
table stated in the preceding commit):
+=========+=========+=========+=========+=========+=========+=========+
#client(x)# libqb(a) usage # libqb(b) usage #
# vvv #---------+---------+---------+---------+---------+---------+
# V # direct | libX(a) : libX(b) # direct | libX(a) : libX(b) #
+=========+=========+=========+=========+=========+=========+=========+
# x = a # OK | OK : <OK> # <OK> | <OK> : <OK> #
# x = b # <OK> | <OK> : <OK> # <OK> | <OK> : <OK> #
+=========+=========+=========+=========+=========+=========+=========+
Everything is green \o/
* * *
Note: as of this fix, it is assumed that the non-green counterpart of
this table in the message for the preceding commit (loosely though[!],
as the occurrence of empty callsite section can no longer be attributed
to something bad going on as of this fix that enforces its presence
unconditionally, whereas it would be suppressed when unused before
with kind linkers, hence some other conditions can be witnessed
especially when QB_LOG_INIT_DATA misused in no-logging context)
doubles as an indicator how will mixing the logging participants wrt.
linker+libqb version work out, when "X(Y)" becomes read as "X linked
with linker Y under additional restriction on libqb version when
compile-time link is performed of the particular part":
X(a) .. ld.bfd < 2.29 OR [arbitrary ld.bfd AND libqb after this fix)
X(b) .. ld.bfd = 2.29 (and likely on) AND libqb up to, but excluding
this fix
* * *
Let's also state some imperfections and loops kept open:
Deficiencies:
* whenever anything is compiled against our install-time-modified
libqb.so so as to force the visibility of the discussed symbols
(or when compiling [with] libqb internally):
> /usr/bin/ld: warning: ../lib/qblog_script.ld contains output sections; did you forget -T?
- not solvable as long as we use the linker script, and there's
hardly any other way not requiring the libqb consumers to adapt
in any aspect
* as already mentioned, lacking compatibility with ld.gold linker and
won't foreseeably be (cf. https://bugzilla.redhat.com/1500898#c7)
- please stick with ld.bfd (i.e. default ld linker), which you
had to do in the past anyway (at least for compiling libqb
itself)
Open questions:
* should we enable attribute((__section__)) for powerpc and other minor
platforms if the feature is proved to be working there as well?
and if/when that's going to happen, we need to figure out the
transition plan to be spread throughout an extended period to keep
the transition smooth -- notably when now-with-callsite-section
clients will get run-time linked with callsite-section-not-a-default
libqb (say upon it's downgrade), and for that, the libqb's support
alone should be enabled year(s) ahead of the actual client space...
* * *
[*] basically GCC's section("SECNAME") __attribute__ annotation of the
global variables + linker described behaviour previously mistakenly
taken for granted
References:
[1] http://oss.clusterlabs.org/pipermail/developers/2017-July/000503.html
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1477354#c2 + comment 8
[3] https://bugzilla.redhat.com/show_bug.cgi?id=1477354#c9
Med: add extra run-time (client, libqb) checks that logging will work
Now that the previous commit provides a foundation for what exactly can
go wrong with ld.bfd = 2.29+ linker, let's start reconciling that with
some reasonable assurance that logging is not silently severed, because
realizing the logs are missing is otherwise bound to happen when the
logs are suddently pretty crucial analytical resource :-)
We'll proceed in two steps as detailed.
* * *
As a first step, the table below concludes how the test matrix overview
introduced with a message for the preceding commit (also introducing
log_test_mock.sh runner which got reused here) looks as of this
refreshed sanity check, once QB_LOG_INIT_DATA macro at hand gets applied
(meaning "for non-libqb logging participants" so as not complicate the
matrix further). That macro is nothing triggered directly, it will just
plant a constructor-like function (to be invoked automatically early in
the execution) that will run through the checks (one original and couple
of new ones as of this changeset).
Note that for libqb users, this implies a new link dependency on libdl,
because they may opt-in for refreshed QB_LOG_INIT_DATA sanity check that
calls out to dlopen/dlsym/dladdr directly in case of "attribute section"
being available for the particular platform, and hence immediately needs
those symbols resolved in link time. Hence, add this conditional link
dependency to libqb.pc pkg-config file under Libs variable -- we
actually restore the occurrence of "-ldl" there as it used to be present
until commit 56754d0. While doing so, also move immediate link
dependencies of libqb (if any, currently not but that may be
a regression arising from the cleanup related to the mentioned commit)
represented with the LIBS autoconf variable under Libs.private variable
in libqb.pc, where it belongs per pkg-config documentation.
The promised table follows, but first as a recap, "X(Y)" denotes
"X linked with linker Y":
X(a) .. ld.bfd < 2.29
X(b) .. ld.bfd = 2.29 (and only 2.29)
goes like this (values in <angle brackets> denote non-trivial change
[not mere rewording] introduced as of this commit, in comparison to
the table stated in the preceding commit):
+=========+=========+=========+=========+=========+=========+=========+
#client(x)# libqb(a) usage # libqb(b) usage #
# vvv #---------+---------+---------+---------+---------+---------+
# V # direct | libX(a) : libX(b) # direct | libX(a) : libX(b) #
+=========+=========+=========+=========+=========+=========+=========+
# x = a # OK | OK : BAD[*2] #<BAD[*E]>|<BAD[*F]>:<BAD[*G]>#
# x = b # BAD[*A] | BAD[*B] : BAD[*C] #<BAD[*E]>|<BAD[*F]>:<BAD[*G]>#
+=========+=========+=========+=========+=========+=========+=========+
Woefully, nothing changes if we swap binutils 2.29 for 2.29.1, i.e.,
X(b) .. ld.bfd = 2.29.1, compared to previous state, i.e., the second
table from the previous commit is still applicable for that situation.
The added sanity checks are useful nonetheless, consider for example,
that attribute-section-less libqb is what gets run-time linked to an
attribute-section-full target. The most precise check we could use
-- a custom logger function applied in a self-test scheme -- is not
available at the point the macro-defined function gets invoked, simply
because qb_log_init hasn't been invoked by the time that constructor
gets triggered. However, what we can do is to add a non-trapping
libqb-residing reverse-testing of the client space that (and once it)
voluntarily initiates qb_log_init (delivering abruption all of a sudden
at some unanticipated, as opposed to a well-timed like with
constructors, execution point, seems pretty bad idea + libqb as
a library is a mere helper, not an undertaker :) -- this check then
only announces, via syslog (the only pre-enabled logging target),
the target's logging may be severed.
* * *
Hence, as a promised second step, after incorporating the syslog
change (and extending log_test_mock.sh so as to capture syslog
stream within the container), not much changes with the table above,
i.e., X(b) .. ld.bfd = 2.29:
[*A] in addition, unless QB_LOG_INIT_DATA used on client side,
syslog carries this notice:
"(libqb) log module hasn't observed target chain supplied callsite
section, target's and/or libqb's build is at fault, preventing
reliable logging (unless qb_log_init invoked in no-custom-logging
context unexpectedly, or target chain built purposefully without
these sections)"
logged by libqb proper
[*C] in addition, unless QB_LOG_INIT_DATA used on interlib side,
syslog carries this notice:
"(libqb) log module hasn't observed target chain supplied callsite
section, target's and/or libqb's build is at fault, preventing
reliable logging (unless qb_log_init invoked in no-custom-logging
context unexpectedly, or target chain built purposefully without
these sections)"
logged by libqb proper
[*E] in addition, unless QB_LOG_INIT_DATA used on client side,
syslog carries this warning:
"(libqb) log module has observed target chain supplied section
unpopulated, target's and/or libqb's build is at fault, preventing
reliable logging (unless qb_log_init invoked in no-custom-logging
context unexpectedly)"
logged by libqb proper
[*F] in addition, unless QB_LOG_INIT_DATA used on interlib side,
syslog carries this warning:
"(libqb) log module has observed target chain supplied section
unpopulated, target's and/or libqb's build is at fault, preventing
reliable logging (unless qb_log_init invoked in no-custom-logging
context unexpectedly)"
logged by libqb proper
[*G] in addition, unless QB_LOG_INIT_DATA used on interlib side,
syslog carries this warning:
"(libqb) log module has observed target chain supplied section
unpopulated, target's and/or libqb's build is at fault, preventing
reliable logging (unless qb_log_init invoked in no-custom-logging
context unexpectedly)"
logged by libqb proper
but desirably changes with "X(b) .. ld.bfd = 2.29.1" one
(DEP ~ "depends"):
+=========+=========+=========+=========+=========+=========+=========+
#client(x)# libqb(a) usage # libqb(b) usage #
# vvv #---------+---------+---------+---------+---------+---------+
# V # direct | libX(a) : libX(b) # direct | libX(a) : libX(b) #
+=========+=========+=========+=========+=========+=========+=========+
# x = a # OK | OK : DEP[*J] #<BAD[*M]>|<BAD[*M]>:<BAD[*L]>#
# x = b #<DEP[*N]>| DEP[*I] :<DEP[*O]>#<BAD[*M]>|<BAD[*M]>:<BAD[*L]>#
+=========+=========+=========+=========+=========+=========+=========+
* * *
[*1] client logging not working
[*2] interlib logging not working
[*3] both client and interlib logging not working
[*A] boils down to [*1], unless QB_LOG_INIT_DATA used on client side,
which then fails on
"implicit callsite section is populated, otherwise target's build
is at fault, preventing reliable logging"
assertion
[*B] boils down to [*1], unless QB_LOG_INIT_DATA used on interlib side,
which then fails on
"implicit callsite section is populated, otherwise target's build
is at fault, preventing reliable logging"
assertion
[*C] boils down to [*3], unless QB_LOG_INIT_DATA used on interlib side,
which then fails on
"implicit callsite section is populated, otherwise target's build
is at fault, preventing reliable logging"
assertion
[*E] boils down to [*1], unless QB_LOG_INIT_DATA used on client side,
which then fails on
"implicit callsite section is self-observable, otherwise target's
and/or libqb's build is at fault, preventing reliable logging"
assertion
[*F] boils down to [*3], unless QB_LOG_INIT_DATA used on interlib side,
which then fails on
"libqb's callsite section is populated, otherwise libqb's build is
at fault, preventing reliable logging"
assertion
[*G] boils down to [*3], unless QB_LOG_INIT_DATA used on interlib side,
which then fails on
"implicit callsite section is self-observable, otherwise target's
and/or libqb's build is at fault, preventing reliable logging"
assertion
[*I] boils down to [*1], unless QB_LOG_INIT_DATA used on client side,
which makes it, likely through self-reference keepalive (see
below), work OK
[*J] boils down to [*2], unless QB_LOG_INIT_DATA used on interlib side,
which makes it, likely through self-reference keepalive (see
below), work OK
[*K] boils down to [*3]
in addition, syslog carries this notice:
"(libqb) log module hasn't observed target chain supplied callsite
section, target's and/or libqb's build is at fault, preventing
reliable logging (unless qb_log_init invoked in no-custom-logging
context unexpectedly, or target chain built purposefully without
these sections)"
logged by libqb proper
[*L] boils down to [*3], unless QB_LOG_INIT_DATA used on interlib side
(sufficient?), which makes it, likely through self-reference
keepalive (see below), boil down just to [*1];
in addition, syslog carries this notice:
"(libqb) log module hasn't observed target chain supplied callsite
section, target's and/or libqb's build is at fault, preventing
reliable logging (unless qb_log_init invoked in no-custom-logging
context unexpectedly, or target chain built purposefully without
these sections)"
logged by libqb proper
[*M] boils down to [*1];
in addition, syslog carries this notice:
"(libqb) log module hasn't observed target chain supplied callsite
section, target's and/or libqb's build is at fault, preventing
reliable logging (unless qb_log_init invoked in no-custom-logging
context unexpectedly, or target chain built purposefully without
these sections)"
logged by libqb proper
[*N] boils down to [*M], unless QB_LOG_INIT_DATA used on client side,
which makes it, likely through self-reference keepalive (see
below), work OK
[*O] boils down to [*K], unless QB_LOG_INIT_DATA used on both client
and interlib side, which makes it, likely through self-reference
keepalive (see below), work OK (it's expected that this a mere
composite of situations [*I] and [*J] with consequences as stated)
* * *
Note: the only problematic (i.e. not captured automatically by the
QB_LOG_INIT_DATA macro presumably utilized at every non-libqb logging
system participant in the form of a discrete compilation unit)
combination with 2.29 is the one intersecting at "BAD[*2]" pertaining
"everything but interlib compiled with ld.bfd < 2.29". It would, of
course, be solvable as well, but presumably not in an easy way, and
that use case should not be as frequent.
Takeway: whenever your target (library or client program) actively
utilizes logging (meaning it emits at least a single log message,
otherwise there's an imminent danger of possibly even run-terminating
false positive in the self-check mechanism!),
YOU ARE strongly ENCOURAGED TO USE QB_LOG_INIT_DATA macro function
at (exactly) one of the source code files (presumably the main one)
per respective target's compilation unit.
It will alleviate the hassles possibly caused by downgrading libqb
to the linker-vs-libqb incompatibly compiled one or in similar
circumstances arising merely from the linker behaviour change,
which the current build system/code shake is all about.
tests: add a script to generate callsite-heavy logging client...
...so as to evaluate use of resources. In particular, the intention
here is to uncover the observable differences between the same logging
code built with callsite section (default when available) and
purposefully (overriding that default by force) without it.
To allow for the latter being applied conveniently, new macro,
QB_KILL_ATTRIBUTE_SECTION, can be defined in the compile-time of the
client code that wishes to opt-out from the callsite section feature.
* * *
Following is a discussion on these differences, sticking with the
logging client code generated with the script defaults, i.e., as it
would be run with these switches:
--callsite-count=3640
--branching-factor=3
--callsites-per-fnc=10
--round-count=1000
and then built twice (as detailed in
tests/functional/log_external/Makefile.am):
* log_callsite_bench_sectionfull
- with callsite section
* log_callsite_bench_sectionless
- without callsite section, imposed with -DQB_KILL_ATTRIBUTE_SECTION
in CPPFLAGS
--> Static size of the executable:
$ size -B log_callsite_bench_section* | tr '\t' ' ' | tr -s ' ' \
| cut --complement -d' ' -f6 | column -t
> text data bss dec filename
> 82761 146180 4 228945 log_callsite_bench_sectionfull
> 190000 588 4 190592 log_callsite_bench_sectionless
We can see that sectionfull is few kB bigger in the object sections
of interest, though the text-data ratio changes considerably, with
code section being cut in half in comparison to sectionless, which
can actually help the code locality (and hence utilization
of CPU caches) in the former case.
--> Dynamic memory/heap operations:
$ valgrind --log-fd=1 ./log_callsite_bench_section{full,less} 2>/dev/null
total heap usage:
- log_callsite_bench_sectionfull:
> 88 allocs, 87 frees, 3,427 bytes allocated[*]
- log_callsite_bench_sectionless:
> 11,894 allocs, 11,893 frees, 486,035 bytes allocated[*]
[*] "32 bytes in 1 blocks still reachable" looks rather as a spurious
warning on the valgrind's side (matter of dynamic linking library)
Apparently, sectionless keeps stirring the heap constantly, with all
the possible downsides associated with that, like hitting the page
faults leading to less timely execution.
--> Run-time efficiency:
$ time ./log_callsite_bench_section{full,less} 2>/dev/null
mean attempts out of 3 consecutive runs:
- log_callsite_bench_sectionfull:
> real 0m1.298s
> user 0m0.965s
> sys 0m0.331s
- log_callsite_bench_sectionless:
> real 0m1.436s
> user 0m1.067s
> sys 0m0.365s
As expected, we can observe sectionfull is slightly faster/more
efficient.
* * *
Based on the above, we can conclude that leveraging the callsite
section for logging as facilitated by the toolchain intrinsics is
beneficial, especially for performance-critical applications (corosync
being the showcase here). Therefore it's desired to struggle for
retaining this nifty trick despite some troubles emerged with recent
binutils releases (starting with 2.29) and the changed behaviour we
relied on so far in respective ld.bfd linkers (as mentioned in
preceding commits). That motive is immediately followed -- well,
judging the impact fairly, actually outclassed -- with the intention
to preserve binary compatibility (incl. continuous library support for
callsite section offloading spread in the existing client space widely
for quite some years already) to the utmost extent possible.
tests: new sort of tests dubbed "functional", cover linker vs. logging
These are for quick manual sanity checking, assuming the target audience
-- maintainers -- are clear on the context of use and the purpose
(perhaps with the help of static files for comparison and/or additional
checking harness, usually available through "make check", but not to be
confused with regular unit + broader tests). These test are meant to be
compiled on demand only, not during the standard building routine, for
which a trick leveraging GNUmakefile-Makefile precedence with GNU make
was devised (GNU make/gmake already required by configure script for
other reasons [some pattern-based matching not available with FreeBSD's
default "make", IIRC], so this introduces no new build dependency).
The respective new tests are meant to simulate logging variants in two
different library consumption models:
a. regular: linking against system-wide library
b. developmental: consuming library from a local sub-checkout tree,
using libtool conventions and hence attaching the
library through libqb.la intermediate library
descriptor of libtool
and between up to three possibly affected logging system participants
(discrete compilation units):
1. libqb itself will emit log messages in boundary conditions or
for tracing purposes
2. client program that consumes libqb's logging API directly
3. ditto, but the client program furthermore links with a library
(referred to as "interlib") that itself exercises the logging
API (it's also linked with libqb) -- through induction, this
should cover whole class of N interlib cases
Especially the latter perspective makes for a test matrix to possibly
(hopefully) demonstrate a fix allowing to cope with the changed
behaviour of ld from binutils 2.29+ wrt. boundaries denoting symbols for
a (custom) orphan section that are no longer externally visible. Such
commit is in the pipeline...
Developmental consumption model (a.) is now also tested automatically
in Travis CI runs and as a part of %check within upstream-suggested
libqb.spec for RPM packaging, whereas the regular one (b.) serves as
a building block for new log_test_mock.sh runner of said test matrix
-- it iterates through all the possible permutations of linker-imposed
implicit visibility of mentioned symbols between various affected
link participants all making use of logging (see 1. - 3. above) so as
to demonstrate A/ the impact of the problem (see table below), and
subsequently B/ that the fix is effective in all these situations
(updated table will be provided as well) once it lands. This script
also allows convoluting the test matrix further, notably with on-demand
defusing the self-checks based on QB_LOG_INIT_DATA macro, which is
of significance as demonstrated below (and will become even more
important with upcoming patches in this series).
* * *
Current state for such matrix, in which participants 1. - 3. map like:
1. ~ libqb(Y)
2. ~ "direct"
3. ~ libX(Y) [a.k.a. interlib]
and where "X(Y)" denotes "X linked with linker Y":
X(a) .. ld.bfd < 2.29
X(b) .. ld.bfd = 2.29 (and only 2.29),
goes like this:
+=========+=========+=========+=========+=========+=========+=========+
#client(x)# libqb(a) usage # libqb(b) usage #
# vvv #---------+---------+---------+---------+---------+---------+
# V # direct | libX(a) : libX(b) # direct | libX(a) : libX(b) #
+=========+=========+=========+=========+=========+=========+=========+
# x = a # OK | OK : BAD[*2] # BAD[*1] | BAD[*D] : BAD[*3] #
# x = b # BAD[*A] | BAD[*B] : BAD[*C] # BAD[*1] | BAD[*C] : BAD[*3] #
+=========+=========+=========+=========+=========+=========+=========+
whereas if we swap 2.29 for 2.29.1, i.e., X(b) .. ld.bfd = 2.29.1, we
can observe a somewhat simpler story (DEP ~ "depends"):
+=========+=========+=========+=========+=========+=========+=========+
#client(x)# libqb(a) usage # libqb(b) usage #
# vvv #---------+---------+---------+---------+---------+---------+
# V # direct | libX(a) : libX(b) # direct | libX(a) : libX(b) #
+=========+=========+=========+=========+=========+=========+=========+
# x = a # OK | OK : DEP[*J] # BAD[*1] | BAD[*1] : BAD[*L] #
# x = b # DEP[*I] | DEP[*I] : DEP[*K] # BAD[*1] | BAD[*1] : BAD[*L] #
+=========+=========+=========+=========+=========+=========+=========+
* * *
[*1] client logging not working
[*2] interlib logging not working
[*3] both client and interlib logging not working
[*A] boils down to [*1], unless QB_LOG_INIT_DATA used on client side,
which fails on 'implicit callsite section is populated' assertion
[*B] boils down to [*1], unless QB_LOG_INIT_DATA used on interlib side,
which fails on 'implicit callsite section is populated' assertion
[*C] boils down to [*3], unless QB_LOG_INIT_DATA used on interlib side,
which fails on 'implicit callsite section is populated' assertion
[*D] boils down to [*3], unless QB_LOG_INIT_DATA used on interlib side,
which makes it boil down just to [*1] (hypothesis: mere internal
self-reference to the section's boundary symbols makes them
overcome some kind of symbol garbage collection at the linkage
stage, so they are exposed even they wouldn't be otherwise as
demonstrated with the initial, plain case of [*3])
[*I] boils down to [*1], unless QB_LOG_INIT_DATA used on client side,
which makes it, likely through self-reference keepalive (see
below) work OK
[*J] boils down to [*2], unless QB_LOG_INIT_DATA used on interlib side,
which makes it, likely through self-reference keepalive (see
below) work OK
[*K] boils down to [*3], unless QB_LOG_INIT_DATA used on both client
and interlib side, which makes it, likely through self-reference
keepalive (see below) work OK (it's expected that this a mere
composite of situations [*I] and [*J] with consequences as stated)
[*L] boils down to [*3], unless QB_LOG_INIT_DATA used on interlib side
(sufficient?), which makes it, likely through self-reference
keepalive (see below) boil down just to [*1]
* * *
Note: as observed with [*D] case (libqb linked with ld.bfd < 2.29
whereas interlib and its client linked with ld.bfd = 2.29), the exact
availability of a working logging doesn't depend solely on the linkers
in question, but generally (further investigation out of scope) the
conclusion is that when 2.29 ld.bfd is involved somewhere in the chain
of logging-related discrete compilation units, also (self-)referencing
of the section's boundary denoting symbols is a deciding factor whether
particular logging source will be honored. This may be a result of
some internal linkage garbage collection mechanisms involved.
Anyway, it is supposed that the fix to broken-by-linkage logging can be
proclaimed complete once all combinations pass barring QB_LOG_INIT_DATA
usage (incurring the mentioned active referential use of the symbols),
along with a spin using it everywhere for good measure.
For another level of the analysis depth, one can further play with
combinations of -n{sc,cl,il} options (explained upon -h switch) to
log_test_mock.sh (taking an oracle, this is added mostly to justify
the upcoming self-check test change because linker-script-based
workaround for newer linkers will cause the section boundary symbols
to be present regardless if that section is utilized, leading to
a self-inflicted breakage due to these empty section symbols suddenly
winning in the symbol resolution mechanism).
build: configure: check section boundary symbols present in the test
There was an idea to make apparently run-time test set to that effect,
but it would make cross-building harder. So arrange the test as if it
would be meant for AC_TRY_RUN, but achieve the same as with the first
assertion by the means of inspecting the linked result with, possibly
target-specific, nm utility.
While arranging the test for AC_TRY_RUN, based on feedback by Ferenc
Wágner, unify and increase usability of the run-time error signalling
through assertions.
Med: qblog.h: better explanation + behaviour of QB_LOG_INIT_DATA
Based on better understanding how link-time callsite collection works,
put a better description for the macro. Also based on poor user
experience in case that feature does not work well, say because
the linker deliberately changes the previously settled visibility
of the section boundary symbols (happened in ld from binutils-2.29,
fix is forthcoming), tweak the assertion message a bit, together
with an extension of the general intro to point that macro out.
Also play fair, include the <assert.h> header, which this macro
requires.
- use case:
/usr/sbin/pacemakerd --features
- before:
pacemakerd: utils.c:69: common:
Assertion `0' failed
- after:
pacemakerd: utils.c:69: common:
Assertion `"non-empty implicit callsite section" && QB_ATTR_SECTION_START != QB_ATTR_SECTION_STOP' failed.
Restructuring of the assertion inspired by the suggestion of Ferenc
Wágner (for the subsequent commit, actually).
And regarding:
> as a side effect, it can ensure the boundary-denoting symbols for
> the target collection area are kept alive with some otherwise unkind
> linkers
this was actually empirically discovered in one particular combination
with ld.bfd @ binutils 2.29, and extensively with 2.29.1 (placing here
a forward reference for the following commits that elaborate on the
libqb-target cross-combination matrix and the findings).
2017-11-15 Jan Pokorný <jpokorny@redhat.com>
maint: make -devel package dependency on the main package arch-qualified
Beside the fact that libqb.so file delivered with that package is indeed
referring to arch-preserving binary library (present in the same,
arch-specific path as the libqb.so happens to reside), it's also
a matter of being disciplined per what distros reasonably require:
https://fedoraproject.org/wiki/Packaging:Guidelines#Requiring_Base_Package
The syntactic provision at hand was introduced in rpm 4.6.0
(8+ years ago): http://rpm.org/user_doc/arch_dependencies.html
2017-10-20 wferi <wferi@debian.org>
configure: bail out early if POSIX threads support is not detected (#272)
2017-10-13 wferi <wferi@debian.org>
Fix spelling: optvat -> optval (#270)
2017-10-09 yann-morin-1998 <yann.morin.1998@free.fr>
configure: fix CLOCK_MONOTONIC check for cross-compilation (#269)
In cross-compilation, we can't run test programs, so configure just
bails out. Since there is no cache variable (e.g. ac_cv_blabla, we can't
even provide the correct result.
But in thise case, we don't really need to run to start with; we just
need to check if the toolchain headers know about CLOCK_MONOTONIC.
2017-09-18 Kazunori INOUE <inouekazu@intellilink.co.jp>
configure: define AS_VAR_COPY (#267)
2017-09-18 Christine Caulfield <ccaulfie@redhat.com>
tests: make qb logging under check always dispose the memory
examples/tests: make qb logging dispose the memory
A.k.a. "be a good example of using this very library".
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2017-08-24 Christine Caulfield <ccaulfie@redhat.com>
config: Fix check for fdatasync
2017-08-07 Jan Pokorný <jnpkrn@users.noreply.github.com>
log: use fdatasync instead of fsync where possible (#263)
Using years-old benchmark attached to PostreSQL ML[1], I've observed
tiny bit more than double boost in speed when using fdatasync instead of
traditional fsync, on two Linux machines, each equipped with an SSD.
While the observation may be disputable (there are various
interpretations to what "synchronized I/O" actually means), by logical
extension of what the two are supposed to do, one can expect fdatasync
will perform no worse than fsync. Having the timestamps correct is
really not a priority, compared to timely processing of the message
stream. So let's use it whenever possible with QB_LOG_CONF_FILE_SYNC
requested.
As an aside, PostreSQL seems to be be using "fdatasync" method of
updating out to disk by default on Linux till today[2].
[1] https://www.postgresql.org/message-id/1095055866.414539fadb90d@webmail.rawbw.com
https://www.postgresql.org/message-id/attachment/20659/syncbench.c
[2] https://www.postgresql.org/docs/current/static/runtime-config-wal.html#GUC-WAL-SYNC-METHOD
Typo fix + qb blackbox(8) tweaks and extension + gitignore follow-up (#262)
* Fix typo: occur{ -> r}(ed|ing)
* doc: qb-blackbox(8): cosmetic touches
* doc: qb-blackbox(8): add "Portability notes" subsection
* Low: build: git-ignore build-aux/release.mk "overhead" files
This should have been part of ae5138d.
* build: release.mk: ensure checksum file generated even w/o signing
This should have been part of d20e48a.
Low hanging bits (#264)
* Low: log: prevent static vs. implicit non-static declaration clash
...of qb_log_callsites_dump_sect, that could happen when its usage
in qb_log_callsites_register was uncommented.
* Low: tests: fix duplicate "const" declaration specifier
This is a follow-up for d69cc7b (making the pointer itself constant was
meant as a self-defense, no-overwrite measure).
2017-07-20 Jan Pokorný <jnpkrn@users.noreply.github.com>
Doc tweaking (#261)
* Fix typo: p{rr -> r}ocess
* doc: qbrb.h: several fixes to punctuation
* doc: qbrb.h: reindent example writer's error label as per reader
* doc: qbhdb.h: explain former importance to libqb itself
* doc: ipcc.c: explain why client would timebox recv from server
Also refer to commit d633b4e.
* doc: qblog.h: minor stylistic/doxygen markup cosmetics
* doc: qblog.h: note qb_log_format_set vs. fork interaction wrt. PIDs
2017-06-13 Jan Pokorný <jpokorny@redhat.com>
build: release.mk: reflect current release publishing practice
In the previous maintenance epoch, libqb release files used to be
published at fedorahosted.org[1], but since the sunset of that
hosting[2] (original files now preserved[3] at [4]), only GitHub is
used to host the releases. In fact, there was a short overlap period
(comprising just v0.17.2 tag; beware, prior archives are just autoserved
directly from the tree at that particular tag), until Chrissie decided
there's no point to handle both[5] (providentially, long before that
sunset of the former).
Unfortunately, publish-by-scp convenience of fedorahosted.org won't fly
with GitHub that insists on the (primarily REST) API to get things
automated, so update "publish" recipe to that effect, providing some
hints on possible adaption of the process.
Also, turn "git push --tags" to a bit safer "git push --follow-tags"
for good measure.
[1] https://fedorahosted.org/releases/q/u/quarterback/ (now defunct)
[2] https://lists.fedoraproject.org/archives/list/announce@lists.fedoraproject.org/message/BWSMCGZPPNG3JOCFQ6Z74MIBU7FG3KGB/
[3] http://oss.clusterlabs.org/pipermail/developers/2017-February/000438.html
[4] http://releases.pagure.org/ClusterLabs/libqb/
[5] http://oss.clusterlabs.org/pipermail/developers/2016-April/000198.html
build: release.mk: simplify the default goal, declare .PHONY targets
The default goal line now serves mainly the documentation purpose,
otherwise it could be squashed down to "sign" target.
build: release.mk: move soft guard for no GPG key up the supply chain
It also means the missing key specification is now a hard error when
ASCII armored files are to be created (directly or by other rules).
Leveraging the previous commit, it is now unnecessary to guard against
release mode not being requested, so this guard is dropped completely
in the transition, allowing for the full-fledged (incl. GPG signing)
release delivery testing without mangling with in-tree tags.
To allow "sign" target to (possibly eventually) become the implicit goal
even if "gpgsignkey" variable is explicitly unspecified, make it depend
on "tarballs".
build: release.mk: fix no-release conflict (implied-required version)
Previously, generating custom versioned tarballs without requiring
a "release" (which comprises also tagging hence in turn making the
implied version match the required one as desired) would not allow
to test the release routines thoroughly incl. GPG signing.
Unfortunately, allowing for a temporary tag is prone to accidentally
slipping it to the distributed tree, so that should rather be avoided.
Now it can.
Another step to blur the boundaries between whether "release" is
specified or not is make checksums file generated unconditionally.
build: release.mk: simplify/generalize GPG signing rule
Pattern matching is a brilliant DRY technique in makefile's composition,
so it would be a pity to miss such a nonconflicting application related
to the previous, "sign tarballs" commit.
For that to work reliably for the complete dependency backtrack, though,
a pre-existing issue with parallelized work on the prerequisites needs
to be fixed first. The problem was "tarballs" (phony) target missing
in the linearized supply chain for the signed tarballs, as opposed to
to supply chain for the checksums file that can be worked on in an
(unordered!) interleave with the work on these signed tarballs.
Hence fix this race condition by stretching "tarballs" target as
progress barrier (using it as a prerequisite) uniformly for all the
deliverables that are going to be signed (used to be just for "sha256"
target)). And when at it, make "deliverables" variable list them
conveniently (along with reformatting definitions of other variables
for uniformity).
2017-06-08 Christine Caulfield <ccaulfie@redhat.com>
sign tarballs
2017-06-08 Jan Pokorný <jpokorny@redhat.com>
Fix typo: repeat{ivi -> ed}ly
2017-06-06 Jan Pokorný <jpokorny@redhat.com>
Low: loop: don't bring runtime down for a trivial API misuse
Fix typos: in{ -> s}tance, d{e -> i}stinguished
The instances of the former in a private static variable name, the
latter in the comment to an internal-use-only function-like construct.
2017-06-06 Michael Jones <jonesmz@jonesmz.com>
Adds no-format-nonliteral
Adds additional warnings
2017-05-26 jonesmz <jonesmz@users.noreply.github.com>
Point the link to the Linux kernel coding style document to the right place (#256)
2017-05-23 Christine Caulfield <ccaulfie@redhat.com>
test: Disable test_max_dgram_size() test as it often breaks on CI
tests: Fix signal handling in check_ipc.c
Also return pid_t from run_ipc_server()
2017-05-19 Christine Caulfield <ccaulfie@redhat.com>
lib: update library version for upcoming 1.0.2 release
2017-05-19 Jan Pokorný <jpokorny@redhat.com>
build: follow-up on introducing custom m4 macros
Various "configure" commits by wferi recently introduced new
compat/custom m4 macro files in m4 directory, which itself was,
so far, assumed ephemeral (not strictly needed for reproducing
the build successfully, i.e., bits that can be completely purged
when cutting down the project files to the bone). Apparently,
this assumption no longer holds so several places need to be
adapted.
Amonst others, m4 directory no longer needs to be reinsured in
autogen.sh, and special care must be taken with .gitignore
and maintainer-clean-local target of the main Makafile.
2017-05-18 Chrissie Caulfield <ccaulfie@redhat.com>
ipc: fix compile warning on non-Linux platforms (#252)
2017-05-18 jonesmz <jonesmz@users.noreply.github.com>
Require c99 language support or newer (#251)
2017-05-18 Jan Pokorný <jnpkrn@users.noreply.github.com>
Memleak fixes (#194)
* memleak: ipc_socket: properly dispose local-scoped strndup values
Leaking memory was only possible when using filesystem sockets (see
use_filesystem_sockets function) and either:
- client is deliberately disconnecting from a server (continued run
imposes a risk of exhausting memory)
- server is deliberately disconnecting from its client (ditto, but
more substantial risk due to the common shared-resource nature
of the server)
* memleak: ipc_socket: properly dispose inter-function strdup values
Leaking memory was only possible when the server accepted the client,
but didn't get (or was too shy) to talk to it prior to proceeding with
a disconnect.
* ipc_socket: care to explain what's going on with file name inference
Related to the code parts at hand, there was an investigation/fix in
the past, initiated by "make check" failure on FreeBSD 9 [rhbz#1256701].
Unfortunately, not only the magic constant being modified was not
explained in 1908e6c, but (one can derive because of a lack of solid
background of what's going on here, which might have caused that),
it was modified incorrectly at one instance (see also [PR165 comment]),
which was then reinstated in 7ebcb3d.
So, finally de-mystify those magic constants. Also break the symmetry
between the client/server further with depending on the canonical
"request socket" alias at the server side (the former worked equally but
it was unnecessarily confusing and there's a risk this artificial alias
will get removed in the future).
[rhbz#1256701] https://bugzilla.redhat.com/1256701
[PR165 comment] https://github.com/ClusterLabs/libqb/issues/165#issuecomment-142949541
2017-05-02 Christine Caulfield <ccaulfie@redhat.com>
doc: Clarify IPC caution text
It was not clear to non-native English speakers.
Reviewed by: Jan Pokorný <jpokorny@redhat.com>
2017-04-28 Chrissie Caulfield <ccaulfie@redhat.com>
Allow Linux to use filesystem sockets (#248)
* IPC: Allow filesystem sockets to be chosen at run-time on Linux
Most of this patch came from Andrew Beekhof.
Keep a global variable that decides whether or not to use filesystem sockets
or abstract sockets for IPC connections. This variable is set by the presence of a file (default /etc/libqb/force-filesystem-sockets).
* tests: Fix test_ipcc_truncate_when_unlink_fails_shm test using FS sockets
When using filesystem sockets, the
test_ipcc_truncate_when_unlink_fails_shm test always fails, this was
because the unlink() call is wrapped to fail and so it never cleans up
the old version of the socket.
The fix is to preemptively remove the file before unlink gets wrapped.
* doc: Explain the force-filesystem-sockets option
Merge pull request #250 from jnpkrn/test-ipc-random-name
test: Fix random number generation in IPC tests
2017-04-28 Jan Pokorný <jpokorny@redhat.com>
test: Fix random number generation in IPC tests
The sockets are named using a random() suffix in at attempt to isolate
concurrent test. However random() always returns the same random number
by design ... unless pre-seeded with some value being unique enough for
the particular execution.
Borrowing the most of the above message from original "srandom" fix by
Chrissie who also discovered this issue (nice!), I thought it would be
more viable if we encoded such "unique enough" variables directly to
IPC name being generated, not relying on pseudorandom generators in any
way. Hence this other fix.
2017-04-05 Christine Caulfield <ccaulfie@redhat.com>
doc: Remove unclear part of the clarification on IPC threading.
2017-03-24 Christine Caulfield <ccaulfie@redhat.com>
doc: clarify thread-safety (or not) in IPC doc
2017-03-06 Christine Caulfield <ccaulfie@redhat.com>
loop: Fix splint error
2017-02-24 Christine Caulfield <ccaulfie@redhat.com>
loop: Also set signals changed in qb_loop_signal_mod() back to SIG_DFL
loop: don't override external signal handlers
qb_loop_signal_add() used to set any signals it wasn't managing
back to SIG_DFL. This is unfriendly behaviour in a library.
Reviewed-by: Jan Pokorný <jpokorny@redhat.com>
2017-01-31 Christine Caulfield <ccaulfie@redhat.com>
[tests] Fix qb_rb_chunk_peek test so it's consistent with qb_rb_read
Now that the library code is too.
[ringbuffer] Return error from peek if RB is corrupted.
This should prevent libqb from looping in the server if the
ringbuffer gets corrupted. Instead the client will be disconnected.
2016-12-16 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #242 from jnpkrn/travis-issue-234
CI: travis: fix du -> df and capture it also directly from test
2016-12-16 Jan Pokorný <jpokorny@redhat.com>
build: tito: unify custom.py with pacemaker's version
CI: travis: fix du -> df and capture it also directly from test
2016-12-16 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #241 from jnpkrn/PR240-addendum
PR #240 + addendum (drop syslog-tests opt-in switch)
2016-12-12 Jan Pokorný <jpokorny@redhat.com>
build: drop allegedly no longer intrusive syslog-tests opt-in switch
The intention behind enabling the syslog tests on demand (642f74d) was
to tread cautiously as libtool used to alert that something controversial
is going on:
$ ./autogen.sh && ./configure --enable-syslog-tests && make check
> ...
> *** Warning: Linking the executable log.test against the loadable module
> *** _syslog_override.so is not portable!
> ...
owing to the fact that _syslog_override.so is being linked (through
libtool) with LDFLAGS=-module.
In fact, the issue did go away with a fix to the "make install" process
(ebcff54) for which _syslog_override.so* files were being picked
undesirably prior to the fix, which manifested itself also on
"make rpm" (hence the respective commit message):
> RPM build errors:
> Installed (but unpackaged) file(s) found:
> /usr/lib64/_syslog_override.so
> /usr/lib64/_syslog_override.so.0
> /usr/lib64/_syslog_override.so.0.0.0
The explanation for the secondary positive effect on the mentioned
libtool's warning going away is rather simple:
"lib" prefix switches the expectations about the result as a library
(also due to "libdir" destination) rather than as an executable object.
Change like that ensures the result is what libtool's manual calls
"dynamic module that can be opened by lt_dlopen" rather than "runtime
library that cannot" in the context of Mac OS X, which was likely the
cause of the portability warning.
(https://www.gnu.org/software/libtool/manual/libtool.html#FOOT10)
And because the tests themselves are run through the libtool wrapper
scripts capable of relinking and other magic
What libtool manual has to say on this topic:
> Note that libtool modules dont need to have a "lib" prefix. However,
> Automake 1.4 or higher is required to build such modules.
referring to version released 15+ years back, which is assumed anyway.
(https://www.gnu.org/software/libtool/manual/libtool.html#Modules-for-libltdl)
* * *
That being said, there's now no longer a reason to have "syslog-tests"
enablement conditionalized (no longer supposed intrusive), hence enable
them unconditionally along the other libcheck-based tests
-- whenever libcheck is detected.
This changeset also drops any trace of --enable-syslog-tests switch
in various places using that (spec file, Travis CI configuration)
making for a complete vaporizatio of this choice.
2016-12-12 Ferenc Wágner <wferi@debian.org>
configure: restrict nsl lib to where it's actually needed
configure: restrict socket lib to where it's actually needed
configure: restrict pthreads to where it's actually needed
mq_open() is no longer relevant beyond 70a9623 (Remove message queues).
2016-12-08 Ferenc Wágner <wferi@debian.org>
configure: restrict -ldl to where it's actually needed
This reduces overlinking of qb-blackbox. Being a seldom used executable,
the gains are mostly theoretical, but at least this silences warnings
from some QA tools.
configure: LTLIBOBJS is also a Make variable
So let's use the more friendly syntax.
configure: help string cleanup
The [ default="no" ] branches were sense- and (mostly) harmless.
Fix typos: synchonization -> synchronization, paramaters -> parameters
2016-11-29 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #238 from jnpkrn/travis-issue-234
Continue with investigation of intermittent failures in Travis CI (#234)
2016-11-28 Jan Pokorný <jpokorny@redhat.com>
tests: better diagnose test_max_dgram_size test failures
CI: travis: fix dh -> du + add "lsblk -f" diagnostics
2016-11-24 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #235 from jnpkrn/travis-issue-234
CI: make travis watch for the issue #234
2016-11-24 Jan Pokorný <jpokorny@redhat.com>
CI: make travis watch for the issue #234
2016-11-24 Christine Caulfield <ccaulfie@redhat.com>
version: Update version for 1.0.1 release
2016-11-24 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #233 from jnpkrn/copr-tito
build: git -> automatic COPR builds integration followup
2016-11-23 Jan Pokorný <jpokorny@redhat.com>
build: tito: minor adjustments
2016-11-22 Jan Pokorný <jpokorny@redhat.com>
doc: README: add a status badge+link for the COPR builds
2016-11-22 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #232 from jnpkrn/copr-tito
build: allow for git -> automatic COPR builds integration
2016-11-18 Jan Pokorný <jpokorny@redhat.com>
build: allow for git -> automatic COPR builds integration
New tito-related files makes the repository compatible with tito method
of building in COPR (https://fedorahosted.org/copr/wiki/UserDocs#Tito).
build: ensure debug make flags are not derived when unsuitable
Unfortunately, debug messages of GNU make are emitted to stdout, which
spoils the extracted output we rely on. So prevent it (as well as
any other extraneous option) by force.
(discovered during git -> automatic COPR builds integration)
build: ensure check_SCRIPTS are distributed
(discovered during git -> automatic COPR builds integration)
2016-11-08 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #231 from jnpkrn/unlink-or-truncate
Unlink or truncate (as a fallback) files when shm IPC client terminates connection forcibly
2016-11-04 Jan Pokorný <jpokorny@redhat.com>
tests: start stdlib failures injection effort with unlink{,at} + test
There are not many ways to test alternate code paths having failure of
some function from standard library as a precondition.
For a starter, we need to test failing unlink{,at} functions in a
controlled manner to mimic client and server path of the IPC connection
having different privileges to validate the previous commit. But the
test suite cannot assume it has root privileges (so as to add artificial
user system-wide, which is a pretty stupid idea on its own), cannot
generally use stuff like chroot/namespacing (not to speak about
synergies of the former like docker). So what's left is to make our
own playground, or better yet, use existing playground but just to
modify the rules of the game a bit when it's desired -- a variation
of old good LD_PRELOAD trick.
Note that this concept was already used in syslog tests (see commit
642f74d) and is now further extended using dlsym(RTLD_NEXT, "symbol")
to resolve the standard library symbol being shadowed by our little
"module". This hence yields a customized wrapping we use to either
inject a call failure or to increase an invocation counter so as to
assure something has indeed been called. As the mechanisms used are
not supposed to be available everywhere, the build system is
conditionalized respectively.
Back to our test when unlink{,at} fails, with the help of the described
mechanism, it was actually easy to massage test_ipc_server_fail_shm
into test_ipcc_truncate_when_unlink_fails_shm desired addition, which
is also featured in this commit, together with a modification to
resources.test script so that it expects particular number of empty
file leftovers (see previous commit).
It's expected that the module for failure injections will keep growing
so as to enable better overall coverage of the code (on the platforms
where this provision is available).
Med: rb: use new qb_rb_close_helper able to resort to file truncating
This changeset builds on previous 2-3 commits and represents the main
libqb's answer to the original question behind pacemaker's security
defect known as CVE-2016-7035.
Beside the helper partly unifying handling of qb_rb_force_close and
qb_rb_close, it provides the former with ability to use file truncating
as a fallback for when unlinking fails, e.g., because client (note that
mentioned is currently only relevant for the client side as normally
server is responsible for the lifecycle of the materialized files,
unless it crashes and only client is left to do its best) is not the
owner while they are placed at a directory with restricted deletion,
which enforces this very ownership condition.
In practice, this means that, at worst, just the zero-size files are
left behind, so not that much space exhaustion (usually "ramdisk"
like tmpfs is what backs default storage directory /dev/shm, so it
boils down to physical memory exhaustion, even if it can be just
for page cache and related overhead) can happen even on repeated
crashes as the memory mappings are cleared as much as possible.
Also openat/unlinkat functions (sported in qb_sys_unlink_or_truncate_at
as of the previous commit) are, when applicable, used so as to limit
possible race conditions between/during individual path traversals
(both files being got rid of presumably share the same directory).
Few words on which actions are attempted in which order for the
equivalent of qb_rb_force_close now:
There are subtle interactions between what's externally visible
(files) and what's not (memory mappings associated with such files),
and perhaps between memory pages management from the perspective of
the former (usually "ramdisk"/tmpfs) and the latter (mmap + munmap).
If the associated file is no longer publicly exposed by the means of
unlink (even if the object survives internally as refcounting is in
the game, with mmap holding a reference), memory mapping is not
affected. On the other hand, if it's just limited by truncation
to zero size, memory mapping is aware and generates SIGBUS in response
to accessing respective addresses. Similarly, accessing munmap'd
(no refcounting here) memory generates SIGSEGV. For delicacy,
the inputs for all of unlink, truncate, and munmap are stored
at the mmap'd location we are about to drop, but that's just a matter
of making copies ahead of time.
At Ken's suggestion, the scheme is: (unlink or truncate) then munmap,
which has a benefit that externally visible (and program's life span
otherwise surviving!) part is eliminated first, with memory mappings
(disposed at program termination automatically at latest) to follow.
(There was originally a paranoid expectation on my side that truncate
on tmpfs actually does silent munmap, so that our munmap could in fact
tear down the mapping added in the interim by the libraries, signal
handler or due to requirements of another thread, also because of
munmap on the range without any current mappings will not fail, and
thus there's likely no portable way to non-intrusively check the
status, but also due to documented SIGBUS vs. SIGSEGV differences
the whole assumption appears bogus on the second thought.)
Relevant unit tests that exercise client-side unlinking:
- check_ipc: test_ipc_server_fail_shm, test_ipc_exit_shm
- new test in a subsequent commit
Low: unix: new qb_sys_unlink_or_truncate{,_at} helpers
These are intended for subsequent qb_rb_{force_,}close refactorization
and utilization of this new truncate as a fallback after unlink failure
as detailed in the commit to follow.
For newer POSIX revision compliant systems, there's "at" variant using
openat/unlinkat functions so that paths do not have to be traversed
in full anew when not needed (as both unlink and truncate operate on
the same path).
Med: rb: make it more robust against trivial IPC API misuses
...using a new private inline helper that is intended to "decorate"
argument (plus extra reference level added) to qb_rb_{force_,}close().
It is purposefully not hardwired to neither qb_rb_close (it's a public
API function that should not change its semantics) nor qb_rb_force_close
(just for symmetry, preempting issues when the two would differ, and
also makes them more mutually compatible, which is already expected
at qb_ipcc_shm_disconnect).
It sets the original ringbuffer pointer to NULL (having the immediate
impact on other threads/asynchronous handling) and also sets the
(currently underused) reference counter set to exacly 1 (that is
subsequently going to be decremented in qb_rb_close so that it's
sound in the current arrangement).
More in the comment at the helper.
Suitable places are also made to use it right away.
Refactor: ipc_shm: better grip on ringbuffers to close
Also remove unused comment-introduced section of code.
2016-10-21 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #230 from jnpkrn/log_thread
Med: log_thread: logt_wthread_lock is vital for logging thread
Merge pull request #228 from jnpkrn/maint
Various cleanups (symbol imports, typos, doc)
2016-10-21 Jan Pokorný <jpokorny@redhat.com>
Refactor: log_thread: fix and diminish inferior comments
Med: log_thread: logt_wthread_lock is vital for logging thread
This fixes issue with would-fail-if-applied-to-thread-right-away
qb_log_thread_priority_set invocation when logging thread doesn't
exist yet, which will arrange for calling itself at the time of
thread's birth that is the moment it will actually fail.
In this + lock-could-not-have-been-initialized corner cases, the
already running thread would proceed as allowed by error condition
handling in the main thread, trying to dereference uninitialized
(or outdated) pointer to the lock at hand, resulting in segfault.
Also include the test that would have been caught that (we use the
fact that it doesn't matter whether setting of the scheduler parameters
fails due to bad input or just because of lack of privileges as it's
the failure at the right moment that is of our interest).
See also:
https://github.com/ClusterLabs/libqb/issues/229
2016-10-20 Christine Caulfield <ccaulfie@redhat.com>
tests: Unit test for previous zero tag patch
log: Remove check for HAVE_SCHED_GET_PRIORITY_MAX
it doesn't exist
2016-10-18 Jan Pokorný <jpokorny@redhat.com>
tests: SIGSTOP cannot be caught, blocked, or ignored
...per signal(7), so it is foolish trying to do so.
2016-10-18 Christine Caulfield <ccaulfie@redhat.com>
log: Don't overwrite valid tags
If a tag of 0 is passed into the logger and an existing callsite
is found with a non-zero tag, the don't overwrite the existing tag.
2016-10-17 Jan Pokorný <jpokorny@redhat.com>
Low: ipc_shm: fix superfluous NULL check
That's what qb_rb_chunk_reclaim does since commit
ef7739873842a3e7933ef610b9b61e0f4a7d2fde that made this
check redundant.
doc: elaborate more on thread safety as it's not so pure
Low: further sanitize qbipc[cs].h public headers wrt. includes
Low: sanitize import of <poll.h> symbols
Low: sanitize import of <qb/qbarray.h> symbols
2016-10-12 Jan Pokorný <jpokorny@redhat.com>
Fix typos: availabi{l -> li}ty, explici{lt -> tl}y
2016-10-11 Christine Caulfield <ccaulfie@redhat.com>
Merge branch 'jnpkrn-Svante-Signell-Hurd'
Merge branch 'Svante-Signell-Hurd' of https://github.com/jnpkrn/libqb into jnpkrn-Svante-Signell-Hurd
2016-10-11 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #226 from jnpkrn/maint
Maint: fix typos + resources.test
2016-10-07 Jan Pokorný <jpokorny@redhat.com>
tests: resources: check for proper names of leftover processes
Unfortunately, the change in test names introduced with commit e990681
hadn't been reflected (until now).
Also reformat shell syntax per more usual convention.
Fix typos: differ{ne -> en}t, is -> if
2016-10-04 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #224 from jnpkrn/maint
Maint: typo + unused functions checked in configure
2016-09-30 Jan Pokorný <jpokorny@redhat.com>
Fix typo: asyncronous -> asynchronous
Build: configure: do not check for unused "sched" functions
Do not compile-time-conditionalize based on one of them being available,
either.
2016-09-23 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #223 from jnpkrn/maint
maint: qb-blackbox man page should accompany the binary
2016-09-22 Jan Pokorný <jpokorny@redhat.com>
maint: qb-blackbox man page should accompany the binary
2016-08-01 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #218 from wferi/apropos
docs: qbdefs.h: description must directly follow @file
2016-07-31 Ferenc Wágner <wferi@niif.hu>
docs: qbdefs.h: description must directly follow @file
If we want to see it again in the man page NAME section, where it can
be indexed by apropos or whatis.
2016-06-30 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #221 from jnpkrn/typo-qblog.h
Fix typo: qblog.h: q{g -> b}_log_filter_ctl
2016-06-29 Jan Pokorný <jpokorny@redhat.com>
Fix typo: qblog.h: q{g -> b}_log_filter_ctl
2016-06-20 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #217 from jnpkrn/log-serialize-check-char-properly
Low: log: check for appropriate space when serializing a char
2016-06-20 Christine Caulfield <ccaulfie@redhat.com>
log: Add missing z,j, & t types to the logger
Reviewed-by: Ken Gaillot <kgaillot@redhat.com>
Reviewed-by: Jan Pokorný <jpokorny@redhat.com>
2016-06-17 Jan Pokorný <jpokorny@redhat.com>
Low: log: check for appropriate space when serializing a char
... where appropriate space is measured for, surprisingly, a char,
not for an int. Note that's also the actual type used for both
de-/serializing, so there's no conflict.
Also bother to explain why, now surprisingly for real, an unsigned int
is scraped out from va_list (akin to to STDARG(3)).
2016-06-06 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #213 from liu4480/master
low:fixed:Spelling error of failure in qbhdb.h
2016-06-06 bin.liu <bliu@suse.com>
low:fixed:Spelling error of failure in qbhdb.h
There are spelling error in include/qb/qbhdb.h, "failure" is
wroten as "faliure"
2016-05-06 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #211 from jnpkrn/CI-travis-clang
CI: make travis use also clang compiler (for good measure)
2016-05-05 Jan Pokorný <jpokorny@redhat.com>
CI: make travis use also clang compiler (for good measure)
Also, unify the indentation.
tests: make clang-friendly (avoid using run-time VLAs)
This is to also get libqb from the Debian's shame list:
http://clang.debian.net/status.php?version=3.4.2&key=VARIABLE_LENGTH_ARRAY
2016-04-29 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #210 from jnpkrn/tests-ensure-failure-output
tests: ensure verbose output on failure w/ more recent automake
2016-04-28 Jan Pokorný <jpokorny@redhat.com>
tests: ensure verbose output on failure w/ more recent automake
...so as to obtain a first glance diagnostics in all cases with possibly
remote build system preventing other means of investigation.
2016-04-19 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #209 from jnpkrn/header-based-versioning-PATCH-to-MICRO
API: header-based versioning: s/PATCH/MICRO
2016-04-18 Jan Pokorný <jpokorny@redhat.com>
API: header-based versioning: s/PATCH/MICRO
Under the influence of libxml2 and considering that actual "patch"
information in fact, if significant, ends up encoded in QB_VER_REST,
shift away from convention codified, e.g., by semver.org (not adored
by libqb, anyway) and rename designated PATCH component of the version
to MICRO accordingly.
Note that at this point, after a release without any header-based
versioning present and just a few commits after it was tentatively
introduced, it's a painless change. Once this PATCH nomenclature
is leaked into a full release, there's no way to get rid of it
reasonably...
2016-04-07 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #208 from jnpkrn/update-git-version-gen
build: use latest git-version-gen from gnulib (rev. 6118065)
Merge pull request #207 from jnpkrn/alternative-header-based-versioning
API: introduce alternative, header-based versioning
2016-04-04 Jan Pokorný <jpokorny@redhat.com>
build: persuade git-version-gen vMAJOR.MINOR tags just miss .0
Recent "v1.0" discovered this discrepancy propagated all around
and also this is not very compatible with the logic of commit 26d3911.
Treat missing "patch" component of the version as an implicit zero
to make such oddity go away.
Adjust spec file generation accordingly.
build: use latest git-version-gen from gnulib (rev. 6118065)
Preserve, however, the modification by David Vossel to keep the script
working as expected also with lightweight tags (e.g., v1.0rc3).
2016-04-01 Jan Pokorný <jpokorny@redhat.com>
API: introduce alternative, header-based versioning
Mainly as a light-weight alternative to full-blown autoconf/pkg-config
machineries, whereby one can:
* workaround functionality not present in libqb up to 1.0 (inclusive)
- note that this versioning schema is being introduced *after*
1.0.0 release so one cannot tell that version from any older,
but will be able to safely identify any later one (1.0.1+)
and act accordingly
- example:
#if !defined(QB_VER_MAJOR) || ((QB_VER_MAJOR == 1) && (QB_VER_MINOR < 1))
#warning "Feature X not supported"
int do_foo(int arg) { };
#else
int
do_foo(int arg)
{
/* use feature X of libqb */
}
#endif
* make its program report libqb API version it was built with by
emitting QB_VER_STR symbolic string (see tests/print_ver.c for example)
Also added is a print_ver test program to:
* emit how original unparsed version is parsed to particular components
defined in qbconfig.h (QB_VER_{MAJOR,MINOR,PATCH} symbolic integer
constants and QB_VER_REST symbolic string) when being compiled
* emit mentioned QB_VER_STR symbolic string joining the components
back to a single string, plus the components themselves
Resolves: https://github.com/ClusterLabs/libqb/issues/186
2016-04-01 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #196 from jnpkrn/demystify-qblog.h
Low: explain mysterious lines in a public header (qblog.h)
Merge pull request #191 from jnpkrn/refactor-test-case-defs
tests: refactor test case defs using versatile add_tcase macro
2016-03-18 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #205 from jnpkrn/docs-fix-make-doxygen
docs: fix "make doxygen" target not generating anything
2016-03-17 Jan Pokorný <jpokorny@redhat.com>
docs: fix "make doxygen" target not generating anything
2016-03-17 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #201 from jnpkrn/splint-better-support
build: better support for splint checker
2016-03-17 Jan Pokorný <jpokorny@redhat.com>
build: make splint check tolerant of existing defects
build: make the code splint-friendly where not already
build: add flags for splint: +showscan +showsummary
2016-03-17 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #204 from jnpkrn/docs-CURRENT-link
docs: make README.markdown always point to "CURRENT" docs
2016-03-17 Jan Pokorný <jpokorny@redhat.com>
build: reorder LINT_FLAGS in a more logical way
docs: make README.markdown always point to "CURRENT" docs
2016-03-17 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #203 from jnpkrn/docs-refactor-doxygen
Docs: refactor doxygen configuration files
2016-03-17 Svante Signell <svante.signell@gmail.com>
Add Hurd support
* configure.ac: Define QB_GNU.
Add a check for a working clock_getres for the CLOCK_MONOTONIC
option defining HAVE_CLOCK_GETRES_MONOTONIC.
* lib/log_thread.c: Replace second argument of
qb_log_thread_priority_set(): logt_sched_param.sched_priority by 0
when not supported by the OS.
* lib/util.c: Use the CLOCK_REALTIME option in clock_getres() if
HAVE_CLOCK_GETRES_MONOTONIC os not defined.
2016-03-17 Jan Pokorný <jpokorny@redhat.com>
docs: *.dox.in: comment out the defaults/empty values
This should also silent most of the warning when using older doxygen
to compile the docs.
docs: common.dox: use symbolic PROJECT_NAME
docs: {html,man}.dox.in: extract common parts to common.dox
docs: {html,man}.dox.in: unify where reasonable
docs: {html,man}.dox.in: strip options for unused outputs
docs: apply "doxygen -u" on {html,man}.dox.in, fix deprecations
Previously, "make" in the top-level dir resulted in:
> doxygen man.dox
> warning: Tag `XML_SCHEMA' at line 1787 of file `man.dox' has become
> obsolete.
> To avoid this warning please remove this line from your
> configuration file or upgrade it using "doxygen -u"
> warning: Tag `XML_DTD' at line 1793 of file `man.dox' has become
> obsolete.
Reference doxygen version: doxygen-1.8.10-6.fc22.x86_64.
This is to serve as a reference full-blown versions only to be
subsequently compacted...
docs: enhance qb_log_ctl* description + fix doxygen warning
2016-03-17 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #200 from jnpkrn/reenable-out-of-tree-build
build: fix out-of-tree build broken with 0b04ed5 (#184)
Merge pull request #202 from jnpkrn/CI-drop-redundant-check
CI: "make check" already included in "make distcheck"
2016-03-14 Jan Pokorný <jpokorny@redhat.com>
CI: "make check" already included in "make distcheck"
No need to waste time on redundant tests execution.
2016-03-11 Jan Pokorný <jpokorny@redhat.com>
build: tests: add intermediate check-headers target
This is to allow running auto_header_check-based tests independently of
the rest of the (possibly lengthy) tests.
build: fix preposterous usage of $(AM_V_GEN)
2016-03-10 Jan Pokorný <jpokorny@redhat.com>
build: include: fix extra trailing newline
build: tests: grab "public_headers" akin to docs precedent
This required moving the test programs over from *_PROGRAMS and hooking
the respective build recipe under explicit "check" target.
build: docs: {dependent -> public}_headers + more robust obtaining
build: extra clean-local rule instead of overriding clean-generic
Previously, stuffing CLEANFILES with anything would not work in the
affected files.
build: drop extra qbconfig.h rule for auto_check_header self-test
Although this is not as rigorously correct as the previous arrangement
(introduced with 80834ea), i.e., from the perspective of
$(abs_top_builddir)/tests/Makefile (generated from from
$(top_srcdir)/tests/Makefile.am), for which $(top_builddir)
is literally "..":
- qbconfig.h is generated from $(top_srcdir)/include/qb/qbconfig.h.in
into $(top_builddir)/include/qb directory, and consumed from here
- rest of these header files are consumed directly from
$(top_srcdir)/include/qb directory
this new simplified variant:
- avoids code duplication (DRY)
- works thanks to VPATH in $(abs_top_builddir)/tests/Makefile
pointing to $(top_srcdir)/tests, which means that unsatisfied
dependencies on "$(top_builddir)/include/qb/%.h" (resolved to
"../include/qb/%.h") will be subsequently sought as
"$(top_srcdir)/tests/../include/qb/%.h", which has the same effect
as previous explicit "$(top_srcdir)/include/qb/%.h" specification
(note that such automatic VPATH provision is supported by automake
"since beginning" so no backward incompatibility is expected)
build: fix out-of-tree build broken with 0b04ed5 (#184)
Generating the man pages definitely doesn't depend on existence of
(possibly generated) header files that we omit anyway.
2016-03-10 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #199 from jnpkrn/CI-make-rpm
CI: make sure RPM can be built all the time
Merge pull request #198 from jnpkrn/build-prefer-xz
Build: prefer XZ tarball format
2016-03-09 Jan Pokorný <jpokorny@redhat.com>
CI: make sure RPM can be built all the time
This is to prevent issues like the one being fixed with ebcff54
(https://github.com/ClusterLabs/libqb/pull/197).
Also, plain "make" invocation is dropped as it is an integral part
of "make rpm" (%build phase in libqb.spec).
2016-03-08 Jan Pokorný <jpokorny@redhat.com>
build: switch to XZ tarball format for {,s}rpm packaging
References:
http://rpm.org/gitweb?p=rpm.git;a=commit;h=8078d0b (~2009)
http://rpm.org/gitweb?p=rpm.git;a=commit;h=3d63df6 (ditto)
build: do not try to second-guess "distdir" Automake variable
Also make {,s}rpm targets generate only the tarball format that is
consumed in the packaging process.
2016-03-08 Christine Caulfield <ccaulfie@redhat.com>
build: update library soname to 0.18.0
as per guidelines here:
http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
This shouldn't affect existing packages as the major version is still 0.
2016-03-08 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #197 from kskmori/syslog-tests-rpm
build: do not install syslog_override for the RPM packaging
2016-03-08 Keisuke MORI <kskmori@intellilink.co.jp>
build: do not install syslog_override for the RPM packaging
2016-03-04 Jan Pokorný <jpokorny@redhat.com>
build: be more restrictive about QB_HAVE_ATTRIBUTE_SECTION
That's because the code relies on (fairly unportable) treatment by the
linker, specifically ld linker from binutils suite:
<https://sourceware.org/binutils/docs/ld/Orphan-Sections.html>
and without that in place, QB_HAVE_ATTRIBUTE_SECTION cannot be enabled
as the __{start,stop}_SECNAME extern references in qb/qblog.h will not
get resolved at the link time.
Low: further avoid magic in qblog.h by using named constants
Also advise to use these constants and obey this in the internal code.
defs: add wrappers over preprocessor operators
Low: explain mysterious lines in a public header (qblog.h)
Also fix the previous inversion of the expression that in fact did not
use to check for anything (for "assert(1)" being a NOOP).
2016-03-01 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #190 from jnpkrn/build-syslog-tests-followup
build: syslog tests follow-up
2016-03-01 Jan Pokorný <jpokorny@redhat.com>
tests: refactor test case defs using versatile add_tcase macro
This reduces repeated code significantly, and allows for easier
supervision of what's being grouped to the suites + possibly what
timeouts apply.
Note that some artificial test case identifiers (in check_array.c,
check_log.c, check_loop.c, check_rb.c, check_utils.c) got changed
so they now follow 1:1 the test (function) name that is being run
for the case at hand without the "test_" prefix (strict convention).
Exception to this are test_ipc_disp_* tests in check_ipc.c that got,
conversely, changed to test_ipc_dispatch_* to follow the test case
identifiers.
build: enable syslog tests when configuring in spec
...hence make syslog tests executed in %check.
build: fix tests/_syslog_override.h not being distributed
...in the tarball arising from "make dist".
2016-02-22 Christine Caulfield <ccaulfie@redhat.com>
travis: Add a normal 'make' to the checks
make check doesn't build the docs and so errors in that part of
the build system will not be checked without a normal 'make'.
2016-02-22 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #185 from jnpkrn/followup-fixes
Follow-up fixes
2016-02-22 Jan Pokorný <jpokorny@redhat.com>
build: GCC < 4.6 does not support diagnostic push/pop pragmas
Better to get sort of a spurious warning then to possibly mess up
with a warnings safety net.
Reported by Chrissie (thanks).
build: fix man3 pages not installed
Issue with original version of the patch spotted by Chrissie (thanks).
2016-02-22 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #179 from dpejesh/socket
socket improvements for freebsd
Merge pull request #184 from jnpkrn/maint-no_magic-build_manpages
Maintainance: no magic + better manpages building
Merge pull request #181 from jnpkrn/log-target-slot-enum
log: enum qb_log_target_slot introduction + qblog.h cleanup
2016-02-18 Jan Pokorný <jpokorny@redhat.com>
build: header-based man pages: include also qbdefs.h+qbrb.h
No reason not to do that. Situation with qbconfig.h is a bit more
complicated as this file gets generated from .in file and there is
currently no reliable inter-dir/makefile (siblings) targets
dependency tracking in place, AFAICT.
build: header-based man pages: dependent_headers - blacklist
IOW, make tracking of interfaces to document via man pages maintainable.
build: grab "dependent_headers" from respective Makefile.am
...with "echo path/*.h" fallback (equivalent of wildcard function) if
the new methods fails for some reason.
build: fix "dependant" typo
Low: no magic constants + gethostname usage sanity
2016-02-18 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #177 from jnpkrn/changing-syslog-identifier-nicer
Changing syslog identifier + testing syslog, preferred edition
Merge pull request #180 from jnpkrn/example-simplelog-stdout
example: simplelog supports -o (for stdout sink)
Merge pull request #178 from jnpkrn/format-annotations
build: avoid too keen -Wmissing-format-attribute warning
Merge pull request #183 from jnpkrn/doc-fix-overview
Doc: fix overview
2016-02-18 Jan Pokorný <jpokorny@redhat.com>
CI: restore travis notifications, IRC this time around
While quarterback [dash] devel [at] lists [dot] fedorahosted [dot] org,
original notification target and development ML seems long gone (without
archives preserved!), let's use #clusterlabs-dev at freenode IRC
network. This is in-line with the purpose of the channel and it's what
clufter, crmsh and hawk seem to be currently using.
CI: enable recently added syslog-tests in .travis.yml
CI: .travis.yml cosmetics
Feature: allow changing the identifier for syslog (+tests)
Original "qb_log_ctl" interface had to be extended for passing read-only
strings (new parameter), resulting in new "qb_log_ctl2" function, which
is what qb_log_ctl calls into with the new parameter set to NULL.
This ensures backward compatibility.
A new QB_LOG_CONF_IDENT configuration directive for the mentioned
interface is added with a goal to set new internal identifier
that is, notably, used for syslog sink. This allows for switching
the identification without a need to reinitialize logging subsystem,
akin to changing target logging facility.
Also a brand new concept of testing syslog sink in particular is
introduced (finally). During initial trial&error stage, it used
LD_PRELOAD hack but it seems that libtool is sophisticated enough
that no such extra intervention is needed and the desired symbol
resolution Just Works (tm). However, the technique is highly
non-portable (there is even a warning about that from libtool,
which is partially on purpose as the _syslog_override.so should
rather be explicit it is by no mean a regular library) and hence
the syslog tests have to be enabled with explicit
./configure --enable-syslog-tests
rather than possibly break on untested platforms (far too many).
The concept can be extended upon, but initially, just the new
feature is being tested.
Post-review: thanks Chrissie for a suggestion how to deal with
extract-arg-and-forget in a less intrusive way (no defines).
2016-02-16 Jan Pokorný <jpokorny@redhat.com>
qblog.h: fix typos and make stylistic enhancements
qblog.h: unify descriptions before the code examples
- use semicolons at the end of the description
- use commas when there can be an issue with parsing a long sentence
(and wrap such text at 79 characters if applicable)
log: convert few more instances to use enum qb_log_target_slot
log: refactor static target slots state initialization
It doesn't matter that also syslog is disabled first, as it will get
enabled few lines later on (uniformity + simplicity > optimization +
complexity).
log: better (fixed) documentation for funcs returning "slot" index
Also add missing "stdout" to the enumerations of the static ones.
doc: IPC overview: fix typos
doc: main overview: fix style + reword per spec file
log: convert log target defined values into enum values
Also use the new enum qb_log_target_slot type in for-loops together
with a proper substitute for the literal "0" initializer.
There could be more places that might be type-substituted for this enum
(and hence possibly catch more of an incorrect usage if the compiler
or checker has some notion of enum type narrowing), but leave it as
a possible enhancement for now.
log: defined value as an index-pointer after static slots
Amongst other uses, this allows for better (fixed) documentation
regarding how many additional logging targets the user can define.
2016-02-15 Jan Pokorný <jpokorny@redhat.com>
example: simplelog supports -o (for stdout sink)
2016-02-14 David Shane Holden <dpejesh@yahoo.com>
ipc: return -errno when getsockopt/setsockopt fail
ipc: set socket buffer size used by ipcs service
ipc: set socket receive buffer
Set the sockets receive buffer size to match the send buffer. On
FreeBSD without this calls to sendto() will result in an ENOBUFS error
if the message is larger than net.local.dgram.recvspace sysctl.
2016-02-12 Jan Pokorný <jpokorny@redhat.com>
build: avoid too keen -Wmissing-format-attribute warning
Grouped with pre-existing -Wsuggest-attribute=format treatment.
2016-02-04 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #175 from jnpkrn/format-annotations
Format annotations
Merge pull request #174 from jnpkrn/spec-cleanup
Spec cleanup
2016-02-03 Jan Pokorný <jpokorny@redhat.com>
spec cleanup: drop redundant %{buildroot} cleaning
References:
http://pkgs.fedoraproject.org/cgit/rpms/redhat-rpm-config.git/commit/?id=159a65f
(~2010)
spec cleanup: summary should not end with a dot
References:
https://fedoraproject.org/wiki/Common_Rpmlint_issues#summary-ended-with-dot
https://en.opensuse.org/openSUSE:Specfile_guidelines#Summary
+ it's an internal inconsistency with Summary for -devel package
includes: format __attribute__ func. annotations in qblog.h
build: avoid too keen -Wsuggest-attribute=format warning
With gcc 5.3.1 20151207:
> log.c: In function 'cs_format':
> log.c:182:2: warning: function might be possible candidate for
> 'gnu_printf' format attribute [-Wsuggest-attribute=format]
> len = vsnprintf(str, QB_LOG_MAX_LEN, cs->format, ap_copy);
> ^
We certainly don't want to disable that warning globally so make use of
diagnostic pragmas for GCC instead in one instance that we cannot
annotate properly.
spec cleanup: get rid of redundant %clean section
References:
http://rpm.org/gitweb?p=rpm.git;a=commit;h=3fc5824 (~2009)
spec cleanup: remove ignored BuildRoot tag
References:
http://rpm.org/gitweb?p=rpm.git;a=commit;h=6c06519 (~2008)
spec cleanup: get rid of redundant defattr
References (first one is a direct trigger):
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/KEO7AX3JXR2TY6OVL4M7HDISZ6YIJNKU/#2UFET77NHMJTG4NA2ECRVH2KO3W56ZWD
http://rpm.org/gitweb?p=rpm.git;a=commit;h=47ea5da (~2004)
2016-02-01 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #173 from dpejesh/socket
ipc: set gid on unix sockets
2016-01-26 David Shane Holden <dpejesh@yahoo.com>
update: per kgaillot review
* remove pid/euid from qb_ipcc_connection
* use proper #elif defines
* return NULL instead of 0 for pointers
* return -ENOMEM when malloc fails
* remove redundant if check
* use -1 for uid to chown()
2016-01-23 David Shane Holden <dpejesh@yahoo.com>
ipc: set gid on unix sockets
When creating a unix socket it's default gid is that of the parent
directory. If the SOCKETDIR is owned by root:wheel with 1777 mode
some of the pacemaker daemons end up unable to communicate with one
another due to having insufficient permissions on the sockets.
This can be fixed by setting the client sockets gid to the primary
group of the server socket owner it's attempting to connect to. And,
on the server side by setting the gid to the already captured gid
stored in the connection info. This ensures that regardless of who
owns the socket directory, as long as the applications have r/w
access to it they should work.
lib: store server peer credentials in qb_ipcc_connection
lib: add init_ipc_auth_data() to initialize ipc_auth_data
lib: split peer credential loopup into it's own method
2016-01-19 Christine Caulfield <ccaulfie@redhat.com>
build: Correctly generate spec file's date
LC_ALL=C was outside of the shell environment so the date
was incorrect in the spec file if the system default language was not
C or English.
2016-01-19 Chrissie Caulfield <ccaulfie@redhat.com>
Merge pull request #171 from dpejesh/socket
minor socket/mmap fixes
2016-01-19 David Shane Holden <dpejesh@yahoo.com>
lib: create mmap files in socket directory
Currently the mmap files are created in LOCALSTATEDIR/run on non-Linux
platforms which can be problematic with pacemaker since it spawns processes
as the hacluster user, which by default doesn't have write permissions to
it. Using --with-socket-dir partially fixes the problem by allowing the
unix sockets to reside somewhere else but not the mmap files and this
patch puts them in the same directory.
2016-01-18 David Shane Holden <dpejesh@yahoo.com>
ipc: set file permissions on created sockets
When using sockets for IPC the file permissions default to whatever
the umask is. This isn't a problem on Linux since it uses abstract
namespace sockets which don't have any permissions, but on other
platforms this causes problems with pacemaker which spawns processes
under the hacluster user and ends up failing to connect.
2016-01-14 chrissie-c <ccaulfie@redhat.com>
Merge pull request #170 from dkopecek/master
Add missing Makefile rule for generating the auto_check_header_qbconf…
2016-01-14 Daniel Kopecek <dkopecek@redhat.com>
Add missing Makefile rule for generating the auto_check_header_qbconfig.c file
Resolves issue #158
Addressing:
make[2]: Entering directory `/home/dkopecek/Projects/github/usbguard/src/ThirdParty/libqb/_build/tests'
...
GEN auto_check_header_qbarray.c
CC auto_check_header_qbarray.o
CCLD auto_check_header_qbarray
make[2]: *** No rule to make target `auto_check_header_qbconfig.c', needed by `auto_check_header_qbconfig.o'. Stop.
make[2]: Leaving directory `/home/dkopecek/Projects/github/usbguard/src/ThirdParty/libqb/_build/tests'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/dkopecek/Projects/github/usbguard/src/ThirdParty/libqb/_build'
make: *** [all] Error 2
2016-01-12 Christine Caulfield <ccaulfie@redhat.com>
lib: update library version for new release
2016-01-11 chrissie-c <ccaulfie@redhat.com>
Merge pull request #164 from kgaillot/fixes
Improvements to build process
2016-01-08 Christine Caulfield <ccaulfie@redhat.com>
includes: Fix format string
The format strings for QB_HDB_D_FORMAT & QB_HDB_X_FORMAT had no spaces
between "%" and PRIx64. This is allowed, but technically incorrect and
breaks C++11
2016-01-08 chrissie-c <ccaulfie@redhat.com>
Merge pull request #167 from gao-yan/ipc-fd-memory-leaks
Fix: ipc: Prevent fd and memory leaks in handle_new_connection()
2015-12-17 chrissie-c <ccaulfie@redhat.com>
Merge pull request #169 from rubenk/remove-unused-define
configure.ac: remove an unused DEFINE
Merge pull request #168 from rubenk/point-at-the-correct-license-file
The license is in COPYING, not LICENSE
2015-12-16 Ruben Kerkhof <ruben@rubenkerkhof.com>
configure.ac: remove an unused DEFINE
The license is in COPYING, not LICENSE
2015-10-06 Gao,Yan <ygao@suse.com>
Fix: ipc: Prevent fd and memory leaks in handle_new_connection()
In handle_new_connection(), connection_accept() could fail, which would
leave the state of the connection inactive. Previously, in this case,
the socket and the allocated qb_ipcs_connection would be leaked.
2015-10-01 Christine Caulfield <ccaulfie@redhat.com>
log: don't call dlopen inside dl_iterate_phdr()
Some platforms (eg. FreeBSD 10+) don't support calling dlopen() from
within a dl_iterate_phdr() callback; so save all of the dlpi_names to
a list and iterate over them afterwards.
This fixes a deadlock which occurs in dlopen() when called from
within dl_iterate_phdr() on FreeBSD 10+ when linked to libthr.
Patch from dpejesh on github.
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2015-09-25 Christine Caulfield <ccaulfie@redhat.com>
tests: Allow more time for stress_connections tests
On *BSD and other platforms the stress_connections can timeout and
fail the tests. I've increased the timeout here to an hour as it
takes nearly that long on my VM environment but it seems that's not
common, luckily.
This was also seen on mips/mipsel.
2015-09-24 Christine Caulfield <ccaulfie@redhat.com>
ipc: Revert half of a previous *BSD ipc-name patch
Only one of the strndup calls should have subtracted 9 from
the name length. The other should have remained at 8.
ipc: Don't send the dispatch_del() function a closed fd
The current code closes the fd before passing it to the
provided delete function. In the default case this can generate
"epoll_ctl(del): Bad file descriptor" messages when debug logging
is enabled.
This patch swaps over the calls so that a valid FD is passed to
the delete function.
Reviewed-By: Ken Gaillot <kgaillot@redhat.com>
2015-09-22 Christine Caulfield <ccaulfie@redhat.com>
Fix deletion of sockets on *BSD platforms
The code removed the last 8 characters of a socket name
to get the 'base name', but 9 are needed.
2015-09-11 Ken Gaillot <kgaillot@redhat.com>
Update last reference to quarterback-devel mailing list
2015-09-11 Christine Caulfield <ccaulfie@redhat.com>
Fix check_ipc tests so they exit correctly
On some platforms the check_ipc test can fail due to SIGTERM
being delivered to to exiting server process. There is a race
condition between the server main loop quitting and the
signal being delivered.
This patch closes that race loophole in two places, firstly
it makes SIGTERM/SIGSTOP exit immediately rather than just signalling
the mainloop, secondly it calls exit() rather than return when the server
mainloop completes to that the client code does not start executing!
2015-09-09 Ken Gaillot <kgaillot@redhat.com>
docs: update doxygen files
These are the results of "doxygen -u" to get rid of warnings.
Add helper script for generating online documentation
If build-aux/generate-docs is run from the top level of the checkout,
it will prompt for the old and new version numbers, and generate
doxygen, ABI compatibility and change log documentation,
and commit them to the gh-pages branch.
test: add helper script for running coverity
2015-08-28 Ken Gaillot <kgaillot@redhat.com>
update copy of gitlog-to-changelog to latest GNU version
downloaded from http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=build-aux/gitlog-to-changelog
minor fixes to check script's ABI report
- update location of HTML output
- don't exit if there were incompatible ABI changes
- don't need branch name variable since we're not creating new branch for build anymore
2015-08-24 Christine Caulfield <ccaulfie@redhat.com>
Somme minor fixes to the check script
Update for latest git command
add $BROWSER instead of ahrdcoded google-chrome
2015-08-18 David Vossel <dvossel@redhat.com>
Merge pull request #161 from kgaillot/fix
Fix: valgrind "invalid file descriptor" warning
2015-08-18 Ken Gaillot <kgaillot@redhat.com>
release version 0.17.2
This revision switches libtool soname versioning from -version-number to
-version-info, and updates the travis configuration to use their newly
recommended infrastructure.
doc: improve README and RPM description
Fix: valgrind "invalid file descriptor" warning
2015-08-17 David Vossel <dvossel@redhat.com>
Merge pull request #162 from ab-oe/master
Increase the length of description field.
2015-08-06 Arkadiusz Bubala <arkadiusz.bubala@open-e.com>
Increase the length of description field.
Make description field larger to satisfy all possible pids and file
descriptor values.
2015-08-05 Arkadiusz Bubala <arkadiusz.bubala@open-e.com>
Increase the length of description field.
When both the corosync and pacemaker has PID larger or equal 10000
and when the file descriptor is larger or equal 10 the desciption
will have at least 17 characters.
2015-05-15 David Vossel <dvossel@redhat.com>
Merge pull request #157 from davidvossel/solaris-compile-fix
Fix: resolves compile error for solaris
Fix: resolves compile error for solaris
2015-04-30 David Vossel <dvossel@redhat.com>
Merge pull request #155 from kgaillot/splitlogging
Implement extended information logging (aka split logging)
2015-04-30 Ken Gaillot <kgaillot@redhat.com>
Low: add unit test for new extended information logging
Feature: Implement "extended" logging using a marker character
If a log message contains a magic character, everything after that marker
will be considered "extended" information. Log targets default to showing
this extended information but qb_log_ctl() may be used to indicate that
the extended information should be stripped instead.
The use case is a log message that has some information of value to administrators
and other information that is only of value for debugging. Two targets can be
configured such that the administrator log is not cluttered with debug information,
but a separate debug log is still available with complete information.
The magic character is the bell (\a). If someone wants to log an actual bell
character, they can do so in the extended information or via a %c format
(only the first bell is magic and only in the format string).
2015-04-30 David Vossel <dvossel@redhat.com>
Merge pull request #154 from davidvossel/master
Low: examples: fix race condition in glib mainloop example
2015-04-29 David Vossel <dvossel@redhat.com>
Merge pull request #153 from credativ/hppa-alignment
Fix alignment issues on hppa
2015-04-27 Ken Gaillot <kgaillot@redhat.com>
Low: build: update .gitignore for vim swap files and "make check" output
2015-04-24 David Vossel <dvossel@redhat.com>
Low: examples: fix race condition in glib mainloop example
2015-04-24 Helge Deller <deller@gmx.de>
Fix alignment issues on hppa
libqb fails to build on the hppa architecture, because the built-in
testcases fail as can be seen here:
http://buildd.debian-ports.org/status/fetch.php?pkg=libqb&arch=hppa&ver=0.17.0-2&stamp=1409458262
I did analyzed why they fail, and the reason is that on hppa we have
somewhat more complicated requirements (e.g. alignments) which needs to
be followed in order to mmap shared pages between processes. It's
different than what can be done compared to ia64 and sparc.
The attached patch fixes libqb on the hppa architecture and with it all
testcases finish successful.
By the way, I fixed a small typo in configure.ac too where arm platforms
prints "ia64"...
Forwarded-From: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=760199
2015-04-20 David Vossel <dvossel@redhat.com>
Merge pull request #152 from wferi/small-fixups
Small fixups
2015-04-20 Ferenc Wágner <wferi@niif.hu>
Fix description of qbutil.h
The too early @author field stopped Doxygen from interpreting it.
Add Doxygen description for qbipc_common.h
The generated manpage lacked the whatis/apropos text in the synopsis.
Fix comment typo: neccessary -> necessary
Fix comment typos: incomming -> incoming
Clear DOT_FONTNAME, since FreeSans is not included anymore
The new default is Helvetica.
Remove obsolete options from doxyfiles
The SYMBOL_CACHE_SIZE, HTML_ALIGN_MEMBERS and USE_INLINE_TREES options
were at their default values, so it is safe to remove them now that they
only generate warnings.
Do not suppress echoing of Doxygen commands
This makes fixing Doxygen warnings easier.
2015-04-16 David Vossel <dvossel@redhat.com>
Merge pull request #150 from davidvossel/poll_starve
ipc test improvements.
Low: check_ipc: generate unique server names for tests
Package builders that run multiple builds of libqb in parallel
will fail because the IPC unit tests stomp on each other's namespace.
We have to give each IPC server a randomized unique name during
'make check' to avoid this.
Low: check_ipc: give connection stress tests for shm and socket unique names
2015-04-15 David Vossel <dvossel@redhat.com>
Merge pull request #147 from davidvossel/poll_starve
High: loop: fixes resource starvation in mainloop code
2015-04-14 David Vossel <dvossel@redhat.com>
Low: tests: regression tests for stress testing loop_poll ipc create/destroy
High: loop: fixes resource starvation in mainloop code
2015-03-05 David Vossel <dvossel@redhat.com>
Merge pull request #141 from davidvossel/recv-yield
High: yield to scheduler during connection processing
High: yield to scheduler during new connection auth processing
2015-01-29 David Vossel <dvossel@redhat.com>
Merge pull request #138 from rubenk/fix-clang-warning
The udata member of the kevent struct is a void *
2015-01-23 Ruben Kerkhof <ruben@rubenkerkhof.com>
The udata member of the kevent struct is a void *
Fixes the following warnings under clang:
loop_poll_kqueue.c:58:2: warning: incompatible integer to pointer conversion assigning to 'void *' from 'intptr_t' (aka 'long') [-Wint-conversion]
EV_SET(&ke, fd, filters, EV_ADD | EV_ENABLE, 0, 0, (intptr_t)pe);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/sys/event.h:54:16: note: expanded from macro 'EV_SET'
(kevp)->udata = (f); \
^ ~~~
2015-01-20 David Vossel <dvossel@redhat.com>
Merge pull request #137 from rubenk/detect-warning-flags-better
Fix detection of warning flags for clang
2015-01-19 Ruben Kerkhof <ruben@rubenkerkhof.com>
Fix detection of warning flags for clang
Using ./configure CC=clang, the following flags are detected
as supported:
checking whether clang supports "-Wgnu89-inline"... yes
checking whether clang supports "-Wno-strict-aliasing"... yes
Which results in a lot of warnings during make:
warning: unknown warning option '-Wunsigned-char' [-Wunknown-warning-option]
warning: unknown warning option '-Wgnu89-inline' [-Wunknown-warning-option]
Clang doesn't support these flags, but the compile check returns a
warning, not an error:
configure:16649: checking whether clang supports "-Wunsigned-char"
configure:16662: clang -E -Wunsigned-char conftest.c
warning: unknown warning option '-Wunsigned-char' [-Wunknown-warning-option]
1 warning generated.
configure:16662: $? = 0
configure:16663: result: yes
2015-01-13 David Vossel <dvossel@redhat.com>
Merge pull request #136 from grueni/upstream4
Fix: Unlink files bound to unix domain sockets
2015-01-13 Andreas Grueninger <Andreas.Grueninger@some.where>
Fix: Unlink files before qb_ipcc_us_sock_close
Changed the #if clauses to all non linux OSe.
2014-12-22 Andreas Grueninger <Andreas.Grueninger@some.where>
Fix: Unlink files bound to unix domain sockets
In qb_ipcs_us_connect 4 files are created and bound.
I dont' know how this works for QB_LINUX or QB_CYGWIN.
But for the other OS the files are created and must be unlinked.
I use the same logic to construct the file names and unlink the files.
qb_ipcc_us_connect calls this
...
res = qb_ipc_dgram_sock_connect(r->response, "response", "request",
r->max_msg_size, &c->request.u.us.sock);
and qb_ipc_dgram_sock_connect calls
..
set_sock_addr
and in set_sock_addr the files are created if not Linux or Cygwin.
...
#if defined(QB_LINUX) || defined(QB_CYGWIN)
snprintf(address->sun_path + 1, UNIX_PATH_MAX - 1, "%s", socket_name);
#else
snprintf(address->sun_path, sizeof(address->sun_path), "%s/%s", SOCKETDIR,
socket_name);
#endif
...
2014-08-27 David Vossel <dvossel@redhat.com>
Low: release.mk: update gpg public key
2014-08-22 David Vossel <dvossel@redhat.com>
Revise version to 0.17.1 The next release is only a point release
Bump release version to 0.18.0
preparing for a new release
2014-08-21 David Vossel <dvossel@redhat.com>
Merge pull request #132 from davidvossel/master
regression test failure fixes
Low: qbipcs.h: fix doxygen comments for ipcs buffer size enforcement
Low: check_ipc.c: improve error checking during ipc stress tests
Fix: ipcs: Correctly allocate receive buffer size
2014-08-14 David Vossel <dvossel@redhat.com>
Merge pull request #131 from davidvossel/reformatting
High: ipc_socket: Signalhandler must be resetted to Default, use only cl...
2014-08-14 Super-User <andreas.grueninger@lgl.bwl.de>
High: ipc_socket: Signalhandler must be resetted to Default, use only cleanup_sigpipe to return from qb_ipc_dgram_sock_setup.
Some OS like Solaris/Illumos return with ECONNRESET or EPIPE in the case of a disconnecting peer.
Change the return code to ENOTCONN and continue.
2014-08-11 David Vossel <dvossel@redhat.com>
Merge pull request #128 from davidvossel/17.1.fixes
High: trie: allow modifying the trie map during the notify callback
2014-07-30 David Vossel <dvossel@redhat.com>
High: trie: allow modifying the trie map during the notify callback
2014-07-23 David Vossel <dvossel@redhat.com>
Merge pull request #127 from davidvossel/17.1.fixes
Low: log: return filter type enum to preserve abi compatibilty with corosync
Low: log: return filter type enum to preserve abi compatibilty with corosync
This returns abi compatiblity with libqb v0.16.0. There was a subtle
change in behavior caused by reordering the log filter enum in
v0.17.0.
Merge pull request #126 from davidvossel/17.1.fixes
build cleanup and thread-safe logging documentation
Low: doc: Add better documentation on thread-safe logging
2014-07-23 Fabio M. Di Nitto <fdinitto@redhat.com>
Low: build: cleanup autogen warning to not overrride LDFLAGS
Low: build: update .gitignore and make maintainer-clean target
2014-06-30 David Vossel <dvossel@redhat.com>
Merge pull request #125 from hopkings2008/master
fix invalid option when run 'ipcclient -h'
2014-06-30 zouyu <hopkings2005@gmail.com>
fix invalid option when run 'ipcclient -h'
2014-06-19 David Vossel <dvossel@redhat.com>
Merge pull request #120 from AnchorCat/shm-connect-cleanup
ipc_shm: fix error handling in qb_ipcs_shm_connect()
Merge pull request #121 from AnchorCat/epoll
epoll: don't miss poll events under high load
Merge pull request #122 from AnchorCat/ringbuffer
Fix a couple of bugs in the ringbuffer code
2014-06-05 Michael Chapman <mike@very.puzzling.org>
epoll: don't miss poll events under high load
If multiple epoll sources generate events simultaneously, it is possible
for more jobs to be added to particular priority level than will be
handled in one go by qb_loop_run_level(). If one of these epoll sources
gains a new event (say, by switching from "readable" to "readable and
writeable"), then this new event would be missed.
To fix this, merge new epoll events into revents regardless of whether
the job is on the joblist. When the job is dispatched, revents will be
cleared, or the epoll source will be deleted entirely.
ipc_shm: fix error handling in qb_ipcs_shm_connect()
The request and response SHM segments were being closed under the wrong
labels, and the event SHM segment wasn't being cleaned up at all.
ringbuffer: fix size in qb_rb_create_from_file()
qb_rb_open() expects the size field to represent the maximum chunk size.
It adds QB_RB_CHUNK_MARGIN + 1 and rounds up to the page size to
determine the ringbuffer's total size. When creating a ringbuffer from a
file we must compensate by subtracting this amount from the file's size.
ringbuffer: fix qb_rb_open_2() debug format string
qb_log_target_formats() does not support formatting size_t values with
%zd. Use %ld to format them as long integers instead.
2014-05-12 David Vossel <dvossel@redhat.com>
Merge pull request #118 from davidvossel/master
Fix: trie: fixes regression caused by ref count refactoring
2014-05-09 David Vossel <dvossel@redhat.com>
Fix: trie: fixes regression caused by ref count refactoring
2014-04-04 David Vossel <dvossel@redhat.com>
Merge pull request #116 from davidvossel/master
clang analyzer fixes
Low: trie: cleanup ref count logic in trie_notify_del
Low: ipcs: Cleanup unnecessary reference counting
Low: check: Update clang path in check script
2014-03-12 David Vossel <dvossel@redhat.com>
Merge pull request #115 from davidvossel/master
properly timeout ipc recv
Low: check_ipc: Verify ipc recv times out correctly
Fix: ipcc: Properly timeout during recv when timeout value is provided
2014-03-05 David Vossel <dvossel@redhat.com>
Merge pull request #113 from inouekazu/log_eagain
Low: ipc_setup.c: Add log for EAGAIN
2014-02-26 David Vossel <dvossel@redhat.com>
Low: check_ipc.c: Correctly check the event queue length for bulk events
Low: check_ipc.c: Correctly wait for server process to exit
2014-02-25 David Vossel <dvossel@redhat.com>
Low: check_ipc.c: Avoid using MAX_MSG_SIZE macro directly in calculations
Low: build: Don't allow Bsymbolic-functions LDFLAG to be used, it breaks unit tests
2014-02-20 Kazunori INOUE <kazunori.inoue3@gmail.com>
Low: ipc_setup.c: Add log for EAGAIN
2014-02-19 David Vossel <dvossel@redhat.com>
Fix: build: Allow 'make rpm' to work with lightweight tags for release candidates
Fix: spec: reference correct url in spec file
Doc: update broken doxygen link to something that exists
Bump version to 0.17.0
Merge pull request #112 from davidvossel/master
Low: ipc_socket: further optimize max msg size calculations for fbsd portability tests
2014-02-11 David Vossel <dvossel@redhat.com>
Low: ipc_socket: further optimize max msg size calculations for fbsd portability tests
2014-02-10 David Vossel <dvossel@redhat.com>
Merge pull request #111 from davidvossel/master
Low: ipc_socket: Allow socket max msg size to be calculated more accurat...
Low: ipc_socket: Allow socket max msg size to be calculated more accurately
2014-02-05 David Vossel <dvossel@redhat.com>
Merge pull request #110 from davidvossel/master
Fix: fixes travis compile time error
Fix: fixes travis compile time error
Merge pull request #107 from davidvossel/ref_count_cleanup
High: ipcs: Prevent ipc server use after free.
2014-01-20 David Vossel <dvossel@redhat.com>
Low: tests: Fixes compile time issue with make check
2014-01-17 David Vossel <dvossel@redhat.com>
High: ipcs: Prevent ipc server use after free.
The ipc server registers the bind socket to
the poll loop in order to be alerted to new
connection requests. Upon shutdown, the ipc server
does not remove this poll entry. This patch fixes
this use after free.
2014-01-16 David Vossel <dvossel@redhat.com>
Merge pull request #106 from davidvossel/ref_count_cleanup
reference count fixes
2014-01-15 David Vossel <dvossel@redhat.com>
Low: ipc: Remove ipc connection reference given to dispatch functions
We don't need to give the dispatch_add callback a reference
since the dispatch_del callback must occur before the
connection is destroyed. This extra reference counting
causes unnecessary complexity.
High: ipc: Fixes memory leak in server connection accept when client partially connects
2014-01-08 David Vossel <dvossel@redhat.com>
Merge pull request #105 from gao-yan/ipc-server-backlog
IPC: Increase the listen backlog of IPC server
2014-01-08 Gao,Yan <ygao@suse.com>
IPC: Increase the listen backlog of IPC server
2014-01-07 David Vossel <dvossel@redhat.com>
Merge pull request #104 from davidvossel/master
Low: ipcs: Clarifications to the ipcs server callback documentation.
Low: ipcs: Clarifications to the ipcs server callback documentation.
2014-01-02 David Vossel <dvossel@redhat.com>
Merge pull request #103 from latinovic/master
Fix rb.test to avoid overwriting memory during reading.
2013-12-24 Dejan Latinovic <Dejan.Latinovic@rt-rk.com>
Fix rb.test to avoid overwriting memory during reading.
In test_ring_buffer1,
if the size of the chunk(90-93) is larger than size of the hdr (16),
it comes to overwriting memory during reading.
2013-11-18 David Vossel <dvossel@redhat.com>
Merge pull request #100 from davidvossel/server_side_buf_limit
Low: example: Update client/server example to use server enforced buffer...
2013-11-19 David Vossel <dvossel@redhat.com>
Low: example: Update client/server example to use server enforced buffer size
2013-11-18 David Vossel <dvossel@redhat.com>
Low: Client side buffer retrieval regression test
Feature: New api function to retrieve client buffer size
When server side buffer limits are in use, this is
necessary to determine the buffer size the server
is enforcing after the client connection is established.
Low: check_ipc.c: Verify server enforced buffer sizes work
Feature: Enforce buffer size limits on the server side
Merge pull request #99 from davidvossel/regex_logger
Regex logging filters
Merge pull request #98 from davidvossel/server_side_buf_limit
Server side max buffer limit
2013-11-16 David Vossel <dvossel@redhat.com>
Low: regession tests for regex log filters
Feature: Filter logs using regex patter on function, format, or filename
2013-10-21 David Vossel <dvossel@redhat.com>
Merge pull request #96 from jfriesse/master
ipc_setup: Set SO_PASSCRED on listener socket
2013-10-21 Jan Friesse <jfriesse@redhat.com>
ipc_setup: Set SO_PASSCRED on listener socket
This is needed, because newer kernels doesn't correctly support setting
SO_PASSCRED on sockets returned by accept call, but socket option must
be set on server socket (before accept call).
For more details, see:
http://patchwork.ozlabs.org/patch/284366/
2013-10-18 David Vossel <dvossel@redhat.com>
Fix: log: Filtering by function and file must match exactly, no substring matches
2013-10-17 David Vossel <dvossel@redhat.com>
Merge pull request #95 from davidvossel/master
Fix: log: Filtering by function and file must match exactly, no substrin...
2013-10-09 David Vossel <dvossel@redhat.com>
Merge pull request #93 from davidvossel/master
ipc and blackbox fixes
Low: blackbox: Abort blackbox logging on ringbuffer overwrite reclaim error
2013-10-08 David Vossel <dvossel@redhat.com>
High: ipcs: Api function allowing server to retrieve client connection's ipc buffer size
Merge pull request #92 from davidvossel/blackbox_unique_files
Blackbox unique files
2013-10-04 David Vossel <dvossel@redhat.com>
Low: ringbuffer: Abort during chunk reclaim if OVERWRITE flag is set and reclaim fails.
High: blackbox: unique blackbox ringbuffer files per pid
2013-09-18 David Vossel <dvossel@redhat.com>
Merge pull request #91 from VladMalov/patch-1
2013-09-18 VladMalov <vmalov@exablox.com>
Update README.markdown
ClusterLabs not clusterlabs - git hub is case sensitive now days.
2013-09-16 David Vossel <dvossel@redhat.com>
Merge pull request #90 from davidvossel/master
Low: ipc_socket: Fixes fd leak in socket ipc client disconnection
2013-09-17 David Vossel <dvossel@redhat.com>
Low: ipc_socket: Fixes fd leak in socket ipc client disconnection
2013-09-03 David Vossel <dvossel@redhat.com>
Merge pull request #88 from r1mikey/master
Fix sockaddr_un.sun_path overflow on Mac OS X 10.9
2013-09-03 Michael van der Westhuizen <r1mikey@gmail.com>
Use sizeof to get the correct size of the sockaddr_un sun_path member in a portable way. Fixes corosync on Mac OS X.
2013-08-20 David Vossel <dvossel@redhat.com>
Merge pull request #87 from anchor/del-during-dispatch-v2
Avoid double-decrement of level->todo
Detect the max signal value that can be used using NSIG macro
2013-08-20 Michael Chapman <mike@very.puzzling.org>
Avoid double-decrement of level->todo
If a job's dispatch function deletes the job, we may end up decrementing
the job queue's todo count twice. Verify that the job is on the queue
before decrementing.
2013-08-19 David Vossel <dvossel@redhat.com>
Merge pull request #85 from r1mikey/master
Use a system-supplied maximum number of signals on Mac OS X.
2013-08-11 Michael van der Westhuizen <r1mikey@gmail.com>
Use a system-supplied maximum number of signals on Mac OS X. This gets SIGUSR2 (#31) working.
2013-07-25 David Vossel <dvossel@redhat.com>
Bump version to 0.16.0 ... do not use version 0.15.0
The use of version-info conflicted with the naming
convention used to represent libqb version numbers. Because
of this the shared library file used for release 0.15.0
did not properly match the release version. From now on
the version number will be manually set to guarantee consistency
between .so file and release version.
Update release gpg sign key
Bump the version to 0.15.0
2013-07-23 David Vossel <dvossel@redhat.com>
Merge pull request #83 from davidvossel/master
socket ipc fixes
2013-07-24 David Vossel <dvossel@redhat.com>
Low: ipc_socket: Output send event failure as debug instead of error
Low: ipcserver.c: Fix example server's glib mainloop implementation
High: ipc_socket.c: Detect EOF connection on connection STREAM socket
2013-07-22 David Vossel <dvossel@redhat.com>
Merge pull request #81 from davidvossel/dgram_max_msg
Added ability to estimate kernel's actual max dgram buffer size in a portable way.
2013-07-23 David Vossel <dvossel@redhat.com>
Low: tests: Add dgram max size detection test
Low: ipc_socket.c: Handle the unlikely event of an EAGAIN or EINTR during dgram max size detection
2013-07-22 David Vossel <dvossel@redhat.com>
Merge pull request #82 from davidvossel/master
coverity fixes
2013-07-23 David Vossel <dvossel@redhat.com>
Fixes detect disconnect on send for tcp example
Fixes sem leak
2013-07-22 David Vossel <dvossel@redhat.com>
Fixes less-than-zero comparision of unsigned int
fixes double close
Fixes double close
Fixes double fd close
Fixes fd leak
Prevent use after free in benchmark util
Fixes use ater free in shm disconnect
Fixes use after free during ipcs client disconnect
Remove dead code
2013-07-20 David Vossel <dvossel@redhat.com>
Low: check_ipc.c: Verify dgram max size during tests
High: ipcc: Add abilty to verify dgram kernel buffer size meets max msg value
2013-07-19 David Vossel <dvossel@redhat.com>
Fixes travis build error
Merge pull request #80 from davidvossel/master
Fixes travis build error
Low: check_ipc.c: fix debug message to only display once.
High: ringbuffer: Make max_size of ringbuffer accurate so shm ipc max msg size value is honored
Low: ipcs: For shm ipc, always retry outstanding notifications when next event is sent
Low: tests: Added test to verify sending ipc msg equal to max size succeeds
2013-07-18 David Vossel <dvossel@redhat.com>
Merge pull request #79 from davidvossel/master
fix shared memory ipc so max msg size is honored correctly
2013-07-12 David Vossel <dvossel@redhat.com>
Merge pull request #78 from davidvossel/master
fixes travis compile time issue
2013-07-13 David Vossel <dvossel@redhat.com>
Fix: ipcs: Fixes compile time issue reported by travis
2013-07-12 David Vossel <dvossel@redhat.com>
Merge pull request #77 from davidvossel/stress_tests_fixes
Adds new ipc event stress test and fixes issues the new test exposed
2013-07-13 David Vossel <dvossel@redhat.com>
Low: loop_pool_kqueue: remove potentially noisy dbug statement
Low: tests: rework bulk event msg ipc test
Some environments have very small dgram msg queues. In
these environments we have to be able to read off the event
queue before being able to send the rest of events for the
bulk event test.
Account for fbsd ENOBUFS during stress test
Low: tests: Adds ipc event stress test to testsuite
Low: ipc_socket: In fbsd send() returns ENOBUFS when dgram queue is full, this should be treated similar to EAGAIN
High: kqueue: Properly enable kqueue filter in poll loop
Low: ipcs: Attempt to resend outstanding event notifications during event send
2013-07-03 David Vossel <dvossel@redhat.com>
Merge pull request #75 from davidvossel/ref_count_cleanup
Low: qbipcs: update ipcs connection iterator documentation
Low: qbipcs.h: update ipcs connection iterator documentation
2013-07-02 David Vossel <dvossel@redhat.com>
Merge pull request #74 from davidvossel/ref_count_cleanup
Properly disconnect clients when ipc dispatch fails.
Fix: ipcs: Disconnect shm ipc connection when poll socket returns error on msg receive
Fix: ipcs: Properly disconnect client connection on POLLNVAL or any other error causing connection removal from mainloop.
qb_ipcs_dispatch_connection_request is a callback function registered with
mainloop, or whatever other looping thread implementation is in use. When
this callback is registered, a reference of the connection object is given
to the mainloop thread. If this callback ever returns something none zero
the callback (and corresponding fd) is unregistered from the loop automatically,
so we must decrement the reference in this instance.
Since unregistering this callback from mainloop guarantees a disconnect
simply because requests on the fd are no longer processed, it is best
that we completely disconnect the connection (which will handle the unref)
when this callback returns an error... Otherwise since the fd is unregistered
from the mainloop thread, it may not be possible to detect a disconnect
in the future.
2013-06-29 David Vossel <dvossel@redhat.com>
Simplify internal ipcs ref counting, add comments and document api behavior
Simplifies connection ref counting without changing behavior
2013-06-28 David Vossel <dvossel@redhat.com>
Low remove ref-count error in example ipcserver.
Merge pull request #73 from davidvossel/ref_count_cleanup
cleanup connection and service ref counting without changing behavior
Merge pull request #72 from davidvossel/master
Fixes ref count leak in example ipcserver.c
Low: tests: Verify reading valid blackbox file works
Fix: refcount leak
Fix: ringbuffer: Add file header version field and detect reading corrupted blackbox files using hash value
In the future, if something changes in the file header we can
increment the version and split up the parsing into separate functions
for backwards compatibility.
2013-06-26 David Vossel <dvossel@redhat.com>
Fix: tests: On some platforms -ECONNRESET is returned rather than -ENOTCONN after server failure
Fix: tests: Make blackbox_segfault.sh not depend on bash
2013-06-20 Angus Salkeld <asalkeld@redhat.com>
Hopefully this is the last travis link fix
pesky camel_humps
Fix travis icon (travis is case sensitive)
touchy chap.
Fix the github links
2013-06-05 Angus Salkeld <asalkeld@redhat.com>
Merge pull request #70 from yuusuke/fix_logging
fix a problem when the character string beyond the number of the maximum...
2013-06-05 yuusuke <yusk.iida@gmail.com>
fix a problem when the character string beyond the number of the maximum characters is passed
2013-05-27 Angus Salkeld <asalkeld@redhat.com>
Merge pull request #68 from r1mikey/upstream
Add an IPC server service context
2013-05-25 Michael van der Westhuizen <r1mikey@gmail.com>
Add a IPC service context pointer and accessors from both the connection and service level.
2013-05-14 Angus Salkeld <asalkeld@redhat.com>
Enable distcheck on the travis tests
2013-05-13 Angus Salkeld <asalkeld@redhat.com>
Add atomic_int.h to noinst_HEADERS
Use the new atomic ops in the ringbuffer
Add internal support for the new __atomic gcc builtins
Rename the configure macros from atomic to sync
This is so I can add support for the new atomic's which
are named __atomic.
2013-04-24 Jeremy Fitzhardinge <jeremy@goop.org>
ringbuffer: use atomic ops on ringbuffer chunk magic
The ringbuffer protocol uses the chunk magic number to indicate to the
other side what state a chunk is in. It's therefore important to use
strongly ordered memory writes to make sure that neither the compiler
nor the CPU change the apparent order of the writes, since that would
result in corrupted messages.
2013-04-24 Angus Salkeld <asalkeld@redhat.com>
Remove some test code mistakenly committed to the example program.
2013-04-22 Angus Salkeld <asalkeld@redhat.com>
IPC: make each connection ref the owning service
This is because the connection functions use the c->service pointer
and this needs to be mirrored in the reference counting.
The service can only be free'd when all connections are destroyed
and the user as unreferenced all previously referenced connections
and the service.
Fixes #62
Thanks to Jan Friesse for the reproducer
2013-04-11 Andrew Beekhof <andrew@beekhof.net>
Indicate when/why qb_rb_force_close() fails to remove share memory files
2013-04-10 Andrei Belov <defanator@gmail.com>
Typo fixed in configure
Hello.
2013-04-10 Angus Salkeld <asalkeld@redhat.com>
Fix "make srpm"
Remove doxygen from travis deps to try and get the job working.
Fix make distcheck
2013-04-07 Angus Salkeld <asalkeld@redhat.com>
Merge pull request #60 from t-matsuo/fix-makefile-of-tests
add file_change_bytes into check_PROGRAMS and fix a typo
2013-04-07 Takatoshi MATSUO <matsuo.tak@gmail.com>
add file_change_bytes into check_PROGRAMS and fix a typo
2013-04-02 Angus Salkeld <asalkeld@redhat.com>
Deal better with corrupt blackbox files.
fixes #59
Thanks to Jan Friesse for the reproducer.
https://github.com/jfriesse/csts/blob/master/tests/fplay-segfault.sh
2013-03-25 Angus Salkeld <asalkeld@redhat.com>
Merge pull request #58 from inouekazu/fix_connection_state_checking
IPC: fix the connection state checking
Make sure the case when qb_ipc_us_ready() returns 0 is handled.
2013-03-22 Kazunori INOUE <inouekazu@intellilink.co.jp>
IPC: fix the connection state checking
2013-03-20 Angus Salkeld <asalkeld@redhat.com>
LOG: copy the function/filename for dynamic callsites
callsites originate from the assumption that the function/filename/format
are all statically allocated. When moving to dynamic callsite we kept
this assumption. But people are now passing in function/file names that
later get free'd. So we need to make sure that they stay persistant by
allocating them ourselves.
2013-03-12 Angus Salkeld <asalkeld@redhat.com>
Deal with /dev/shm issue on Travis builders
https://github.com/travis-ci/travis-cookbooks/issues/155
Properly discover SO_NOSIGPIPE and MSG_SIGNAL
bug #57
IPC: fix call to QB_SUN_LEN
2013-03-07 Angus Salkeld <asalkeld@redhat.com>
list: don't splice empty lists onto the head.
fixes bug #56
2013-02-19 Angus Salkeld <asalkeld@redhat.com>
rpl_sem: make destroy more compliant
don't block completely on the sem_wait(), but chop the waits
into 1 sec blocks so the destroy can have an opertunity to complete.
fixes bug #55
2013-02-18 Angus Salkeld <asalkeld@redhat.com>
test: fix unused-but-set-variable warning
test: fix missing-format-attribute warning
RB: make the "sem" abstraction into a notifier
IPC: clean up the connection state checking
Use dgram sockets for message oriented communications
This is to prevent partial sends and gettting stuck in
retry loops.
IPC: don't interpret EMSGSIZE and ENOMSG as a disconnect
POLL: prevent a spin if the fd is not removed from the mainloop
add TAGS and ~ files to .gitignore
2013-02-13 Angus Salkeld <asalkeld@redhat.com>
docs: install qb-blackbox.8 if doxygen is not available.
fixes bug #54
2013-02-06 Angus Salkeld <asalkeld@redhat.com>
IPC: seperate ipc_us.c into 2 files
Seperate into a setup file and a socket backend file, it was getting messy
and confusing. Also preparing for using DGRAM sockets.
This should not result in any logical changes.
IPC: move utility functions to unix.c
2013-01-25 Angus Salkeld <asalkeld@redhat.com>
IPC: make sure we return a consistent error when the message is too big.
2013-01-17 The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
Bump the version to 0.14.4
2013-01-17 Angus Salkeld <asalkeld@redhat.com>
LOG: prevent the last char of the blackbox message from getting lost.
2013-01-15 Angus Salkeld <asalkeld@redhat.com>
Example: make the blackbox example more practical.
2013-01-14 Angus Salkeld <asalkeld@redhat.com>
Merge pull request #52 from miz-take/prototype
Add the processing which remove notifier at skiplist_destroy function
2013-01-14 Takeshi MIZUTA <miz.take4@gmail.com>
Add the processing which remove notifier at skiplist_destroy function
2013-01-13 Angus Salkeld <asalkeld@redhat.com>
Merge pull request #51 from miz-take/prototype
Add the processing which remove hash node and notifier at hashtable_destroy function
2013-01-13 Takeshi MIZUTA <miz.take4@gmail.com>
Add the processing which remove hash node and notifier at hashtable_destroy function
2013-01-10 Angus Salkeld <asalkeld@redhat.com>
Merge pull request #50 from miz-take/prototype
Unify to QB_TRUE/QB_FALSE a boolean value
2013-01-10 Takeshi MIZUTA <miz.take4@gmail.com>
Unify to QB_TRUE/QB_FALSE a boolean value
2013-01-10 Angus Salkeld <asalkeld@redhat.com>
Document the default prefix in INSTALL
2013-01-09 Angus Salkeld <asalkeld@redhat.com>
Merge pull request #49 from miz-take/prototype
Unify the list processing with qb_list function
2013-01-08 Takeshi MIZUTA <miz.take4@gmail.com>
Unify the list processing with qb_list function
2013-01-08 Angus Salkeld <asalkeld@redhat.com>
Add travis link to the readme.
2013-01-06 Angus Salkeld <asalkeld@redhat.com>
Merge pull request #48 from miz-take/prototype
Fix return code which is an error occurred at pthread function
2013-01-05 miz-take <miz-take4@gmail.com>
Fix return code which is an error occurred at pthread function
2013-01-04 Angus Salkeld <asalkeld@redhat.com>
TEST: add a progam to compare the speed of vsnprintf and qb_vsnprintf_serialize
On my system I get:
qb store] Duration: 8.289 OPs/sec: 1206381.250
snprintf] Duration: 16.712 OPs/sec: 598368.000
LOG: add a test for a padded hex int.
Fedora's splint has a strange syntax error, don't fail on it.
LOG: fix truncation in some messages that get padded.
2012-12-18 Angus Salkeld <asalkeld@redhat.com>
Fix the blackbox formatter when specifing the string len/precision
Fix strlcpy and strlcat functions
These were not behaving as the man pages described.
2012-12-09 Angus Salkeld <asalkeld@redhat.com>
IPC: don't over log on disconnect
Thanks grueni: https://github.com/asalkeld/libqb/pull/43
Make sure we don't use the format string whilst it is getting changed.
Just add a rwlock around the usage.
Move qb_log_format_set() to log_format.c to make this easier.
Fixes #45
2012-12-06 Angus Salkeld <asalkeld@redhat.com>
ptrie: deref the current node in trie_iter_free()
If free'ing the iterator before getting to the last
node make sure we de-ref the current node. Else we
will not be able to delete the node.
fixes #44
2012-11-29 Angus Salkeld <asalkeld@redhat.com>
LOG: fix the format comparison to avoid generating multiple entries.
2012-11-22 Angus Salkeld <asalkeld@redhat.com>
LOG: set the return code when calloc fails
2012-11-12 Angus Salkeld <asalkeld@redhat.com>
IPC: call poll if we are mid message and get EAGAIN
So just manually call us_ready (poll) with a timeout of 50ms
to prevent cpu spin.
Also update qb_ipc_us_recv() to be simerlar.
2012-11-08 Angus Salkeld <asalkeld@redhat.com>
Remove extra ";"
IPC: set the error more correctly when qb_sys_mmap_file_open() fails.
Make sure that mmap'ed files smaller than a page size are written to.
This is a test to make sure that there is actually enough memory
to back the requested shared memory.
example/test: check for error in qb_ipc_run()
Hopefully all of them this time.
example: check for error in qb_ipc_run()
2012-10-29 Angus Salkeld <asalkeld@redhat.com>
TEST: fix typo s/,/; in check_ipc.c
2012-10-28 The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
Bump the library version.
2012-10-23 Andrew Beekhof <andrew@beekhof.net>
IPC: Pass the timeout to poll() if the recv function returns EAGAIN
2012-10-23 Angus Salkeld <asalkeld@redhat.com>
LOG: make the format comparison safe and sane
LOG: don't break on empty callsites, just ignore them
else we might miss some callsites.
LOG: use the array callback to register new callsites
array: add a mechanism to get a callback when a bin is allocated
2012-10-22 Angus Salkeld <asalkeld@redhat.com>
Solaris based operating systems don't define MSG_NOSIGNAL and SO_NOSIGPIPE.
They return SIGPIPE when send is used with a closed socket. A SIGPIPE handler
must be used or SIGPIPE should be set ignored with SIG_IGN. In this case send
returns -1 instead of a SIGPIPE. The setting to ignore SIGPIPE is global and
should be used only where it is absolutely necessary.
2012-09-12 Angus Salkeld <asalkeld@redhat.com>
Fix a crash in ptrie if you iterate over the map in the deleted notifier.
2012-09-11 Angus Salkeld <asalkeld@redhat.com>
Make sure atomic's are initialized (for non-gcc atomic).
2012-09-10 The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
Fix "make distcheck"
Bump the version to 0.14.2
2012-09-07 Виноградов Василий <wmdlr@yandex.ru>
Get libqb building on cygwin.
2012-09-06 Angus Salkeld <asalkeld@redhat.com>
Merge pull request #42 from jsgf/master
Three fixes for ipc_us.c
2012-09-06 Jeremy Fitzhardinge <jeremy@exablox.com>
ipc_us: slightly more robust cmsg handling
Cope with multiple cmsg structures in the received msg.
ipc_us: on Linux, set SO_PASSCRED on the sending socket too
Linux doesn't pass credential information by default, only when it has
been specifically requested with SO_PASSCRED. This means there's a
race between when the ipc server side has set up and is listening on the
socket, and when the client may connect; if the client connects and sends
its first message before the server has set SO_PASSCRED on the socket,
then there will be no ucred information associated with the message.
The fix is to set SO_PASSCRED on the client socket as well, so that
the message will always have a ucred associated with it when the server
reads it.
Without this change, around 1% of cpg_model_initialize() calls fail
with CS_ERR_ACCESS.
(This Linux behaviour was introduced just on a year ago in
16e5726269611b71c930054ffe9b858c1cea88eb "af_unix: dont send
SCM_CREDENTIALS by default".)
ipc_us: clear request unused fields
Clear unused request fields and padding so that valgrind doesn't complain
about undefined data being sent over the socket.
2012-09-05 Andrew Beekhof <andrew@beekhof.net>
TEST: Include writing and reading the blackbox in the log_long_msg test
2012-09-05 Angus Salkeld <asalkeld@redhat.com>
LOG: fix qb_vsnprintf_deserialize()
the strlcat was not call correctly, it needs the
original string to find the end and return the
correct length.
2012-09-01 Angus Salkeld <asalkeld@redhat.com>
Merge pull request #41 from jsgf/master
Fix some 64-bit big-endian issues
2012-08-31 Jeremy Fitzhardinge <jeremy@goop.org>
blackbox: fix 64-bit big-endian issues
Two issues:
1. when writing out the function name length, don't just write the 4 MSB
of the size
2. when reading the time, don't just use the 4 MSB of the time as the
timestamp; the log contains a full time_t, so we may as well use it.
2012-08-31 Angus Salkeld <asalkeld@redhat.com>
Remove IPC_NEEDS_RESPONSE_ACK and turn off shm ipc on solaris
Define unix path max for openbsd
Only turn on ipc_needs_response_ack=yes for solaris
Hopefully I can kill this option.
Some improvements to kqueue usage.
2012-08-30 Angus Salkeld <asalkeld@redhat.com>
kqueue: drop log message to trace.
2012-08-29 Angus Salkeld <asalkeld@redhat.com>
Fix splint warning
openbsd requires netinet/in.h before arpa/inet.h
Avoid strcpy() use strlcpy() instead.
Fix kqueue complile warnings
openbsd doesn't have EBADMSG
openbsd has a different UNIX_PATH_MAX
103 other bsd's are 108
LOG: change qb_vsprintf_serialize() into qb_vsnprintf_serialize()
This is to prevent overwriting the ringbuffer.
Also remove stpcpy() as it is not used anymore.
TEST: increase timeout to 6 secs as the recv timeout is 5 secs
TEST: get the logic right - grrr.
Turn off attribute_section on netbsd
Some missing pshared semaphore checks
Cleanup the checks for pshared semaphores
Add a config check for pthread_mutexattr_setpshared
Not available on netbsd
2012-08-28 Angus Salkeld <asalkeld@redhat.com>
Remove uses of timersub and use qb_util_stopwatch
RB: change the #error to ENOTSUP if no usable shared process sem
This is mainly on mac.
LOOP-KQUEUE: fix reference before assignment.
2012-08-27 Fabio M. Di Nitto <fdinitto@redhat.com>
build: fix libqb.pc creation and make maintainer-clean
LIB_RT is unnecessary around. AC_CHECK_LIBS will do the right thing
similar for the other libs that are all exported via LIBS
2012-08-27 Angus Salkeld <asalkeld@redhat.com>
LOG: Make sure the semaphores are initialized.
2012-08-24 Fabio M. Di Nitto <fdinitto@redhat.com>
build: remove bashism in cc support check
this is required for all systems that don't use bash for /bin/sh
2012-08-24 Angus Salkeld <asalkeld@redhat.com>
Catch disconnected sockets on Solaris
It seems like poll() was not producing a POLLHUP
so we rely on qb_ipc_us_recv() returning -ENOTCONN.
2012-08-23 Angus Salkeld <asalkeld@redhat.com>
Merge pull request #40 from jsgf/master
Merge Jeremy's clang bugfixes.
2012-08-23 Jeremy Fitzhardinge <jeremy@exablox.com>
Don't free rb->shared_hdr in qb_rb_create_from_file()
Since qb_rb_close() frees it by munmapping it.
Check error return of qb_ipcs_uc_recv_and_auth()
If it fails, then &ugp isn't initialized.
2012-08-23 Andrew Beekhof <andrew@beekhof.net>
Fix removal of automatically installed doc files when building rpms
2012-08-22 Angus Salkeld <asalkeld@redhat.com>
Add the mailing list to the travis email notifications.
Work around debian not setting the arch path in splint.
So just adding both i386 and x86_64 to the path.
Ref: http://lists.gnu.org/archive/html/gpsd-dev/2012-05/msg00221.html
Remove color-tests and parallel-tests automake options.
This is just too painful for buildsystems like koji and travis.
You can't get access to the detailed output (error logs) that
otherwise be printed to screen.
I can't find a way to disable them on the command line (that
would be the best solution).
Add travis continuous integration config
2012-07-20 Angus Salkeld <asalkeld@redhat.com>
Merge pull request #39 from davidvossel/log_tag_fix
LOG: Invoke custom log filter function if tag changes
2012-07-19 David Vossel <dvossel@redhat.com>
LOG: Invoke custom log filter function if tag changes
2012-07-18 Jim Meyering <jim@meyering.net>
tests/rbwriter: don't ignore write failure
Here's another fix.
In adjusting the printf, I added a cast and switched to %5ld.
I would have preferred to use %5jd as the printf format (i.e., then no
cast is needed), but saw no other uses of the "j" directive, so perhaps
you do not yet depend on printf with such support.
From 6d5d3af35d1f6851537f7af8996d1106c1ebe435 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Wed, 18 Jul 2012 17:54:38 +0200
Subject: [PATCH] tests/rbwriter: don't ignore write failure
Spotted by coverity:
This less-than-zero comparison of an unsigned value is never true.
"res < 0U".
http://libqb.org/html/0.14.1/coverity/1/7rbwriter.c.html#error
ipcs: avoid use-after-free for size-0 || disconnect-request
Hi,
Glancing through coverity-reported issues,
I saw that this one required attention:
From 70f1f689022321710405f16dc45b3df30c22bc59 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Wed, 18 Jul 2012 17:34:17 +0200
Subject: [PATCH] ipcs: avoid use-after-free for size-0 || disconnect-request
spotted by coverity:
http://libqb.org/html/0.14.1/coverity/1/265ipcs.c.html#error
2012-07-17 The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
Bump the version to 0.14.1
2012-07-17 Angus Salkeld <asalkeld@redhat.com>
RB: set the new read pointer after clearing the header.
This is to prevent a situation where a fast writer will
write their new chunk between setting the new read pointer
and clearing the header.
RB: improve the debug print outs
RB: be more explicit about the word alignment
RB: cleanup the macros for wrapping the index
RB: use sem_getvalue as a tie breaker when read_pt == write_pt
RB: if read or peek don't get the message then re-post to the semaphore
RB: convert the rb_peek() status into a recv like status.
peek returns 0 on no data, so convert that to -EAGAIN.
RB: use internal reclaim function
IPC: use calloc instead of malloc to fix valgrind warnings
This is to cleanup some valgrind warnings.
2012-07-14 Angus Salkeld <asalkeld@redhat.com>
Upgrade the doxygen config.
The new doxygen says SHOW_DIRECTORIES is deprecated.
Fix a valgrind error.
just use the receive buffer, as it will be big enough.
2012-06-22 The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
Bump the version to 0.14.0
2012-06-14 Angus Salkeld <asalkeld@redhat.com>
LOG: fix threaded logging.
This has been broken for a year - yikes!
Thanks to Voznesensky Vladimir for spotting it.
2012-06-12 Angus Salkeld <asalkeld@redhat.com>
Add user control of the permissions that are set on the shared mem files
2012-06-07 Andrew Beekhof <andrew@beekhof.net>
LOG: Restrict string trucation during serialization to when a precision is specified
LOG: Gracefully fail when the caller exceeds QB_LOG_MAX_LEN
LOG: Observe field widths when serializing string arguments
2012-06-07 Angus Salkeld <asalkeld@redhat.com>
RB: use the same mechanism in reclaim as read/peek to detect end-of-ring
2012-06-06 Angus Salkeld <asalkeld@redhat.com>
Add needs_response_ack option to ./check
RB: fix wrong sem_flg IPC_NOWAIT option
The #ifdef was the wrong way around causing
the sem to return early with EAGAIN.
TESTS: fix warning about unused functions
Remove D_FORTIFY_SOURCE from check.
Can't seem to get this to work on F17.
Open shared mem file in /dev/shm only for linux
Don't use msg_flags on solaris (recvmsg).
Turn off attribute_section on solaris
ipc example: add -e (events) option
use events instead of responses
IPC: if the server returns EAGAIN or ETIMEOUT the check the connection
Mainly useful for shm, as the ringbuffer doesn't know the state
of the connection.
2012-06-05 Angus Salkeld <asalkeld@redhat.com>
LOG: make it possible to fsync() on each file log.
2012-06-04 Angus Salkeld <asalkeld@redhat.com>
IPC: make sure that the created callback happens before dispatches
This only happened on the socket ipc type.
LOG: fix the printing of %p in the blackbox
2012-06-01 Angus Salkeld <asalkeld@redhat.com>
IPC: On bsd's use the notifier for responses
The point of this is to catch connection failures
more reliably.
IPC: interpret ECONNRESET and EPIPE as ENOTCONN
2012-05-31 Angus Salkeld <asalkeld@redhat.com>
cleanup some warnings
config: use newer AC_COMPILE_IFELSE()
2012-05-28 Angus Salkeld <asalkeld@redhat.com>
blackbox: fix %p formatting
LOG: put all fields in the blackbox (added priority and tags)
Fixes #36
example: make the priority uint8_t
Remove strerror out of check_funcs
We only use strerror_r
RB: fix compiler warning.
Add replacement function stpcpy
Add missing AC_TYPE_UINT16_T to configure.ac
Use AC_FUNC_STRERROR_R and STRERROR_R_CHAR_P
Add stpcpy strcasecmp to the check_funcs
Move some conditional defines into code (from the configure script)
Remove some unused configure checks
Remove message queues
Check for union semun properly
Blackbox: provide more space for log messages when reading from the blackbox.
This is to allow for the header (16bytes and variable length function).
so if someone has a function name > 400 chars it will break. I
recon that will do:)
2012-05-28 Andrew Beekhof <andrew@beekhof.net>
Add the blackbox reader manpage to the spec file
Enable error logging for the blackbox reader
RB: Read the file size into an initialized variable of the correct size
2012-05-28 Angus Salkeld <asalkeld@redhat.com>
Add a tool to dump the blackbox.
2012-05-25 Angus Salkeld <asalkeld@redhat.com>
RB: to be safer save the read and write pointers at the top of the blackbox
2012-05-24 Jim Meyering <jim@meyering.net>
avoid unwarranted use of strncpy: use memcpy instead
* lib/log_format.c (qb_vsnprintf_deserialize): We know that there are
len or more non-NUL bytes in the source string, so it's clearer to
use memcpy.
2012-05-24 Angus Salkeld <asalkeld@redhat.com>
blackbox: fix the print_from_file()
RB: add an option to not use any semaphores
(brought over from the "speed" branch)
LOG: tweak the blackbox format string
LOG: accept NULL strings into the blackbox
LOG: protect close and reload from calling log
Logging during these operations is temporarly disabled.
2012-05-20 Angus Salkeld <asalkeld@redhat.com>
Add benchmark option (-b) to examples/ipcclient
TEST: make rbreader/writer more like the other benchmarking apps
2012-05-16 Angus Salkeld <asalkeld@redhat.com>
IPC: log the connection description in all logs
TEST: re-organise the ipc test suites
IPC: only modify the dispatch if we get EAGAIN
2012-05-12 Jan Friesse <jfriesse@redhat.com>
Correctly display timestamp in blackbox
On little endian architectures where time_t is 64-bit long integer could
happen, that instead of displaying correct timestamp, random data was
used, because of memcpy.
Solution is to memcpy to real 32-bit variable and then assing this value
to timestamp. This will let compiler decide endianity and store number
correctly.
2012-05-10 Angus Salkeld <asalkeld@redhat.com>
Add a more verbose version of the library versioning text.
Bump the library version to 0.13.0
Remove unneccessary __attribute__ ((aligned(8))) from internal headers
IPC: add a new function to get (and alloc) the extended stats.
This should handle any further additions to the stats
as the library allocs the struct.
Revert "Add the event queue length to the connection stats."
This reverts commit 6b7da3f5315473c05b5939903d97be2e8ade4c8c.
IPC: cleanup better on a failed client connect.
IPC(soc): be more consistent with control struct size
IPC: kill a compiler warning
IPC(soc): pass in the correct size into munmap()
2012-05-10 The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
Bump the lib version to 0.12.0
2012-05-10 Angus Salkeld <asalkeld@redhat.com>
TEST: Use /bin/sh not /bin/bash
TEST: check for lost shared mem on bsd too
rb: cleanup the semaphores
- the way they are selected
- rpl_sem.c the error handling
Fix some small issues in ./check
2012-05-09 Angus Salkeld <asalkeld@redhat.com>
Cleanup the .gitignore files
configure.ac tweaks
Thanks again to Igor Pashev.
Remove HZ and use sysconf instead.
SUN_LEN() macro is present if __EXTENSIONS__ is defined on Illumos
A bit reworked but originally from Igor Pashev:
https://github.com/ip1981/libqb/commit/84c47f8160a9a78f068cc5b0d40b3901c065cfa2
Note: __EXTENSIONS__ also defines _GNU_SOURCE, so removing it as well.
2012-05-09 Igor Pashev <pashev.igor@gmail.com>
PF_UNIX is a POSIX standard name
Test for log facility names
2012-05-09 Angus Salkeld <asalkeld@redhat.com>
IPC: drop log message to debug.
this can be noisy when there are a lot of transient
connections.
2012-05-03 Angus Salkeld <asalkeld@redhat.com>
IPC: fix retrying of partial recv's and sends.
Move to send() instead of sendmsg() as it's easier
to track resending partial messages.
2012-05-02 Angus Salkeld <asalkeld@redhat.com>
IPC: initialize enough shared mem for all 3 one way connections.
IPC: keep retrying to recv the socket message if partially recv'ed (part 2)
IPC: keep retrying to recv the socket message if partially recv'ed
IPC: handle the server shutdown better
IPC: handle a connection disconnect from the server better
Only problem with SOCKET.
2012-05-01 Angus Salkeld <asalkeld@redhat.com>
IPC: make it possible to send events in the connected callback.
This was only a problem with QB_IPC_SOCKET.
Add the event queue length to the connection stats.
IPC: add a is_connected client side function.
Fix typo in ./check
docs: clarify the need to use request/response headers
Remove unused local variable
2012-04-30 Angus Salkeld <asalkeld@redhat.com>
IPC: change the socket recv function to read the response header.
It needs to only recv the size of this message, else we recv more
than one message and effectively drop messages (hidden at the end
of the current message).
Add some special commands into the ipc example
type "events" and the server will send 10 events.
type 'kill' into the client and this will simulate the server dying.
TEST: improve the tracing in the ipc tests.
2012-04-30 Andrew Beekhof <andrew@beekhof.net>
Make "make (s)rpm" work more reliably
Make sure the version number is re-calculated on each run.
2012-04-30 Angus Salkeld <asalkeld@redhat.com>
TEST: add a test to confirm we get the events we send.
TEST: reuse send_and_check for events.
2012-04-29 Angus Salkeld <asalkeld@redhat.com>
IPC: make it possible for a root client to talk to a non-root server.
2012-04-26 Angus Salkeld <asalkeld@redhat.com>
Run ./Lindent in the examples directory
Add some debug code to the ipcclient example
IPC: make sure ipc (socket) clients can connect to a server running as root.
2012-04-23 Angus Salkeld <asalkeld@redhat.com>
IPC: allow qb to bump the max_message_size
I think this is more user friendly.
IPC: check for a sane minimum max_message_size
add rpl_sem.h loop_poll_int.h to noinst_headers
2012-04-04 Angus Salkeld <asalkeld@redhat.com>
Handle errors more consistently
call recv_ready on socket types
Handle a recv of size 0
make bsd shm path better by default.
Fix kqueue on freebsd.
Get the example socket includes right.
2012-04-03 Angus Salkeld <asalkeld@redhat.com>
Fix kqueue compiling.
POLL: seperate out the poll/epoll and add kqueue
2012-04-03 Jan Friesse <jfriesse@redhat.com>
Test existence of getpeer* functions
Add inet header to tcpclient example
Don't link with setpshared if unavailable
NetBSD doesn't have semun defined
2012-03-27 Jan Friesse <jfriesse@redhat.com>
Use MADV_NOSYNC only on systems where available
Use SCHED_BATCH only on platforms where available
2012-03-27 Angus Salkeld <asalkeld@redhat.com>
Fix a bug introduced by the bsd patch.
I missed the non-native case.
Cleanup the selection of semaphores to use
Fix some leaks in the logging.
Mainly for valgrind purposes.
2012-03-24 Angus Salkeld <asalkeld@redhat.com>
Try and improve the portability on bsd variants.
Also add a QB_IPC_NATIVE type that selects the best ipc type available.
2012-03-11 The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
Bump the version to 0.11.1
2012-03-09 Angus Salkeld <asalkeld@redhat.com>
LOOP: remove some old timerfd code.
TEST: add a test to check the order of the jobs
LOOP: when new jobs are added they are added to the head instead of the tail.
We must add new jobs to the tail of the job queue otherwise
old jobs will get stuck in the job list.
LOG: Now the array is self locking we can make the lookup array dynamic
Add locking to the array when growing.
IPC: make the _request_q_len_get() function more obvious.
IPC: fix multiple receives from qb_ipc_us_recv()
So this function is used by the QB_IPC_SOCKET transport
and is used like recv(,, max_size_of_my_rx_buf,,);
But in the shared mem transport it is used to recv
a notification of something in shared mem is available
in this case we really want to make sure we recv all
the notifications. So I have split these into 2 functions.
IPC: make sure that the wrong union member is not written to.
Move the connection type into the one_way struct. Seem
like a more obvious place for it next to the union.
Also it will help prevent issues like in qb_ipc_us_recv()
where there is a rather dodgy access of ctl->sent.
TIMER: check for null timer handle
2012-03-07 The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
Bump the version to 0.11.0
2012-03-07 Angus Salkeld <asalkeld@redhat.com>
ARRAY: cleanup the pointer sizeof()
LOG: turn off __attribute__(section) for powerpc (not working)
TESTS: move the util tests into "slow-tests" (i.e. optional)
So this this test is timing sensitive and can easily fail on slow
build farm machines. So I have enabled it on the --enable-slow-tests
configure option and put this into ./check as the default.
TEST: make the test_priority the same type as in the callsite
LOG: make the log arrays manually grow-able since we need to lock the calls.
RB: fix test failure on ppc
2012-03-06 Angus Salkeld <asalkeld@redhat.com>
RB: change the name of the size to word_size to be more clear
TEST: add some more signal tests.
-Make sure we only get one callback per signal
-Make sure we correctly delete a callback even if it has been
put in the job queue.
LOOP: fix deletion of signal handlers when they are pending
LOOP: signal handlers were always added as high priority.
This now adds them as requested by the user.
2012-03-05 Angus Salkeld <asalkeld@redhat.com>
TEST: deal with mac's limited sed
check: add debugging to the configure options and remove unused options
TEST: properly clear the filters
LOG: expose the mechanism to get a dynamic callsite.
2012-02-24 Angus Salkeld <asalkeld@redhat.com>
Revert part of my COARSE grained timer commit
The stopwatch and timers use qb_util_nano_current_get()
and need to be accurate. This does't seem to effect
performance at all so no loss there.
Remove timerfd usage and go back to timelist.
timefd is using too much cpu and it is using up
file descriptors.
timelist is also more portable and now I have less
code to maintain.
UTIL: if possible use COARSE resolution clocks - they are much faster.
2012-02-22 Angus Salkeld <asalkeld@redhat.com>
ARRAY: save memory (in the bins array) and allow holes in the array
LOOP: add qb_loop_timer_is_running()
2012-02-20 Angus Salkeld <asalkeld@redhat.com>
LOOP: allow stop() and run() to be called with NULL loop instance.
LOOP: fix doxygen parameter comment
LOG: add stdout target
2012-02-15 Angus Salkeld <asalkeld@redhat.com>
LOOP: add a function to delete jobs
LOG: remove debug printf's
LOG: remove an old/incorrect doxygen comment.
LOG: add a hostname %H format specifier.
This is useful when logging to file on a cluster.
LOG: Add qb_log_filter_fn_set()
2012-02-14 The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
Fix "make distcheck" add include path to AM_CPPFLAGS
strl* files are built a bit differently and need the global
flags
Bump the version to 0.10.1
2012-02-14 Angus Salkeld <asalkeld@redhat.com>
clang: Remove unused code
TEST: make the ipc failure test closer to corosync's case.
RB: add a debug message if trying to read a message of the wrong size
IPC: split up the recv into chuncks of 2 seconds.
This is because semaphores can't detect the other side has
failed/exited. So we rely on the socket poll to tell us.
Be more consistent with the internal logs.
2012-02-10 Angus Salkeld <asalkeld@redhat.com>
LOOP: make it possible to pass in NULL as the default loop instance
2012-02-08 Angus Salkeld <asalkeld@redhat.com>
RB: use the proper struct not the typedef in the implementation.
RB: Fix potential mem leak
Don't mix enums (QB_TRUE/TRUE)
use random() not rand()
Remove dead code
set umask before calling mkstemp()
Use safer versions of string functions (strcpy -> strlcpy)
Increase the coverity aggressiveness
TEST: make the loop ratelimit test more forgiving.
2012-02-07 The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
Bump the lib version to 0.10.0
2012-02-06 Angus Salkeld <asalkeld@redhat.com>
LOOP: handle errors from the poll function
LOOP: make the item type applicable to jobs too.
Mainly for diagnostics
LOOP: fix the todo calculations.
The todo system was sucky as it was calculated in different
places in the mainloop and at each level. This was exposed by
calls to qb_loop_level_item_del() which decremented the level->todo
but not the mainloop one. So now we re-calculate it each time.
TEST: check for a single job causing a cpu spin
LOOP: prevent jobs from consuming too much cpu.
2012-02-03 Angus Salkeld <asalkeld@redhat.com>
Get coverity to ignore this warning.
"Using uninitialized element of array"
Change example code to use fgets instead of gets
LOG: pass the result of qb_log_thread_start() back to the user
Fix some issues found by clang
Add clang-analyzer check
2012-02-01 Angus Salkeld <asalkeld@redhat.com>
Add a split timer to the stopwatch.
This is just a re-work of Steve's sample patch.
You set the number of splits and whether they overwrite using
qb_util_stopwatch_split_ctl().
2012-01-31 Angus Salkeld <asalkeld@redhat.com>
IPC: merge common code into new function
This also fixes a regression caused by:
42c92fb675a29bb1ec9f718c17daede82d5de3e2
IPC: better handle a disconnect been called from within connection_created()
2012-01-27 Angus Salkeld <asalkeld@redhat.com>
IPC: fix scary typo
Not sure how this happened
IPC: fix server error handling
2012-01-26 The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
TEST: Make sure the generated files have the correct include paths
Bump the library version to 0.9.0
2012-01-25 Angus Salkeld <asalkeld@redhat.com>
PTRIE: refcount the notifier structs
This fixes: https://github.com/asalkeld/libqb/issues/29
2012-01-24 Angus Salkeld <asalkeld@redhat.com>
LOG: make sure qb_log_from_external_source() takes priority into account.
Fixes: https://github.com/asalkeld/libqb/issues/28
Deprecate qb_util_set_log_function()
And remove uses of it from the test programs
2012-01-23 Angus Salkeld <asalkeld@redhat.com>
LOG: only bump messages that need it (>info)
else all the messages get their priorities distorted
LOOP: allow a timer to be created without returning the handle
This is if the user does not plan to delete the timer.
2012-01-22 Angus Salkeld <asalkeld@redhat.com>
IPC: this 1 sec wait is slowing all normal dissconnects down
this works just as well with a timeout of 0
2012-01-21 Angus Salkeld <asalkeld@redhat.com>
IPC: check for the server liveness before disconnecting.
if the server is dead then is_connected will cause the resourses
to be properly cleaned up.
2012-01-18 Angus Salkeld <asalkeld@redhat.com>
TESTS: add tests for signal handlers
IPC: add a context to the client interface
2012-01-17 Angus Salkeld <asalkeld@redhat.com>
LOG: make sure the format is checked.
In case of log clashes (same file/lineno but in different directories.
TEST: make sure qb_log() can be called before init.
The log is dropped but it won't crash.
2012-01-16 Angus Salkeld <asalkeld@redhat.com>
make the pc file auto detect -lrt
Add a test to enforce standalone headers and protectors
Make all headers self standing
So the user does not have to include any required headers.
make header protection more consistent.
TEST: change the script to .sh and generated c file to auto_
Just to make cleanup easier
2012-01-12 Angus Salkeld <asalkeld@redhat.com>
IPC: fix resource cleanup if the server dies
2012-01-11 Angus Salkeld <asalkeld@redhat.com>
ipc test: remove try again hack
This was needed because I didn't realise the timeout was broken.
(at least this works now)
Fix check_ipc.c formatting.
2012-01-09 Angus Salkeld <asalkeld@redhat.com>
LOG: add %P (pid) as a format option.
LOG: add %N (log name) as a format option
This will log the name passed into qb_log_init()
2012-01-08 Angus Salkeld <asalkeld@redhat.com>
UTIL: fix qb_timespec_add_ms()
It was overwriting the timespec value instead of
add to it.
2012-01-05 Angus Salkeld <asalkeld@redhat.com>
LOG: make it possible to pass in a NULL filename/function into qb_log_from_external_source()
2012-01-05 The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
Bump the library version.
2012-01-05 Angus Salkeld <asalkeld@redhat.com>
ipc: make coverity happy.
Fix two simple coverity warnings
trie: correct the free'ing of node mem
Fix ./check -h output
map: free unused leaf nodes
So if a node has no children and no value or notifier
then it is freed.
2012-01-04 Angus Salkeld <asalkeld@redhat.com>
Allow the array to automatically grow.
this makes it a bit friendlier to use, as
the user will not have to call qb_array_grow().
map: add some introductory doxygen
2012-01-03 Angus Salkeld <asalkeld@redhat.com>
IPC: remove fd from poll loop in the disconnect
Until now we have been relying on getting a POLLHUP, but
under heavy load we seem to get an old poll event
that cause a double deref of the connection object.
IPC: add a new state to the connection state
This to handle disconnecting in a failure state (before
the connection has been established.
Another aspect to this is we don't want to call
connection_destroyed() if we haven't called
connection_created().
2011-12-28 Yunkai Zhang <qiushu.zyk@taobao.com>
Fixed bug: incorrect array length definition
When MAX_BINS is larger than MAX_BIN_ELEMENTS, this bug will cause
boudary overflow in qb_array_create function.
2011-12-22 Fabio M. Di Nitto <fdinitto@redhat.com>
Fix a compile warning on sparc (epoll_create1)
The problem is that sys/epoll.h was broken on sparc and alpha for a
bunch of glibc releases.
glibc has the symbol correctly exported, that's why ./configure finds
it, but the header is not always correct. Recent versions of glibc have
the correct header, so we simply workaround the broken ones.
This fix is only necessary to build with --enable-fatal-warnings,
otherwise you simply see a build warning, but there are no runtime
issues at any stage.
2011-12-22 Angus Salkeld <asalkeld@redhat.com>
re-fix qb_strerror_r() in case caller frees buf.
2011-12-22 Fabio M. Di Nitto <fdinitto@redhat.com>
Fix some sparc test failures.
I (Angus) have changed some of Fabio's changes.
2011-12-21 Andrew Beekhof <andrew@beekhof.net>
LOG: pass args directly into qb_log_from_external_source()
2011-12-21 Angus Salkeld <asalkeld@redhat.com>
check: add mac checker
Merge some portability changes from the mingw branch
Re-add new automake options
I like the automake options (and encourage other developers to
install the neccessary autotools).
Here is a handy script to install the newest autotools
into a private directory (if you can't get them pre-packaged).
http://people.redhat.com/meyering/autotools-install
autotools-install --prefix=$HOME/autotools --skip-check
2011-12-19 Andrew Beekhof <andrew@beekhof.net>
Support compilation on Mac OSX
2011-12-19 Angus Salkeld <asalkeld@redhat.com>
make -rt configurable (not needed on mac)
Thanks to Andrew Beekhof
fix strerror on non-linux
2011-12-18 Angus Salkeld <asalkeld@redhat.com>
check: add abi & api to help
trie: don't create children array on all nodes
(save mem on leaf nodes)
map: tweek the tests to better test ptrie
trie: convert the trie to a patricia trie (or radix tree)
http://en.wikipedia.org/wiki/Radix_tree
The point of this is to save memory.
examples: add example corosync data to mapnotify.c
trie: add a way to get node count and mem usage
trie: split trie_lookup into trie_lookup and trie_insert
2011-12-16 Angus Salkeld <asalkeld@redhat.com>
clean .version .tarball-version
2011-12-13 Angus Salkeld <asalkeld@redhat.com>
IPC: provide finer grained flowcontrol
this will allow the user to control the behaviour better.
MAP: add honza's example application.
MAP: add a notifier purely to allow the user to free memory.
At the moment if you have multiple notifiers it becomes impossible
to figure out when it is safe to free the values.
This new callback can only be added once and is called
once, making it better suited to freeing memory. It is
also called after the deleted and replaced notifiers.
2011-12-07 Angus Salkeld <asalkeld@redhat.com>
Improve the stopwatch doxygen comments.
2011-11-25 Angus Salkeld <asalkeld@redhat.com>
Fix errors found by api-sanity-autotest
map: enforce uniqueness of the notifiers based on (func,key,event,userdata)
map: add qb_map_notify_del_2() which includes the userdata.
This allows you to match on the same fields that you provided
in the add. Now including the userdata.
skiplist: add the inserted notification
skiplist: implement skiplist_notify_del()
Hashtable: fix the ordering of the new/old value in the notification
Add tests for hash and skiplist notifications
By default don't build in the slow benchlog
2011-11-22 Angus Salkeld <asalkeld@redhat.com>
check: add abi checking script
2011-11-16 The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
Bump the library version to 0.7.0
2011-11-10 Angus Salkeld <asalkeld@redhat.com>
LOOP: free up the signal list when qb_loop_destory() is called
LOG: improve the removal of filters
LOG: clean up mem better when qb_log_fini is called
2011-11-09 Angus Salkeld <asalkeld@redhat.com>
ARRAY: make sure that num_bins stays below MAX_BINS
TEST: add a test that reproduces issue/20
https://github.com/asalkeld/libqb/issues/20
2011-11-08 Angus Salkeld <asalkeld@redhat.com>
Fix ./check -h output
2011-11-07 Angus Salkeld <asalkeld@redhat.com>
Lindent formatting changes.
LOOP: close opened pipe if function fails
LOG: change assert into an early return
Remove unnecessary checks before free()
MAP: Fix trie_new_node() and make skiplist_node_new() more consistent.
2011-11-07 miz-take <miz-take3@gmail.com>
Improve the error handling esp. after failed malloc's
Reviewed-by: Angus Salkeld <asalkeld@redhat.com>
2011-10-23 Angus Salkeld <asalkeld@redhat.com>
skiplist: destroy the list header last.
examples: add ipc client/server
examples: Add tcpclient.c/tcpserver.c
Move simple-log.c to examples/
TEST: fix the map load test.
LOG: check for SCHED_IDLE
LOG: fix filter input check
LOG: add stdarg to qblog.h
Add a ./check mock
2011-10-21 Angus Salkeld <asalkeld@redhat.com>
LOG: only range check "t" when filtering else tags are not applied.
2011-10-18 Angus Salkeld <asalkeld@redhat.com>
Log: move the lock to below the sem_wait
(coverity ordering warning)
check: add a handy coverity check
./check coverity
TEST: add a simple test for right-aligned text in format strings
2011-10-17 Andrew Beekhof <andrew@beekhof.net>
Log: Support right-aligned text in format strings
2011-10-17 Yunkai Zhang <qiushu.zyk@taobao.com>
Fixed segment fault bug when use logging API at i386 platform
This bug cause by qb_vsprintf_serialize function. It parse "%llx" format
as _long_ other than _long long_.
At x86_64 platform, both sizeof(long) and sizeof(long long) is 8, this
issue would not be triggered, so we could only catch it at i386.
2011-09-16 Angus Salkeld <asalkeld@redhat.com>
MAP: pass user_data to the callback correctly
2011-09-15 Angus Salkeld <asalkeld@redhat.com>
MAP: add a more generic notification system
2011-09-13 Angus Salkeld <asalkeld@redhat.com>
MAP: add prefix iteration for the trie
hashtable: fix the iterator
skiplist: fix order of deref
skiplist: use ++ and -- operators
MAP: improve the storage in the trie
TESTS: improve the map tests
- add a iterator to test_map_simple()
- improve the test output
2011-09-12 Angus Salkeld <asalkeld@redhat.com>
MAP: add a trie implementation
http://en.wikipedia.org/wiki/Trie
2011-09-09 Angus Salkeld <asalkeld@redhat.com>
LOG: allow large priorities
They will be printed as trace, it's mainly to make
filtering more flexible
LOG: add qb_log_filter_ctl2() so we can filter a range of priorities
2011-09-09 The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
Bump the library version.
2011-09-09 Angus Salkeld <asalkeld@redhat.com>
LOG: fix QB_LOG_INIT_DATA
this is weird, but now it actually works
2011-09-08 Angus Salkeld <asalkeld@redhat.com>
LOG: add a way of getting the target state
This is so we can do the following:
for (t = 0; t < QB_LOG_TARGET_MAX; t++) {
if (qb_log_ctl(t, QB_LOG_CONF_STATE_GET, 0) == QB_LOG_STATE_ENABLED) {
// bla bla
}
}
LOG: support comma seperated lists of file and function filters
2011-09-07 Angus Salkeld <asalkeld@redhat.com>
map: add iterator that does't use a callback
MAP: change the keys from void* to char*
I think this is the most common usage and greatly
simplifies the api.
LOG: add facility conversion functions
2011-09-01 Angus Salkeld <asalkeld@redhat.com>
LOG: fix the default syslog filter
2011-08-26 Angus Salkeld <asalkeld@redhat.com>
defs: better define va_copy
Fix "./check dist"
2011-08-25 Angus Salkeld <asalkeld@redhat.com>
hashtable: Fix a lint warning
2011-08-22 Angus Salkeld <asalkeld@redhat.com>
LOG: fix ansi build
Initial map using either a skiplist or a hashtable
Add a stop watch
docs: add utils to the mainpage
LOG: serialize the va_list, don't snprintf
2011-08-19 Angus Salkeld <asalkeld@redhat.com>
LOG: change active list into array access
just keep track of the max used targets
TEST: add int arguments to log bench
atomic: fix qb_atomic_pointer macros
2011-08-07 Angus Salkeld <asalkeld@redhat.com>
LOG: allow the thread priority to be set.
2011-07-19 Angus Salkeld <asalkeld@redhat.com>
Fix splint warning on ubuntu 11.04
2011-07-18 The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
Make sure write_logs.c is deleted by "make distclean"
2011-07-14 Angus Salkeld <asalkeld@redhat.com>
LOG: move priority check up to prevent unnecessary format.
Add a qb_strerror_r wrapper.
This is to make the calling code more portable
Remove TODO from dist_doc_DATA
2011-07-13 Angus Salkeld <asalkeld@redhat.com>
Delete TODO (use github issues)
Add some more content to the README
LOG: add string.h to qblog.h
2011-06-27 Angus Salkeld <asalkeld@redhat.com>
LOG: use strerror_r instead of strerror in qb_perror()
TEST: bump up the logging timeout
This was failing on sparcv9, but seems to just be a slow machine.
With a bigger timeout it passes.
2011-06-26 Angus Salkeld <asalkeld@redhat.com>
configure: improve arch & os detection output.
LOG: fix alignment compiler warning on sparc
Revert "LOG: use uint8_t for pointer manipulation"
This reverts commit a47ae0b6598f16189d55386ef9a3ad1cad204893.
2011-06-26 Jim Meyering <jim@meyering.net>
don't let an invalid time stamp provoke a NULL dereference
* lib/log_blackbox.c (qb_log_blackbox_print_from_file): Handle
localtime failure by printing the long-int representation rather
than a strftime-formatted one.
2011-06-23 Angus Salkeld <asalkeld@redhat.com>
Fix references to README
Change README into markdown to look better on github
2011-06-22 Angus Salkeld <asalkeld@redhat.com>
Change Lindent options to break the procedure type.
so change:
int foo(void)
to
int
foo(void)
LOOP: make the return more consistent in qb_loop_timer_expire_time_get()
If there is any error return 0
(meaning the timer is or has expired)
2011-06-21 Angus Salkeld <asalkeld@redhat.com>
LOG: use uint8_t for pointer manipulation
char changes size on different arches.
2011-06-20 Angus Salkeld <asalkeld@redhat.com>
IPC: use the correct pointer type.
Consistently prepend "qb-" to files in /dev/shm
Dietmar: can you confirm this works for you?
2011-06-07 The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
Update the library version to 0.5.0
2011-06-07 Angus Salkeld <asalkeld@redhat.com>
check: Change -s to --no-print-directory
Re-fix mmap() woes on sparc.
2011-06-03 Angus Salkeld <asalkeld@redhat.com>
Revert "Fix ringbuffer creation on sparc"
This reverts commit 683296f180fdd7b7834dc1506b7a192ae2684c04.
2011-06-02 Angus Salkeld <asalkeld@redhat.com>
Fix ringbuffer creation on sparc
On the first call to qb_rb_open() we try using a number of
page sizes. This because the system might have CONFIG_HUGETLB_PAGE_SIZE
defined in their kernel. So even though sysconf() returns 2K or 4K
some arch's mmap() require alignment on these boundaries.
TEST: some improvements to the check script to make it's output better.
It quietens the output and this makes it easier to understand the
results.
TEST: Fix ssize_t format compiler warning
Make building a bit quieter by default.
Fix "make dist".
The deps were not quite right with write_logs.c
Fix some spelling.
2011-05-31 Angus Salkeld <asalkeld@redhat.com>
TEST: remove failed server tests.
They now fail (because of 8880465924ce090365ee6b87c4d0c167c7deeb62).
We now need a smart way of detecting that a process is the
last one attached to the ringbuffer and free it.
TEST: initialize some globals before the test is run.
This is not strictly needed as each test is forked,
but is a bit more explicit.
TEST: fix the server shutdown.
The server was getting prematurently killed, and was
causing resource leakage. We now give the server a little
time to respond to the connection beiong closed.
TEST: add job_add poll_handler
TEST: name the ipc connections after the test functions
IPC: misc cleanup & logging improvements
IPC: make the setting the flowcontrol atomic
2011-05-30 Виноградов Василий <wmdlr@yandex.ru>
RB: More consistent behavior when closing a ringbuffer
2011-05-27 Виноградов Василий <wmdlr@yandex.ru>
Provide some helpful macros for iterating over lists.
2011-05-27 Angus Salkeld <asalkeld@redhat.com>
TEST: make the creation of write_logs.c atomic
2011-05-26 Angus Salkeld <asalkeld@redhat.com>
TEST: make sure make-log-test appends a bracket
Correct the declarations of some inlines
Add support for ansi inline and typeof
Remove all the C++ comments
Add an ansi option into ./check
Also included in ./check all
2011-05-24 Jim Meyering <jim@meyering.net>
qb_rb_write_to_file clean-up
* lib/ringbuffer.c (qb_rb_write_to_file): Remove dead initialization
and redundant "result < 0" tests.
adjust .gitignore so "git status" ignores all build artifacts
use latest git-version-gen from gnulib
2011-05-23 Angus Salkeld <asalkeld@redhat.com>
LOG: add custom targets
This is partly to make the tests more robusts and
to add some more flexibility to the logging.
2011-05-20 Angus Salkeld <asalkeld@redhat.com>
COV 15: fix potential reference after deref
COV 14: fix potential dereference after free()
COV 13: cleanup error handling in qb_util_circular_mmap()
COV 12: prevent unintialized value error in bmcpt
COV 10: fix mem leaks in qb_rb_create_from_file()
COV 9: fix mem leak in qb_rb_open error condition
COV 8: don't leak mem when returning an error.
COV 7: close file if for some strange reason it exists
COV 6: check for a failed sysconf() before calling malloc()
COV 4 & 11: cleanup error handling in handle_new_connection()
COV 3: remove dead code.
qb_rb_close() is called in the signal handler.
COV 2: fix unreachable code (move call to qb_ipcs_us_withdraw up)
COV 1: dead code - clean up ifdefs
2011-05-19 Angus Salkeld <asalkeld@redhat.com>
LOG: add a rwlock to protect the lists.
2011-05-18 Angus Salkeld <asalkeld@redhat.com>
Update the TODO
IPC: set the return status before cleaning up.
Fix the test dependancies (and "make rpm")
My first attempt at this broke "make rpm" - oops.
It seems that we need a common extension for tests to get the
dependancies to work.
fix the FIXME's Jim pointed out
2011-05-17 Jim Meyering <meyering@redhat.com>
avoid autoconf warning
Autoconf warned about this:
configure.ac:72: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE\
call detected in body
That's warning about the use via AC_COMPILE_IFELSE without
specifying a language. The easiest way to work around that is
to avoid the use of CC altogether and instead to use the preprocessor.
* configure.ac (cc_supports_flag): Use AC_PREPROC_IFELSE in place
of AC_COMPILE_IFELSE (and CPPFLAGS in place of CFLAGS).
2011-05-17 Jim Meyering <jim@meyering.net>
add FIXME comments for other NULL-deref-upon-OOM problems
* lib/ipc_us.c (handle_new_connection):
* lib/loop_job.c (qb_loop_jobs_create):
* lib/loop_poll.c (qb_loop_poll_create):
* lib/loop_timerlist.c (qb_loop_timer_create):
* lib/ringbuffer.c (qb_rb_open):
* lib/ipcc.c (qb_ipcc_connect): Likewise.
avoid NULL dereference after failed malloc
* lib/util.c (qb_thread_lock_create): Handle failed malloc.
* lib/ipc_posix_mq.c (qb_ipc_pmq_sendv): Likewise.
* lib/loop_job.c (qb_loop_job_add): Likewise.
* lib/loop.c (qb_loop_create): Likewise.
2011-05-17 Angus Salkeld <asalkeld@redhat.com>
make sure check_resources is the last test to run
http://www.gnu.org/s/hello/manual/automake/Simple-Tests-using-parallel_002dtests.html
2011-05-17 Jim Meyering <jim@meyering.net>
make the tests run in parallel
I ran "make check" in libqb and watched impatiently ;-)
as the tests ran in serial on my multi-core system.
If you add automake's "parallel-tests" option below, they'll
run in parallel.
The color-tests option makes it so the "PASS" and "FAIL" words
are colored green and red respectively. Nice, but no big deal.
Similarly nice-to-have is the "dist-xz" option.
That makes is so when you run "make dist" it creates xz-compressed
tarballs in addition to the usual gzip-compressed ones.
The advantage of also using xz is that it compresses significantly better:
$ du -sh *z
1.2M libqb-0.4.1.75-3737-dirty.tar.gz
812K libqb-0.4.1.75-3737-dirty.tar.xz
Now, whenever a project releases both gzip-compressed and
xz-compressed tarballs, I always download only the latter, smaller ones.
Not only does it save time on the download (minimal in this case),
but it occupies less space on disk and uncompresses faster.
2011-05-13 Angus Salkeld <asalkeld@redhat.com>
LOG: strip the last "\n" from incomming messages
LOG: make the "entering" and "leaving" capital
2011-05-06 Angus Salkeld <asalkeld@redhat.com>
Fix some compiler warnings
LOG: add an enter and leave trace function
2011-04-18 Angus Salkeld <asalkeld@redhat.com>
LOG: add locking & change dcs list into a singly-linked list.
TESTS: add a threaded logging test
LOG: check prioritynames[] bounds
LOG: created array with wrong size - yikes!
LOG: include needed stdio.h
LOG: make all priorities uint8_t
2011-04-15 Angus Salkeld <asalkeld@redhat.com>
LOG: fix logging to file
qb_log_file_open() left the target in an UNUSED state.
Compile on FreeBSD
Also re-run autoscan.
2011-04-14 Angus Salkeld <asalkeld@redhat.com>
Add write_logs.c to .gitignore
LOG: refactor the filter code a bit.
Reuse code a bit better.
Add qbconfig.h to the list of headers to be installed.
LOG: fix new callsite pointer (not incrementing correctly)
TEST: make a way of testing both with and without __attribute__((section))
LOG: fix the building of write_logs.c (for bench-log)
LOG: fix formatting test (fails in make distcheck)
This fails as the BUILDING_IN_PLACE patch was left out.
Now re-added, make distcheck passes.
TESTS: use new logging API
LOG: add some basic tests & fixes
LOG: add dynamic callsites (for platforms that don't support __attribute__(section)
ARRAY: add getter's to retrieve number of bins and elms/bin
2011-04-13 Angus Salkeld <asalkeld@redhat.com>
ARRAY: return -ERANGE when index is out of range.
So you can differentiate the other errors (-EINVAL)
2011-04-12 Angus Salkeld <asalkeld@redhat.com>
LOG: add LOG_TRACE
LOG: add the ability to adjust the priority sent to syslog()
If you have:
qb_log_filter_ctl(QB_LOG_SYSLOG, QB_LOG_FILTER_ADD,
QB_LOG_FILTER_FILE, "hack.c", LOG_DEBUG);
these logs will not make there way to /var/log/messags
without reconfiguring syslog.
So to help on the fly debugging do the following:
qb_log_ctl(QB_LOG_SYSLOG, QB_LOG_CONF_PRIORITY_BUMP,
LOG_INFO - LOG_DEBUG);
Now all messages that have the QB_LOG_SYSLOG target set
will have their priority bumped before going to syslog().
2011-04-09 Angus Salkeld <asalkeld@redhat.com>
Fix the copyright in bench-log.c
LOG: flush output to files
LOG: change the target type from uint32_t to int32_t.
This is so that you won't get warnings from mixing integer types.
I have updated the input checks in log.c to check for invalid
targets.
LOG: only set state in log.c
This requires an enable after qb_log_file_open()
2011-04-06 Angus Salkeld <asalkeld@redhat.com>
LOG: fix splint warning
LOG: teach filter_ctl() to write tags
LOG: remove the tags arument from qb_log() and add qb_logt() which has the tags argument.
I think in most cases tags will not be used and it will
just be a pain inserting ", 0". But if someone wants to use
tags like this then they still can via qb_logt()
LOG: change the filter matches to use strstr() for partial match support.
LOG: fix shared library callsites
This finds all the callsites in shared libraries
(using dl_iterate_phdr()) at the time qb_log_init()
is called.
Conflicts:
lib/log.c
LOG: add a callsite_dump() function to see what callsite are avaliable.
LOG: support dynamically loaded modules
LOG: make prioritynames[] static
2011-04-04 Angus Salkeld <asalkeld@redhat.com>
Add required include to qbloop.h
Merge branch 'logging'
2011-04-01 Angus Salkeld <asalkeld@redhat.com>
LOG: make the documentation more meaningful
LOG: general cleanup (indentation, NULL checks, etc...)
LOG: move formatting code into new file
Add D_FORTIFY_SOURCE=2 to check script
LOG: add a qb_log_fini() to cleanup
This replaces qb_log_thread_stop() but also release shared mem
2011-03-31 Angus Salkeld <asalkeld@redhat.com>
LOG: fix mapping from priority to name
Remove qb_log_priority_name_get() as we have the
formatting.
LOG: add a new "tags" field
this is a tags that is used by the caller to:
- define the message as an external message (needs free'ing)
- define a feature or susbsytem that can be printed in the log message.
LOG: change "tags" field to "targets"
This is it's new meaning, so makes things clearer
LOG: keep a list of active targets to speed iteration
LOG: deal better with timestamps
1) use gettimeofday() - suprisingly faster than clock_gettime(MONOTONIC)
2) don't format the time until it is needed
3) insert time_t into the blackbox (not a formatted string)
This improves performance and tidies the code up.
It also requires less space in the blackbox.
LOG: add bench-log to .gitignore
2011-03-31 Steven Dake <sdake@redhat.com>
Add a benchmark program for the qblog flight recorder
2011-03-31 Angus Salkeld <asalkeld@redhat.com>
LOG: fix minor compile warning
2011-03-30 Angus Salkeld <asalkeld@redhat.com>
LOG: add a format option to each target.
LOG: improve the docs
LOG: add qb_log_file_close()
LOG: add the ability to import logs from other sources.
Be more consistent with the C++ protection
Ignore 2 splint warnings
SPEC: make the spec file more like the fedora one.
LOG: re-work the API to be easier to use.
2011-03-28 Angus Salkeld <asalkeld@redhat.com>
Add some content to the README
LOG: add qb_log_priority_name_get()
LOG: fix make install and distcheck
LOG: add a qb_perror() function
- Add an internal version too
- Update the library code to use it.
2011-03-27 Angus Salkeld <asalkeld@redhat.com>
LOG: add a timestamp to the log handler
This makes sure that the timestamp is correct at the time
the call to qb_log() was called.
TESTS: remove unused function
LOG: split the tag function out into tag and untag
LOG: improve the doxygen overview.
LOG: fix splint warnings
2011-03-26 Angus Salkeld <asalkeld@redhat.com>
LOG: use the new logging mechanism for internal log messages.
This uses the top bit of the "tags" to distinguish
the internal messages from extternal ones.
2011-03-25 Angus Salkeld <asalkeld@redhat.com>
LOG: add a blackbox
LOG: add threaded logging (non-blocking)
LOG: create a common header
Add logging infrastructure.
2011-01-31 The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
Set the gpgsignkey in release.mk
Bump library version to 0.4.1
2011-01-31 Angus Salkeld <asalkeld@redhat.com>
BUILD: only set -g and -O options if explicitly requested.
compiler debug & optimization flags are only set with either
--enable-debug or --enable-coverage.
This prevents defaults and environmental flags from
been overridden.
Move check_all into check and impove it (add rpm checks)
RPM: make the spec more like a fedora spec file
fix tarball url
add procps to BuildRequires
add a "make check" section
change %(buildroot) to $RPM_BUILD_ROOT
2011-01-09 Angus Salkeld <asalkeld@redhat.com>
LOOP: check read() return value
DOCS: add missing @param on new timeout argument
Remove unneccessary check for library "dl"
RPM: add missing build dependancies
BUILD: improve the rpm building
copy corosync's rpm build system.
2011-01-05 The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
Bump version to 0.4.0
2011-01-04 Angus Salkeld <asalkeld@redhat.com>
LOOP: change timer handle from pointer to index + check.
This changes the timer hande from a live pointer to a handle
more like hdb handles (minus the ref counting).
What i like about this is it is not neccessary to clear
the applications handle using memset().
LOOP: remove tlist absolute timer
2010-12-21 Angus Salkeld <asalkeld@redhat.com>
TESTS: make sure timers are not leaking file descriptors
LOOP: make static functions like _<name>_()
LOOP: reduce the number of for loops
LOOP: change entry type enum
This to avoid QB_POLL been equal to 0, which could
hide some bugs.
LOOP: add per-level todo counters
2010-12-16 Angus Salkeld <asalkeld@redhat.com>
IPC: use rb refcount to check for "connectiveness"
This makes it possible the detect the loss of the server
and return -ENOTCONN.
RB: add a function to get the reference count.
Really handy to see if the peer is "connected".
TEST: add ipc tests for recv's with a timeout
IPC: add a timeout to the client recv functions
Also allow the ringbuffer to pass ETIMEDOUT back to the
client applications.
2010-12-14 Angus Salkeld <asalkeld@redhat.com>
IPC: improve shm performance by timing out earlier on poll()
My receint change adding in a call to recv_ready(, 10) was
really slowing down the shm performance.
So now I am rather retrying which doesn't slow it down
and also passes "make check".
IPC: return the correct number of bytes sent
2010-12-13 Angus Salkeld <asalkeld@redhat.com>
IPC: rename _ref_inc() to _ref()
DOCS: set the version from a configure variable
LOOP: change timers to be nano second based
2010-12-12 Angus Salkeld <asalkeld@redhat.com>
DOCS: fix some doxygen warnings for missing comments.
2010-12-10 Angus Salkeld <asalkeld@redhat.com>
IPC: return EAGAIN from qb_ipcc_recv() if recv_ready() returns 0
found with corosync CTS
IPC: return -ENOTCONN when the other end exits
TESTS: add a test case for recving from a failed server
2010-12-09 Angus Salkeld <asalkeld@redhat.com>
Remove carriage returns in qb_util_log() calls.
IPC: check for null ringbuffer
IPC: fix non-blocking event mechanism
LOOP: remove unneccessary event array
2010-12-03 Angus Salkeld <asalkeld@redhat.com>
IPCS: don't block on sending socket notification
IPC: export qb_ipcs_disconnect()
2010-11-16 Angus Salkeld <asalkeld@redhat.com>
fix waring produced by -Wp,-D_FORTIFY_SOURCE=2
Fix some freeBSD compile warnings.
LOOP: fix compile warning when we don't have timerfd.
LOOP: move pipe creation into qb_loop_signals_create()
Also make sure the pipe is non blocking.
RB: fix munmap size (else shared mem not freed correctly)
Fix some error handling in RB & IPC
2010-11-15 Angus Salkeld <asalkeld@redhat.com>
IPC: remove try again log message
LOOP: prevent timers from deleting them selves.
2010-11-12 Angus Salkeld <asalkeld@redhat.com>
LOOP: add some debug to log slow jobs
IPC: withdraw server socket when destroying a service.
TLIST: use qb_util_nano_monotonic_hz() instead of HZ
also add a test for under running.
RB: check for NULL on close
this just saves the user from doing this.
UTIL: check for shm usable space.
- port corosync write() check
2010-11-09 Angus Salkeld <asalkeld@redhat.com>
LOOP: add signal support to main loop
2010-11-04 Angus Salkeld <asalkeld@redhat.com>
LOOP: prevent high cpu utilization on no load.
We we passing "0" timeout into poll().
2010-11-03 Angus Salkeld <asalkeld@redhat.com>
IPC: add connection_closed() callback.
- added another callback closed() and use this as the current
destroyed_connection() has been used.
- the destroyed() event changes meaning to
"the connection object is about to be free'ed"
and the user can free the context memory.
IPC: change service instance from handle to pointer.
Mainly to be consistent with the other objects.
Also:
- splint warnings(-weak) are now zero.
- Added a reference counter to replace the handle.
Fix ./check_all
- Spelling error in "make distcheck"
- add check_resources.sh to EXTRA_DIST
2010-11-02 Angus Salkeld <asalkeld@redhat.com>
IPC: add flow control & q_len to unix socket transport.
This uses a small (2*int32_t) shared memory segment.
RB: don't be so timid on shutdown
TEST: add a check_resources script
2010-11-01 Angus Salkeld <asalkeld@redhat.com>
Cleanup config defines & add a check_all script
Run:
./check_all
to build with and without some common configurations.
2010-10-31 Angus Salkeld <asalkeld@redhat.com>
UTIL: move mmap helpers into private header
LOOP: add support for timerfd
If available use timerfd_create() as it is
much more accurate than tlist.h
2010-10-30 Angus Salkeld <asalkeld@redhat.com>
IPC: remove refcount'ing debug
TEST: make test ouput more verbose
LOOP: add qb_loop_destroy()
2010-10-29 Angus Salkeld <asalkeld@redhat.com>
LOOP: fix job poll and simplify main loop
2010-10-27 Angus Salkeld <asalkeld@redhat.com>
IPC: add server connection states for better shutdown.
This also fixes the refcounting, which was not quite right.
IPC: add qb_ipcs_response_sendv()
iovec friendly response function
TIME: move tlist_nano_ functions into util
RB: improve debug message
IPC: add job_add() API to the poll abstraction.
2010-10-22 Angus Salkeld <asalkeld@redhat.com>
Fix or ignore splint errors
fix some build issues on FreeBSD
2010-10-21 Angus Salkeld <asalkeld@redhat.com>
IPC: add a connection iterator.
So we can iterate over all connections on a service.
IPC: add stats to server end.
2010-10-20 Angus Salkeld <asalkeld@redhat.com>
TEST: add glib mainloop option to bms
Note: glib is only linked into the test app, so
libqb not dependant on glib. This is just testing
integration.
ATOMIC: fix the memory barrier setup.
This was horribly broken.
2010-10-19 Angus Salkeld <asalkeld@redhat.com>
IPC: remove sprintf where possible
LINT: get the lint target working.
TEST: add some more array tests.
2010-10-19 The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
Bump version to 0.3.0
2010-10-19 Angus Salkeld <asalkeld@redhat.com>
Fix the current warnings
Add missing qbutil.h
HDB: remove locks and use atomic.
2010-10-18 Angus Salkeld <asalkeld@redhat.com>
HDB: use qb_array.
DOCS: add some doxygen comments to array & hdb.
RB: fix the sem init logic (always use some semaphore).
RB: use the semaphore to return chunks_used.
RB: remove locking from ringbuffer.
make ref_count atomic
RB: prevent fd's from been leaked
IPC/RB: name the ringbuffer's files better.
IPC: get bmcpt working
LOOP: use qbarray for poll_entries.
This fixes an issue where removing or adding entries
can cause a realloc() to move the entries and then a
qb_list_del() causes a SIGSEGV (next pointer is now
invalid).
qbarray does not use realloc() so does not suffer from this.
Add a resizable array that doesn't move memory.
ATOMIC: fix make distcheck
LIST/LOOP: allow empty list items but don't splice an empty head.
IPC: use atomic for ref counting.
Add atomic operations.
This was initially copied from glib. How ever I have
simplified it to only support proper atomic operations
with gcc builtin __sync calls. The backup is pthread_spin_lock().
I have also obviously namespaced the code to qb_.
2010-10-18 The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
Tweek the release.mk file to produce tags like vX.Y.Z
Bump version to 0.2.0
2010-10-17 Angus Salkeld <asalkeld@redhat.com>
DOCS: do some work on the doxygen output.
IPC: add support for unix sockets
2010-10-16 Angus Salkeld <asalkeld@redhat.com>
TEST: add support events into bm[cs]
LOOP: remove warning.
LIST: fix logic in qb_list_splice()
this fixes "make check"
2010-10-14 Steven Dake <sdake@redhat.com>
get_more_jobs: use qb_list_splice instead of iterating list and readding
oprofile picked up get_more_jobs as a heavy abuser of cpu cycles when running
with cpgbench. Typical cpgbench runs this function 37 million times. This
small optimization improves performance of corosync as well as reduces
cpu utilization used by this function.
Might look at tracking length of wait_head and job_head to avoid use of
qb_list_length as well (which also iterates).
qb_list_splice: don't splice an empty list
An empty list passed to splice will damage the target splice list. This patch
prevents that from happening by checking for an empty list and not merging
in that case.
2010-10-14 Angus Salkeld <asalkeld@redhat.com>
configure: re-add check for pthread_spin_lock
2010-10-13 Angus Salkeld <asalkeld@redhat.com>
IPC: remove flow control API and move functionality into send()
There is no point in a separate API.
IPC: add q_len_get() to posix_mq & sysv_mq
IPC: move destroy() into ipcs.c (all were duplicated)
IPC: add qb_ipcc_sendv_recv() convenience function.
2010-10-12 Angus Salkeld <asalkeld@redhat.com>
TEST: make the bmc messages like cpgbench
IPC: recv the messages available (not just one)
fix some valgrind warnings
RB: return EAGAIN not ENOMEM if no space on the rb.
IPC: add support for flowcontrol & rate limiting
RB: add support for shared user data.
(I need this for flow control)
IPC: cleanup some formatting.
IPC: improve send/recv error handling
IPC: accelerate process when rate_limit == FAST.
IPC: get the poll independent functions working.
IPC: make msg_process return type int
IPC: add peek & reclaim
Remove timer.c (rather use mainloop)
LOOP: add epoll support
Add a priority based main loop.
This is to try and get a better balance in the amount
of processing between IPC and totem in corosync.
IPC: remove qb_ipcc_event_release()
LIST: add some more convenience macros.
2010-10-06 Angus Salkeld <asalkeld@redhat.com>
RB: cleanup return codes frpm rb_peek()
IPC: make events always use socket notification
IPC: use poll() to prevent a recv() blocking
IPC: teach event_recv() to take a timeout
UTIL: add qb_timespec_add_ms()
add X milli seconds to a timespec.
add time defines to qbdefs.h
IPC: improve resource cleanup/shutdown
IPC: make internal message ids negative.
IPC: add a user context_get/set() functions.
IPC: add sendv() functions to handle iovecs.
IPC: make sure FD_CLOEXEC is set on all sockets
TEST: disable posix mq test for now.
SPEC: Fix the rpm spec file
DOCS: quiten the doxygen make process
2010-10-04 Angus Salkeld <asalkeld@redhat.com>
add qbdefs.h with some common defines.
2010-10-02 Angus Salkeld <asalkeld@redhat.com>
POLL: add missing fuction.
IPC: add a service_id and merge qb_ipcs_create() + qb_ipcs_service_handlers_set()
2010-10-01 Angus Salkeld <asalkeld@redhat.com>
IPC: change the ipcs_connection to a pointer (not handle).
This is make integrating with corosync easier.
Also technically it doesn't really matter it still
has a reference counter.
IPC: make authenticate callback more generic "accept".
This is so that it is more obvious that you can use
it for authentication, service availabilty and
process resource constraints.
LIST: add required header
POLL: gracefully handle running out of file descriptors.
POLL: Allow modifying POLLIN/POLLOUT state in another thread.
while the main thread is blocked in poll system call.
(ported from corosync)
Author: Steven Dake <sdake@redhat.com>
2010-09-30 Angus Salkeld <asalkeld@redhat.com>
cleanup the configure script.
Remove (now) unused checks.
TEST: fix ipc test after receint API changes.
Delete unchecked API (to be re-added later).
IPC: new auth improvement and limits work around.
Create the queues/ringbuffers on the server so we don't
have to modify proc entries. Then chown them so that
the clients can access them.
RB: add qb_rb_chown()
change the ownership of the two mmap'ed files.
2010-09-29 Angus Salkeld <asalkeld@redhat.com>
IPC_SYSV: get sysv ipc to work with non-root processes.
TEST: add IPC_TYPE cli option to bms
TEST: make bmc's output comma delimited
IPC: pack sysv messages into multiple queue items
IPC: add events back (were dispatch messages in corosync)
IPC: rename dispatch queues to event queues.
IPC: rename qb_ipcs_connection_pt -> qb_ipcs_connection_handle_t
IPC: un-const the data pointer in recv()
POLL: check for stop_requested before poll() as well.
2010-09-07 Angus Salkeld <asalkeld@redhat.com>
IPC: get shm & pmq working
Note: pmq needs "sudo make check"
2010-09-06 Angus Salkeld <asalkeld@redhat.com>
IPC: add a basic tx/rx test case.
- cleanup some printf's
IPC: linux & bsd mq_open returns a poll'able file descriptor.
Lindent most c files again.
IPC: fix crash on failed auth
Define new return status policy
Good >= 0 (0 = good, or positive value)
Bad < 0 (-errno)
2010-09-03 Angus Salkeld <asalkeld@redhat.com>
BSD: port new changes to BSD
- check for doxygen
- no RLIMIT_MSGQUEUE on bsd
- change ENODATA to ENOMSG
2010-08-23 Angus Salkeld <asalkeld@redhat.com>
IPC: rewrite (simpler API & more structured layout).
- implement using posix message queues
- implement using sys-v message queues
- implement shared memory ringbuffers
- add auth via unix sockets
- add items to the TODO
This is still a bit rough, more work to follow...
2010-08-22 Angus Salkeld <asalkeld@redhat.com>
automake: check for more headers
2010-08-09 Angus Salkeld <asalkeld@redhat.com>
RB: add function qb_rb_chunks_used()
This is to make it easier to to see if there is
a chunk available to be read.
2010-07-28 Angus Salkeld <asalkeld@redhat.com>
RB: make the timedwait() functions more consistent
POLL: add a job API to process non-fd items.
2010-07-12 quarterback <quarterback@troll.bigpond>
Add a release makefile
Originally from here:
http://git.fedorahosted.org/git/?p=cluster.git;a=blob_plain;f=make/release.mk;hb=refs/heads/STABLE3
Author: Fabio M. Di Nitto
2010-07-06 Angus Salkeld <asalkeld@redhat.com>
Add the coding style definition file.
2010-06-22 Angus Salkeld <asalkeld@redhat.com>
int -> int32_t
unsigned int -> uint32_t
some to int32_t (bugs)
unsigned long long -> uint64_t
change name of ringbuffer.h to ringbuffer_int.h
2010-06-16 Angus Salkeld <asalkeld@redhat.com>
list: rename QB_DECLARE_LIST_INIT -> QB_LIST_DECLARE
hdb: move functions into cfile
convert int -> int32_t
rename qb_hdb_handle_t -> qb_handle_t
rename DECLARE_HDB_DATABASE -> QB_HDB_DECLARE
rename qb_hdb_handle_database -> qb_hdb
2010-06-15 Angus Salkeld <asalkeld@redhat.com>
ipc: convert int -> int32_t; unsigned int -> uint32_t
ipc: use a ringbuffer for requests.
ipcc: remove unneccessry goto
rb: fix handling of EINTR from sem_wait
rb: make rb_chunk_peek() wait on the sem like chunk_read()
rb: fix bit flag numbering
2010-06-12 Angus Salkeld <asalkeld@redhat.com>
bm test programs: allow no args
rb: add a get name function
list: add some more doxygen comments
rb: add an example to the doxygen description.
rb: rename qb_rb_chunk_writable* -> qb_rb_chunk_
check_hash: test for dict/words before running.
2010-06-11 Angus Salkeld <asalkeld@redhat.com>
rb: cleanup of names and log messages
util: move some handy macros into qbuil.h
rb: organise the locks/sems a bit better
Bring some changes across from corosync.
My coverity fixes and honzas fixes.
2010-06-10 Angus Salkeld <asalkeld@redhat.com>
Remove unneccessary extern's.
http://gcc.gnu.org/ml/gcc/2009-04/msg00812.html
http://publications.gbdirect.co.uk/c_book/chapter4/linkage.html
http://www.eskimo.com/~scs/cclass/notes/sx5b.html
note in ipcs.c qb_ipcs_ipc_init() is extern'ed, I don't
think that this is needed - we'll soon see :)
Format all files with Lindent
Add a script for indenting the code (kernel formatting)
Add a ringbuffer based off the one in logsys.
This ringbuffer is usable across processes.
the point is to use this for IPC to provide async
connections from client to server, but with inherient
flow control.
This still needs a bit of clean up, but committing now
for feedback and as it is quite functional.
2010-05-31 Angus Salkeld <asalkeld@redhat.com>
man: document qblist.h better.
Fix the installation of libqb.pc
Comment out the plugin tests as they break "make rpm"
I can't figure out a "nice" way of doing this.
2010-05-27 Angus Salkeld <asalkeld@redhat.com>
Roll all little libs into libqb.
This really makes things simpler (to produce and use).
2010-05-26 Angus Salkeld <asalkeld@redhat.com>
Make docs rules more maintainable
Add pkg-config files.
Fix the new inter-library dependancy.
http://old.nabble.com/relinking-error-td27796838.html
2010-05-25 Angus Salkeld <asalkeld@redhat.com>
Add __cplusplus externs
Fix make doxygen (for html output)
Fix manpage generation when builddir != srcdir
use new interanl logging functions
Add a library logging function.
Add a util library with locking wrappers.
2010-05-24 Angus Salkeld <asalkeld@redhat.com>
Re-license to LGPL 2.1
2010-04-29 Angus Salkeld <asalkeld@redhat.com>
fix "make distcheck"
I am sure that I am going to learn one day :(
Add tezt programs to .gitignore
ipc: add non-blocking options to the bmc & bms apps
so to test blocking IPC
bmc
bms
to test non-blocking IPC
bmc -n
bms -n
Conflicts:
tests/bmc.c
ipc: add a non-blocking send function.
ipc: add Steve's benchmark test programs
ipc: add common types to qbipc_common.h
ipc: remove uneccessary version compatibilty
2010-04-16 Angus Salkeld <asalkeld@redhat.com>
check_plugin: Add -rdynamic to check program
check_hash: fix test must be run in one test case.
hash: improve the error handling in key_set()
2010-04-15 Angus Salkeld <asalkeld@redhat.com>
libtool and code re-structure
add a unit test for hash & cleanup.
Fix make distcheck
Add qbhash.h to the makefiles
Fix make rpm.
Make sure the makefiles are generatd for hash
2010-04-14 Steven Dake <sdake@redhat.com>
Add an initial implementation of a hash table.
The hash table implementation is somewhat unique in that I plan to add graph
functionality to allow hash entries to be linked between other hash
entries to provide a mechanism to structure data within a hash table.
2010-03-20 Angus Salkeld <asalkeld@redhat.com>
add logsys from corosync.
Add wthread & queue.
2010-03-19 Angus Salkeld <asalkeld@redhat.com>
add ipcs from corosync
clean up lib.versions files
Add ipcc from corosync
tweek the .gitignore
add the plugin library.
tsafe: replace _XOPEN_SOURCE with HAVE_(function)
remove ipc so from makefiles
Added qb_ prefix onto public functions/types.
Add timer.
Add spec file
2010-03-11 Angus Salkeld <asalkeld@redhat.com>
Add poll, list & tlist
Add handle database.
Initial Commit.
-autotools build system
-tsafe