EV (epoll) and Mojo::IOLoop::Client bug?

Marc Lehmann schmorp at schmorp.de
Sat Sep 12 15:48:24 CEST 2015


On Fri, Sep 11, 2015 at 08:46:15PM +0500, Andrey Khozov <avkhozov at googlemail.com> wrote:
> > If you are good with a debugger (e.g. gdb), an easy way is to set a
> > breaskpoint on the dup2 call, and when it triggers (and you amde sure it is
> > that call), you can get a perl backtrace via e.g. Perl_eval ("use
> > Carp;Carp::confess",1)
> 
> ​Not sure what I can do is just make. But I will try, thanks.​

Primarily, you should find out which code registers the watcher and
connects.  The hint you have is that the code tries to connect to
[::1]:27017 and then 127.0.0.1:27017 - whats running on port 27017 on that
box?

Normally the bug is then in the perl module that interfaces with that, in
the caller, or in some lower level library. However, in this case, this
really looks like a connection made with AnyEvent::Socket::tcp_connect,
which doesn't call dup2.

However, there is a complicating factor:

   socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 4
   ...
   dup2(4, 3)                              = 3

What happens here is that something createa a tcp socket and then
(seemingly) ovewrwrites the socket created earlier.

I don't know what happens in the "..." part, but if that doesn't close the
socket, then it looks as if some unrelated part in the program closes a
socket by another part. That's why it is important to find out what causes
the dup2 call.

Again, I don't know what happens in the "..." part, but if nothing funny goes
on, the code that does the dup2 is likely the culprit, and that is where you
would need to report this to.

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schmorp at schmorp.de
      -=====/_/_//_/\_,_/ /_/\_\



More information about the anyevent mailing list