[zeromq-dev] What eats SIGINT?

Gavin Henry ghenry at sentrypeer.org
Tue Feb 15 22:46:18 CET 2022

Hi all,

I'm beginning to incorporate zyre into my project and my signal
handlers aren't gracefully shutting down:


I thought it was how I was handling threads, so I went to minimal.c example:


and trimmed it down to test:

#include <zyre.h>
#define ROOM "GROUP"

int main (void)
    zyre_t *node = zyre_new (NULL);
    assert (node);
    zyre_start (node);
    zyre_join (node, ROOM);

    char name[] = "sentrypeer";
    zyre_shouts (node, ROOM, "Hello from %s", name);

    while (1) {
        sleep (1);

When I compile and run above:

gcc -Wall -o minimal minimal.c -lzyre -lczmq

Ctrl-C doesn't work and I need to Ctrl-Z then kill -9 on the process.
What is eating SIGINT?

In gdb I can see:

(gdb) i thre
  Id   Target Id                                          Frame
* 1    Thread 0x7ffff6706b80 (LWP 2510803) "minimal"
0x00007ffff7db03a5 in __GI___clock_nanosleep
(clock_id=clock_id at entry=0,
    flags=flags at entry=0, req=req at entry=0x7fffffffd2e0,
rem=rem at entry=0x7fffffffd2e0) at
  2    Thread 0x7ffff6703640 (LWP 2510811) "ZMQbg/Reaper"
0x00007ffff7de9c2e in epoll_wait (epfd=5, events=0x7ffff6701d30,
    timeout=-1) at ../sysdeps/unix/sysv/linux/epoll_wait.c:30
  3    Thread 0x7ffff5f02640 (LWP 2510812) "ZMQbg/IO/0"
0x00007ffff7de9c2e in epoll_wait (epfd=7, events=0x7ffff5f00d30,
    timeout=-1) at ../sysdeps/unix/sysv/linux/epoll_wait.c:30
  4    Thread 0x7ffff5701640 (LWP 2510813) "minimal"
0x00007ffff7ddd79f in __GI___poll (fds=0x7ffff5700820, nfds=3,
    at ../sysdeps/unix/sysv/linux/poll.c:29
  5    Thread 0x7ffff4f00640 (LWP 2510814) "minimal"
0x00007ffff7ddd79f in __GI___poll (fds=0x7ffff4eff8d0, nfds=2,
    at ../sysdeps/unix/sysv/linux/poll.c:29


Kind Regards,

Gavin Henry.

More information about the zeromq-dev mailing list