Skip Menu |

This queue is for tickets about the Net--RabbitMQ CPAN distribution.

Report information
The Basics
Id: 79411
Status: open
Priority: 0/
Queue: Net--RabbitMQ

People
Owner: Nobody in particular
Requestors: theo.bot [...] proxy.nl
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Connect with invalid password exits
Date: Wed, 5 Sep 2012 10:22:22 +0200
To: bug-Net--RabbitMQ [...] rt.cpan.org
From: Theo Bot <theo.bot [...] proxy.nl>
Hi When I want to connect to a RabbitMQ server with invalid credentials, the program exits, with exitcode 141. Thereby I am unable to trap the exception neithor with eval nor with try/catch. -- Met vriendelijke groet, Theo Bot LinkedIn: http://www.linkedin.com/in/theobot
From: rujian.hu [...] alibaba-inc.com
在2012-九月-05 04:22:36 星期三时,theo.bot@proxy.nl写到: Show quoted text
> Hi When I want to connect to a RabbitMQ server with invalid
credentials, Show quoted text
> the program exits, with exitcode 141. Thereby I am unable to trap the > exception neithor with eval nor with try/catch. >
I have the same error. When RabbitMQ abort Abnormally, my program exits with error code 141.Although I catch the code with eval. Anyone has suggestions? Thanks very much.
Subject: Re: [rt.cpan.org #79411] Connect with invalid password exits
Date: Fri, 19 Oct 2012 16:12:01 +0200
To: bug-Net--RabbitMQ [...] rt.cpan.org
From: Theo Bot <theo.bot [...] proxy.nl>
Hi I created a work-around by adding the following: $SIG{'PIPE'} = 'IGNORE'; Theo On Thu, Oct 18, 2012 at 3:57 PM, Richie Hu via RT < bug-Net--RabbitMQ@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=79411 > > > 在2012-九月-05 04:22:36 星期三时,theo.bot@proxy.nl写到:
> > Hi When I want to connect to a RabbitMQ server with invalid
> credentials,
> > the program exits, with exitcode 141. Thereby I am unable to trap the > > exception neithor with eval nor with try/catch. > >
> I have the same error. When RabbitMQ abort Abnormally, my program exits > with error code 141.Although I catch the code with eval. Anyone has > suggestions? Thanks very much. > > >
-- Met vriendelijke groet, Theo Bot Network Management Engineer Tel: +31653965698 e-mail: theo.bot@proxy.nl Website: http://www.proxy.nl LinkedIn: http://www.linkedin.com/in/theobot
Subject: unhandled SIG{PIPE} causes process exit if rabbitmq server isn't there
From: peter [...] morch.com
The problem wasn't really about invalid passwords. The problem was that Net--RabbitMQ writes to a socket and the other end has closed that socket, which causes a SIGPIPE signal. I noticed it because my process exited when rabbitmq got restarted (which of course closes the socket). Setting up a dummy $SIG{'PIPE'} = 'IGNORE' as a workaround also worked for my use-case. The problem occurs in the destructor (see attached gdb backtrace), and so the process exists, when the $mq handle goes out of scope. https://github.com/pmorch/Net--RabbitMQ/commit/44ad5380c7cea6da7796972ff8679bb636fc631a contains a fix (where the SIGPIPE is ignored tightly around write()). There is also more documentation in amqp_socket.c's write_ignore_pipe_signal() about the fix applied. I'll file a separate pull request for that on github. But basically my analysis leads me to believe that the perl process will exit because of an unhandled SIG{PIPE} whenever a handle goes out of scope (including because of an error) if the other end has disappeared for whatever reason. I suggest changing the title of the bug to "unhandled SIG{PIPE} causes process exit if rabbitmq server isn't there" ( I don't think I can do that )
Subject: backtrace.txt
Program received signal SIGPIPE, Broken pipe. 0x00007ffff73de0d0 in __write_nocancel () from /lib/libpthread.so.0 (gdb) bt #0 0x00007ffff73de0d0 in __write_nocancel () from /lib/libpthread.so.0 #1 0x00007ffff5bcb014 in amqp_send_frame (state=0x62f5f0, frame=0x7fffffffd890) at amqp_connection.c:384 #2 0x00007ffff5bde895 in amqp_send_method (state=0x62f5f0, channel=0, id=655420, decoded=0x7fffffffd9a0) at amqp_socket.c:249 #3 0x00007ffff5bde926 in amqp_simple_rpc (state=0x62f5f0, channel=0, request_id=655420, expected_reply_ids=0x7fffffffd9d0, decoded_request_method=0x7fffffffd9a0) at amqp_socket.c:272 #4 0x00007ffff5bc8f66 in amqp_connection_close (state=0x62f5f0, code=200) at amqp_api.c:118 #5 0x00007ffff5bc6631 in XS_Net__RabbitMQ_DESTROY (my_perl=0x6, cv=0xab9e08) at RabbitMQ.xs:705 #6 0x00007ffff7b1d675 in Perl_pp_entersub () from /usr/lib/libperl.so.5.10 #7 0x00007ffff7abfe56 in Perl_call_sv () from /usr/lib/libperl.so.5.10 #8 0x00007ffff7b2ffc6 in Perl_sv_clear () from /usr/lib/libperl.so.5.10 #9 0x00007ffff7b307c2 in Perl_sv_free2 () from /usr/lib/libperl.so.5.10 #10 0x00007ffff7b4c660 in Perl_free_tmps () from /usr/lib/libperl.so.5.10 #11 0x00007ffff7b1ef30 in Perl_pp_nextstate () from /usr/lib/libperl.so.5.10 #12 0x00007ffff7b1bbb6 in Perl_runops_standard () from /usr/lib/libperl.so.5.10 #13 0x00007ffff7ac078c in perl_run () from /usr/lib/libperl.so.5.10 #14 0x0000000000400f24 in main ()
Subject: Re: [rt.cpan.org #79411] unhandled SIG{PIPE} causes process exit if rabbitmq server isn't there
Date: Tue, 26 Feb 2013 08:33:56 +0100
To: bug-Net--RabbitMQ [...] rt.cpan.org
From: Theo Bot <theo.bot [...] proxy.nl>
Hi Thank you for the research. I agree with you that the title is not appropriate, however I wouldn't know how to change it. Kind regards, Theo On Mon, Feb 25, 2013 at 12:23 AM, Peter Valdemar Mørch via RT < bug-Net--RabbitMQ@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=79411 > > > The problem wasn't really about invalid passwords. > > The problem was that Net--RabbitMQ writes to a socket and the other end > has closed that socket, which causes a SIGPIPE signal. > > I noticed it because my process exited when rabbitmq got restarted > (which of course closes the socket). > > Setting up a dummy $SIG{'PIPE'} = 'IGNORE' as a workaround also worked > for my use-case. > > The problem occurs in the destructor (see attached gdb backtrace), and > so the process exists, when the $mq handle goes out of scope. > > > https://github.com/pmorch/Net--RabbitMQ/commit/44ad5380c7cea6da7796972ff8679bb636fc631a > contains a fix (where the SIGPIPE is ignored tightly around write()). > There is also more documentation in amqp_socket.c's > write_ignore_pipe_signal() about the fix applied. > > I'll file a separate pull request for that on github. > > But basically my analysis leads me to believe that the perl process will > exit because of an unhandled SIG{PIPE} whenever a handle goes out of > scope (including because of an error) if the other end has disappeared > for whatever reason. > > I suggest changing the title of the bug to "unhandled SIG{PIPE} causes > process exit if rabbitmq server isn't there" ( I don't think I can do that > ) > > > Program received signal SIGPIPE, Broken pipe. > 0x00007ffff73de0d0 in __write_nocancel () from /lib/libpthread.so.0 > (gdb) bt > #0 0x00007ffff73de0d0 in __write_nocancel () from /lib/libpthread.so.0 > #1 0x00007ffff5bcb014 in amqp_send_frame (state=0x62f5f0, > frame=0x7fffffffd890) at amqp_connection.c:384 > #2 0x00007ffff5bde895 in amqp_send_method (state=0x62f5f0, channel=0, > id=655420, decoded=0x7fffffffd9a0) at amqp_socket.c:249 > #3 0x00007ffff5bde926 in amqp_simple_rpc (state=0x62f5f0, channel=0, > request_id=655420, expected_reply_ids=0x7fffffffd9d0, > decoded_request_method=0x7fffffffd9a0) at amqp_socket.c:272 > #4 0x00007ffff5bc8f66 in amqp_connection_close (state=0x62f5f0, code=200) > at amqp_api.c:118 > #5 0x00007ffff5bc6631 in XS_Net__RabbitMQ_DESTROY (my_perl=0x6, > cv=0xab9e08) > at RabbitMQ.xs:705 > #6 0x00007ffff7b1d675 in Perl_pp_entersub () from /usr/lib/libperl.so.5.10 > #7 0x00007ffff7abfe56 in Perl_call_sv () from /usr/lib/libperl.so.5.10 > #8 0x00007ffff7b2ffc6 in Perl_sv_clear () from /usr/lib/libperl.so.5.10 > #9 0x00007ffff7b307c2 in Perl_sv_free2 () from /usr/lib/libperl.so.5.10 > #10 0x00007ffff7b4c660 in Perl_free_tmps () from /usr/lib/libperl.so.5.10 > #11 0x00007ffff7b1ef30 in Perl_pp_nextstate () from > /usr/lib/libperl.so.5.10 > #12 0x00007ffff7b1bbb6 in Perl_runops_standard () from > /usr/lib/libperl.so.5.10 > #13 0x00007ffff7ac078c in perl_run () from /usr/lib/libperl.so.5.10 > #14 0x0000000000400f24 in main () > > >
-- Met vriendelijke groet, Theo Bot Network Management Engineer Website: http://www.proxy.nl LinkedIn: http://www.linkedin.com/in/theobot