[ClusterLabs Developers] Error when linking to libqb in shared library

Jan Pokorný jpokorny at redhat.com
Mon Feb 12 10:11:44 UTC 2018


[let's move this to developers list]

On 12/02/18 07:22 +0100, Kristoffer Grönlund wrote:
> (and especially the libqb developers)
> 
> I started hacking on a python library written in C which links to
> pacemaker, and so to libqb as well, but I'm encountering a strange
> problem which I don't know how to solve.
> 
> When I try to import the library in python, I see this error:
> 
> --- command ---
> PYTHONPATH='/home/krig/projects/work/libpacemakerclient/build/python' /usr/bin/python3 /home/krig/projects/python-pacemaker/build/../python/clienttest.py
> --- stderr ---
> python3: utils.c:66: common: Assertion `"implicit callsite section is observable, otherwise target's and/or libqb's build is at fault, preventing reliable logging" && work_s1 != NULL && work_s2 != NULL' failed.
> -------
> 
> This appears to be coming from the following libqb macro:
> 
> https://github.com/ClusterLabs/libqb/blob/master/include/qb/qblog.h#L352
> 
> There is a long comment above the macro which if nothing else tells me
> that I'm not the first person to have issues with it, but it doesn't
> really tell me what I'm doing wrong...
> 
> Does anyone know what the issue is, and if so, what I could do to
> resolve it?

Something similar has been reported already:
https://github.com/ClusterLabs/libqb/pull/266#issuecomment-356855212

and the fix is proposed:
https://github.com/ClusterLabs/libqb/pull/288/commits/f9f180cdbcb189b6590e541502b1de658c81005e
https://github.com/ClusterLabs/libqb/pull/288

But the suitability depends on particular usecase.

I guess you are linking your python extension with one of the
pacemaker libraries (directly on indirectly to libcrmcommon), and in
that case, you need to rebuild pacemaker with the patched libqb[*] for
the whole arrangement to work.  Likewise in that case, as you may be
aware, the "API" is quite uncommitted at this point, stability hasn't
been of importance so far (because of the handles into pacemaker being
mostly abstracted through built-in CLI tools for the outside players
so far, which I agree is encumbered with tedious round-trips, etc.).
There's a huge debt in this area, so some discretion and perhaps
feedback which functions are indeed proper-API-worth is advised.

[*]
shortcut 1: just recompile pacemaker with those extra
            /usr/include/qb/qblog.h modifications as of the
	    referenced commit)
shortcut 2: if the above can be tolerated widely, this is certainly
            for local development only: recompile pacemaker with
	    CPPFLAGS=-DQB_KILL_ATTRIBUTE_SECTION

Hope this helps.

-- 
Jan (Poki)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.clusterlabs.org/pipermail/developers/attachments/20180212/95862f85/attachment-0002.sig>


More information about the Developers mailing list