diff --git a/893/README b/893/README new file mode 100644 index 0000000..3e97971 --- /dev/null +++ b/893/README @@ -0,0 +1,8 @@ +Compile libzmq with this configure options: configure --with-poller=select + +Then compile the test case normally: + +g++ -o issue issue.c -lzmq -lpthread + +The problem happens under Cygwin for n = 28, but not for n = 27: +the test hangs in the zmq_ctx_destroy() call. diff --git a/893/issue.c b/893/issue.c new file mode 100644 index 0000000..4c0382a --- /dev/null +++ b/893/issue.c @@ -0,0 +1,53 @@ +#include +#include + +#define n 28 /* n = 27 works */ +#define m n + +int main(void) +{ + void* ctx; + void* sckts[n]; + int rc; + int i; + + assert(m <= n); + + printf("# : create context\n"); + ctx = zmq_ctx_new(); + assert(ctx); + + rc = zmq_ctx_get(ctx, ZMQ_MAX_SOCKETS); + assert(rc >= n); + + printf("## : starting to create sockets\n"); + for(i=0; i