[ClusterLabs Developers] [PATCH] libqb FTBFS on linux-amd64 with correct sun_path to bind() with gcc-4.9.1-16

Svante Signell svante.signell at gmail.com
Fri Feb 19 05:42:35 EST 2016


Hello,

Currently libqb FTBFS on linux-amd64 for test ipc.test with git sources with
gcc-4.9.1-16. It does not with the current compiler gcc-5.3.1-8, though.
However, I think there is a need to fix the sources also in upstream git.

The attached patch, fix_ipc_setup_bug.patch, patch fixes writing of the
*.sun_path socket names to become non-zero for bind() and connect().

The previous race condition is back for the ipc_stress_connections_us
test. Adding the unlink statement solves this problem (unknown how,
since res=-1 due to ENOENT: No such file or directory.)

This patch and problem was reported to Debian in bug #803866, see
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=803776

Applying this patch the testsuite still pass all tests.

This patch is made against current git and conflicts with the GNU/Hurd patch.

The following *.rej files are created:
hurd patch first, linux patch after:
--- lib/ipc_setup.c
+++ lib/ipc_setup.c
@@ -395,7 +395,7 @@ qb_ipcs_us_publish(struct qb_ipcs_servic
 
        qb_util_log(LOG_INFO, "server name: %s", s->name);
 #if defined(QB_LINUX) || defined(QB_CYGWIN)
-       snprintf(un_addr.sun_path + 1, UNIX_PATH_MAX - 1, "%s", s->name);
+       snprintf(un_addr.sun_path, sizeof(un_addr.sun_path), "%s", s->name);
 #else
        {
                struct stat stat_out;

linux patch first, hurd patch after:
--- lib/ipc_setup.c
+++ lib/ipc_setup.c
@@ -394,7 +394,7 @@ qb_ipcs_us_publish(struct qb_ipcs_servic
 #endif
 
        qb_util_log(LOG_INFO, "server name: %s", s->name);
-#if defined(QB_LINUX) || defined(QB_CYGWIN)
+#if defined(QB_LINUX) || defined(QB_CYGWIN) || defined(QB_GNU)
        snprintf(un_addr.sun_path + 1, UNIX_PATH_MAX - 1, "%s", s->name);
 #else
        {

In case you consider applying the proposed patches, please let me know so I can
fix the conflicts.

Thanks!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_ipc_setup_bug.patch
Type: text/x-patch
Size: 1785 bytes
Desc: not available
URL: <http://lists.clusterlabs.org/pipermail/developers/attachments/20160219/4a2d5ff8/attachment-0002.bin>


More information about the Developers mailing list