[rabbitmq-discuss] librabbitmq faults

Alan Antonuk alan.antonuk at gmail.com
Tue Apr 3 15:52:46 BST 2012


I'm not familiar with the Net::RabbitMQ perl module or how it leverages the
rabbitmq-c library, so grain of salt here:

Without looking at your code, I'm guessing that you don't to re-connect to
the broker after the broker is cycled.

When the broker is stopped and brought back up all connections are
disconnected.  Trying to use a connection will result in an error claiming
the socket is closed.  On the client side, you need to detect that your
connection to the broker has failed, and take appropriate actions to
reconnect to the broker before trying to get or consume a message.

I am curious about the segfault you are seeing.  Do you have
a succinct example that can reproduce this segfault?

-Alan

On Tue, Apr 3, 2012 at 9:25 AM, Matti Linnanvuori <
matti.linnanvuori at portalify.com> wrote:

> Hi!
>
> I have encountered two possible faults in librabbitmq
> (rabbitmq-c-fb6fca832fd2). I am trying to use that latest version
> customized with Perl Net::RabbitMQ on SLES 11 SP 1.
>
> One is that amqp_simple_wait_frame and recv do not respond to messages
> being published to an exchange after rabbitmqctl stop_app, reset and
> start_app. That problem appears also with Net::RabbitMQ versions 0.2.2 and
> 0.2.0.
>
> Another is that amqp_basic_get fails with error Operation not
> permitted after rabbitmqctl stop_app, reset and start_app.  That problem
> appears also with Net::RabbitMQ versions 0.2.2 and 0.2.0, but there is a
> segmentation fault.
>
> I got the following state in gdb with recv:
>
> 0x00007f38e70b7935 in recv () from /lib64/libpthread.so.0
> (gdb) bt
> #0  0x00007f38e70b7935 in recv () from /lib64/libpthread.so.0
> #1  0x00007f38e5cfba4d in recv (__flags=<value optimized out>,
>     __n=<value optimized out>, __buf=<value optimized out>,
>     __fd=<value optimized out>) at /usr/include/bits/socket2.h:45
> #2  wait_frame_inner (__flags=<value optimized out>,
>     __n=<value optimized out>, __buf=<value optimized out>,
>     __fd=<value optimized out>) at amqp_socket.c:182
> #3  0x00007f38e5ce78b9 in internal_recv (RETVAL=0xbf4f68, conn=0xbe1440,
>     piggyback=0) at RabbitMQ.xs:77
> #4  0x00007f38e5ce8566 in XS_Net__RabbitMQ_recv (
>     my_perl=<value optimized out>, cv=<value optimized out>) at
> RabbitMQ.xs:424
> #5  0x000000000047e115 in Perl_pp_entersub ()
> #6  0x0000000000455ad3 in Perl_runops_debug ()
> #7  0x000000000047a1af in perl_run ()
> #8  0x000000000042172c in main ()
> (gdb) continue
> Continuing.
> ^C
> Program received signal SIGINT, Interrupt.
> 0x00007f38e70b7935 in recv () from /lib64/libpthread.so.0
> (gdb) bt
> #0  0x00007f38e70b7935 in recv () from /lib64/libpthread.so.0
> #1  0x00007f38e5cfba4d in recv (__flags=<value optimized out>,
>     __n=<value optimized out>, __buf=<value optimized out>,
>     __fd=<value optimized out>) at /usr/include/bits/socket2.h:45
> #2  wait_frame_inner (__flags=<value optimized out>,
>     __n=<value optimized out>, __buf=<value optimized out>,
>     __fd=<value optimized out>) at amqp_socket.c:182
> #3  0x00007f38e5ce78b9 in internal_recv (RETVAL=0xbf4f68, conn=0xbe1440,
>     piggyback=0) at RabbitMQ.xs:77
> #4  0x00007f38e5ce8566 in XS_Net__RabbitMQ_recv (
>     my_perl=<value optimized out>, cv=<value optimized out>) at
> RabbitMQ.xs:424
> #5  0x000000000047e115 in Perl_pp_entersub ()
> #6  0x0000000000455ad3 in Perl_runops_debug ()
> #7  0x000000000047a1af in perl_run ()
> #8  0x000000000042172c in main ()
> (gdb) up
> #1  0x00007f38e5cfba4d in recv (__flags=<value optimized out>,
>     __n=<value optimized out>, __buf=<value optimized out>,
>     __fd=<value optimized out>) at /usr/include/bits/socket2.h:45
> 45  return __recv_alias (__fd, __buf, __n, __flags);
> (gdb) up
> #2  wait_frame_inner (__flags=<value optimized out>,
>     __n=<value optimized out>, __buf=<value optimized out>,
>     __fd=<value optimized out>) at amqp_socket.c:182
> 182    res = recv(state->sockfd, state->sock_inbound_buffer.bytes,
> (gdb) up
> #3  0x00007f38e5ce78b9 in internal_recv (RETVAL=0xbf4f68, conn=0xbe1440,
>     piggyback=0) at RabbitMQ.xs:77
> 77      result = amqp_simple_wait_frame(conn, &frame);
> (gdb) print conn
> $1 = (amqp_connection_state_t) 0xbe1440
> (gdb) print *conn
> $2 = {frame_pool = {pagesize = 131072, pages = {num_blocks = 5,
>       blocklist = 0xc5d4f0}, large_blocks = {num_blocks = 0, blocklist =
> 0x0},
>     next_page = 0, alloc_block = 0x0, alloc_used = 0}, decoding_pool = {
>     pagesize = 131072, pages = {num_blocks = 1, blocklist = 0xbf22e0},
>     large_blocks = {num_blocks = 0, blocklist = 0x0}, next_page = 0,
>     alloc_block = 0x0, alloc_used = 0}, state = CONNECTION_STATE_IDLE,
>   channel_max = 0, frame_max = 131072, heartbeat = 0, inbound_buffer = {
>     len = 131072, bytes = 0x0}, inbound_offset = 0, target_size = 7,
>   outbound_buffer = {len = 131072, bytes = 0xc67f90}, sockfd = 3,
>   sock_inbound_buffer = {len = 131072, bytes = 0x7f38e7b57010},
>   sock_inbound_offset = 79, sock_inbound_limit = 79, first_queued_frame =
> 0x0,
>   last_queued_frame = 0x0, most_recent_api_result = {
>     reply_type = AMQP_RESPONSE_NORMAL, reply = {id = 3932181,
>       decoded = 0x7f38e7af1038}, library_error = 0}}
>
>
> regards, Matti Linnanvuori
>
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120403/48f7736c/attachment.htm>


More information about the rabbitmq-discuss mailing list