Bug 209006 - [maintainer] net/pacemaker: multiple changes
Summary: [maintainer] net/pacemaker: multiple changes
Status: Closed Not Accepted
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on: 209005
Blocks:
  Show dependency treegraph
 
Reported: 2016-04-24 01:09 UTC by David Shane Holden
Modified: 2017-05-25 18:44 UTC (History)
1 user (show)

See Also:


Attachments
pacemaker-1.1.14_1.diff (19.91 KB, patch)
2016-04-24 01:09 UTC, David Shane Holden
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Shane Holden 2016-04-24 01:09:26 UTC
Created attachment 169619 [details]
pacemaker-1.1.14_1.diff

* Rename patches to fix portlint warnings
* Add patch to SysInfo RA to extract mem/cpu info for FreeBSD
* Add patch to Makefile.ams to disable installation of Linux init scripts
* Add dependency to net-mgmt/resource-agents for resource agent shell functions
Comment 1 Kurt Jaeger freebsd_committer freebsd_triage 2016-04-28 09:45:26 UTC
Fails to generate man page ?

:  PATH=/home/pi/myp/net/pacemaker/work/pacemaker-Pacemaker-1.1.14/mcp:$PATH /home/pi/myp/net/pacemaker/work/pacemaker-Pacemaker-1.1.14/mcp/pacemakerd --help
:  PATH=/home/pi/myp/net/pacemaker/work/pacemaker-Pacemaker-1.1.14/mcp:$PATH /home/pi/myp/net/pacemaker/work/pacemaker-Pacemaker-1.1.14/mcp/pacemakerd --version
  MAN      pacemakerd.8
help2man: can't get `--help' info from /home/pi/myp/net/pacemaker/work/pacemaker-Pacemaker-1.1.14/mcp/pacemakerd
Try `--no-discard-stderr' if option outputs to stderr
Makefile:952: recipe for target 'pacemakerd.8' failed

on 11-amd64. Can you investigate ?
Comment 2 David Shane Holden 2016-04-30 22:46:38 UTC
This seems to be threading related.  The build only fails in an 11 poudriere jail, though builds fine in an 10.3 poudriere jail and on an 11 virtual machine.  What's really peculiar though is it looks like libqb uses PTHREAD_PROCESS_SHARED pthread spin locks, which according to the pthread_spin_init man page aren't supported at all on FreeBSD.  I would have expected to see threading problems show up before this if that's really the problem.

Running the following code on a combination of 10/11 host and virtual machines also shows something kind of interesting.

#include <err.h>
#include <errno.h>
#include <pthread.h>

int main() {
  pthread_spinlock_t lock;
  int r;

  r = pthread_spin_init(&lock, PTHREAD_PROCESS_SHARED);
  if (r != 0)
    err(1, "pthread_spin_init(%i)", errno);

  err(0, "pthread_spin_init(0)");
}

10-amd64-jail: test: pthread_spin_init(2): No such file or directory
10-amd64-host: test: pthread_spin_init(2): No such file or directory
11-amd64-jail: test: pthread_spin_init(22): Invalid argument
11-amd64-host: test: pthread_spin_init(0): No error: 0

The fact that this problem only seems to show up in an 11 jail and doesn't segfault anywhere else except there makes me curious if the problem isn't related to FreeBSD 11 and not libqb/pacemaker.  I can submit a patch for libqb to use mutexes instead of spinlocks which fixes the segfault, but that might just be more of a workaround for whatever is causing pthread_spin_init() to act differently inside of a jail.