Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion failure needs to check EINTR #1193

Closed
pankajkumar229 opened this issue Sep 22, 2014 · 2 comments
Closed

Assertion failure needs to check EINTR #1193

pankajkumar229 opened this issue Sep 22, 2014 · 2 comments

Comments

@pankajkumar229
Copy link

pankajkumar229 commented Sep 22, 2014

I am getting an assertion failure when a parent process is doing zmq communication and it spawns a child process doing zmq communication with a different context. When the child process exits, the parent gets an assertion error with this stack:

(gdb) bt
#0  0x0000003574a30265 in raise () from /lib64/libc.so.6
#1  0x0000003574a31d10 in abort () from /lib64/libc.so.6
#2  0x00002aaaaad6d180 in zmq::mailbox_t::recv (this=0x6311c0, cmd_=0x2aaab05763a0,

timeout_=<value optimized out>)
at /build/jenkins/workspace/codebase@0/agent/php/scripts/buildEnv/../../../../thirdparty/lib/zeromq/zeromq/src/mailbox.cpp:79
#3  0x00002aaaaad70f85 in zmq::reaper_t::in_event (this=0x6311a0)

    at /build/jenkins/workspace/codebase@0/agent/php/scripts/buildEnv/../../../../thirdparty/lib/zeromq/zeromq/src/reaper.cpp:64
#4  0x00002aaaaad6b54e in zmq::epoll_t::loop (this=0x630e10)

        at /build/jenkins/workspace/codebase@0/agent/php/scripts/buildEnv/../../../../thirdparty/lib/zeromq/zeromq/src/epoll.cpp:161
#5  0x00002aaaaad759cc in thread_routine (arg_=0x630e80)

            at /build/jenkins/workspace/codebase@0/agent/php/scripts/buildEnv/../../../../thirdparty/lib/zeromq/zeromq/src/thread.cpp:75
#6  0x000000357520683d in start_thread () from /lib64/libpthread.so.0
#7  0x0000003574ad526d in clone () from /lib64/libc.so.6

            (gdb)

The corresponding zmq code is this:

   55 int zmq::mailbox_t::recv (command_t *cmd_, int timeout_)
-  56 {
|  57     //  Try to get the command straight away.
-  58     if (active) {
2  59         bool ok = cpipe.read (cmd_);
2  60         if (ok)
2  61             return 0;
2  62
2  63         //  If there are no more commands available, switch into passive state.
2  64         active = false;
2  65         signaler.recv ();
2  66     }
|  67
|  68     //  Wait for signal from the command sender.
|  69     int rc = signaler.wait (timeout_);
|  70     if (rc != 0 && (errno == EAGAIN || errno == EINTR))
|  71         return -1;
|  72
|  73     //  We've got the signal. Now we can switch into active state.
|  74     active = true;
|  75
|  76     //  Get a command.
|  77     errno_assert (rc == 0);
|  78     bool ok = cpipe.read (cmd_);
|  79     zmq_assert (ok);
|  80     return 0;
|  81 }
   82

Could the pipe read be getting another EINTR when the child process exits and a SIGCHLD is raised?

@pankajkumar229
Copy link
Author

I tried zmq 3.2.4 and the same error repeats. Could it be that the child process has a reference to zmq_context from the parent and when it exits, the parent's context is invalidated and it gets the assert failure?

@stale
Copy link

stale bot commented Nov 4, 2018

This issue has been automatically marked as stale because it has not had activity for 365 days. It will be closed if no further activity occurs within 56 days. Thank you for your contributions.

@stale stale bot added the stale label Nov 4, 2018
@stale stale bot closed this as completed Dec 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants