pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/50780: net/zeromq broken on NetBSD current



>Number:         50780
>Category:       pkg
>Synopsis:       net/zeromq broken on NetBSD current
>Confidential:   no
>Severity:       critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 07 23:50:00 +0000 2016
>Originator:     Travis Paul
>Release:        current
>Organization:
>Environment:
NetBSD kagato.netverb.com 7.99.26 NetBSD 7.99.26 (kagato) #0: Sun Feb  7 11:33:50 EST 2016  tpaul%kagato.netverb.com@localhost:/build/obj/sys/arch/amd64/compile/kagato amd64
>Description:
zeromq crashes on NetBSD current when calling pthread_setschedparam

Attached is a patch which works around this issue, by simply removing the function call as it does not appear to be essential for normal operation. This allows zeromq and py27-zmq to work as expected however it may not be the ideal approach.

This issue appears to be specific to NetBSD-current and does not appear to affect OS X or SmartOS when using pkgsrc.
>How-To-Repeat:
The following examples will fail with:

Invalid argument (src/thread.cpp:135)
Abort (core dumped) 




Sample app using libzmq: 

#include <zmq.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <assert.h>

int main (void)
{
    void *context = zmq_ctx_new ();
    void *responder = zmq_socket (context, ZMQ_REP);
    int rc = zmq_bind (responder, "tcp://*:5555");
    assert (rc == 0);

    while (1) {
        char buffer [10];
        zmq_recv (responder, buffer, 10, 0);
        printf ("Received Hello\n");
        sleep (1);          //  Do some 'work'
        zmq_send (responder, "World", 5, 0);
    }
    return 0;
}


or via python2.7:

import zmq
ctx = zmq.Context()
ctx.socket(zmq.PUB)

>Fix:
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/net/zeromq/distinfo,v
retrieving revision 1.19
diff -u -r1.19 distinfo
--- distinfo    24 Nov 2015 11:01:34 -0000      1.19
+++ distinfo    7 Feb 2016 23:45:07 -0000
@@ -9,3 +9,4 @@
 SHA1 (patch-src_curve__server.cpp) = 7acd371d1e8ec6064d086c2dc503cdd0ec6c9a58
 SHA1 (patch-src_platform.hpp.in) = 767370bd997310cddeb7ee1f759bec1a638974e0
 SHA1 (patch-src_tcp__address.cpp) = ad1c1ec9b724c3bd7f0fae15c296e0ec33b4267a
+SHA1 (patch-src_thread.cpp) = e5ffcc1f9e80c255d6dee244ab6966ae6f25d279
cvs diff: Diffing patches
Index: patches/patch-src_thread.cpp
===================================================================
RCS file: patches/patch-src_thread.cpp
diff -N patches/patch-src_thread.cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_thread.cpp        7 Feb 2016 23:45:07 -0000
@@ -0,0 +1,31 @@
+$NetBSD$
+
+--- src/thread.cpp.orig        2015-06-15 09:43:08.000000000 +0000
++++ src/thread.cpp
+@@ -114,26 +114,6 @@ void zmq::thread_t::stop ()
+ 
+ void zmq::thread_t::setSchedulingParameters(int priority_, int schedulingPolicy_)
+ {
+-#if !defined ZMQ_HAVE_ZOS
+-    int policy = 0;
+-    struct sched_param param;
+-
+-    int rc = pthread_getschedparam(descriptor, &policy, &param);
+-    posix_assert (rc);
+-
+-    if(priority_ != -1)
+-    {
+-        param.sched_priority = priority_;
+-    }
+-
+-    if(schedulingPolicy_ != -1)
+-    {
+-        policy = schedulingPolicy_;
+-    }
+-
+-    rc = pthread_setschedparam(descriptor, policy, &param);
+-    posix_assert (rc);
+-#endif
+ }
+ 
+ #endif


Home | Main Index | Thread Index | Old Index