Commit Graph

97 Commits

Author SHA1 Message Date
Christine Caulfield
3da46f4a0c bump version for 1.0.6 2020-04-27 13:36:51 +01:00
Jonas Witschel
dd22a1811f
Set correct ownership if qb_ipcs_connection_auth_set() has been used (#382)
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-12 14:47:13 +00:00
Christine Caulfield
d08dbcf08b version: bump soname for 1.0.5 release 2019-04-25 09:13:19 +01:00
Christine Caulfield
dc78f42226 version: update version-info for 1.0.4 release 2019-04-12 09:29:06 +01:00
Jan Pokorný
c011b12fca
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.

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2017-12-12 23:23:46 +01:00
Jan Pokorný
20246f544f
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

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2017-12-12 23:23:35 +01:00
Christine Caulfield
608de6d59a lib: update library version for upcoming 1.0.2 release
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
2017-05-19 14:59:20 +01:00
Ferenc Wágner
1a9b4128e4 configure: restrict socket lib to where it's actually needed 2016-12-12 11:47:21 +01:00
Ferenc Wágner
cb5ee921c0 configure: restrict pthreads to where it's actually needed
mq_open() is no longer relevant beyond 70a9623 (Remove message queues).
2016-12-12 11:46:13 +01:00
Ferenc Wágner
56754d0509 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.
2016-12-08 14:14:57 +01:00
Ferenc Wágner
64371306a6 configure: LTLIBOBJS is also a Make variable
So let's use the more friendly syntax.
2016-12-08 14:14:57 +01:00
Christine Caulfield
0a329683a7 version: Update version for 1.0.1 release 2016-11-24 09:44:27 +00:00
Jan Pokorný
c12f729452
build: make splint check tolerant of existing defects 2016-03-17 15:16:19 +01:00
Jan Pokorný
20c35217ab
build: fix preposterous usage of $(AM_V_GEN) 2016-03-11 08:04:47 +01:00
Jan Pokorný
2468e46a56
build: extra clean-local rule instead of overriding clean-generic
Previously, stuffing CLEANFILES with anything would not work in the
affected files.
2016-03-10 21:06:29 +01:00
Christine Caulfield
41a83d1a86 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.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
2016-03-08 10:28:24 +00:00
Christine Caulfield
9b61a2c672 lib: update library version for new release
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
2016-01-12 11:10:18 +00:00
Ken Gaillot
7cd90f11db 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.
2015-08-18 09:14:51 -05:00
David Vossel
d2b8c8cc78 Revise version to 0.17.1 The next release is only a point release 2014-08-22 10:12:07 -05:00
David Vossel
8cbae179cf Bump release version to 0.18.0
preparing for a new release
2014-08-22 09:58:50 -05:00
Fabio M. Di Nitto
bafe834cbb Low: build: cleanup autogen warning to not overrride LDFLAGS
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2014-07-23 11:43:52 -05:00
David Vossel
39ed456da8 Low: build: Don't allow Bsymbolic-functions LDFLAG to be used, it breaks unit tests 2014-02-25 15:17:16 -06:00
David Vossel
532acdffa4 Bump version to 0.17.0 2014-02-19 10:33:30 -06:00
David Vossel
75f7ed3737 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.
2013-07-25 13:12:02 -05:00
David Vossel
986b92d391 Bump the version to 0.15.0 2013-07-24 18:04:39 -05:00
Angus Salkeld
359725f4fd Add atomic_int.h to noinst_HEADERS
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-05-13 11:59:42 +10:00
Angus Salkeld
9d2eca251b 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.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-02-06 11:21:05 +11:00
The Quarterback Library Release Team
848242a786 Bump the version to 0.14.4
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2013-01-17 14:06:48 +11:00
The Quarterback Library Release Team
92ada8c4d1 Bump the library version.
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2012-10-29 10:02:04 +11:00
The Quarterback Library Release Team
74b7c6e990 Bump the version to 0.14.2
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2012-09-10 10:58:14 +10:00
Angus Salkeld
70c8df9a19 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

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-22 10:58:29 +10:00
The Quarterback Library Release Team
5470bf5625 Bump the version to 0.14.1
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2012-07-17 22:03:31 +10:00
The Quarterback Library Release Team
1c2b77f005 Bump the version to 0.14.0
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2012-06-22 16:29:32 +10:00
Angus Salkeld
70a9623a48 Remove message queues
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 13:41:04 +10:00
Angus Salkeld
955d43eae6 Add a more verbose version of the library versioning text.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-10 20:45:13 +10:00
Angus Salkeld
b3aa86dc42 Bump the library version to 0.13.0
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-10 20:44:10 +10:00
The Quarterback Library Release Team
0b8aeb66c8 Bump the lib version to 0.12.0
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2012-05-10 11:48:46 +10:00
Angus Salkeld
316fd95e00 add rpl_sem.h loop_poll_int.h to noinst_headers
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-04-23 19:10:43 +10:00
Angus Salkeld
26491555ef POLL: seperate out the poll/epoll and add kqueue
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-04-04 00:26:20 +10:00
Angus Salkeld
1af214d91d Try and improve the portability on bsd variants.
Also add a QB_IPC_NATIVE type that selects the best ipc type available.

Signed-off-by: Angus <angus@anguss-mac-mini>
2012-03-24 22:43:37 +11:00
The Quarterback Library Release Team
50f07abcfe Bump the version to 0.11.1
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2012-03-11 22:17:43 +11:00
The Quarterback Library Release Team
418471e6c1 Bump the version to 0.11.0
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2012-03-07 21:11:40 +11:00
Angus Salkeld
002f009941 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.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-24 11:40:45 +11:00
The Quarterback Library Release Team
1c8a9d6461 Fix "make distcheck" add include path to AM_CPPFLAGS
strl* files are built a bit differently and need the global
flags

Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2012-02-14 21:48:53 +11:00
The Quarterback Library Release Team
b2c9cb6cb3 Bump the version to 0.10.1
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2012-02-14 21:33:21 +11:00
Angus Salkeld
7a6382f0b6 Use safer versions of string functions (strcpy -> strlcpy)
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-08 22:00:49 +11:00
The Quarterback Library Release Team
362b0dccd4 Bump the lib version to 0.10.0
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-07 20:30:48 +11:00
The Quarterback Library Release Team
e2bb6d7277 Bump the library version to 0.9.0 2012-01-26 21:52:03 +11:00
The Quarterback Library Release Team
e0d55fe8f7 Bump the library version.
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2012-01-05 17:46:38 +11:00
Angus Salkeld
ab3dc60f7f Merge some portability changes from the mingw branch
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-12-21 14:23:43 +11:00