I'm not familiar with the Net::RabbitMQ perl module or how it leverages the rabbitmq-c library, so grain of salt here:<div><br></div><div>Without looking at your code, I'm guessing that you don't to re-connect to the broker after the broker is cycled.</div>
<div><br></div><div>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.</div>
<div><br></div><div>I am curious about the segfault you are seeing. Do you have a succinct example that can reproduce this segfault?</div><div><br></div><div>-Alan</div><div><br></div><div><div class="gmail_quote">On Tue, Apr 3, 2012 at 9:25 AM, Matti Linnanvuori <span dir="ltr"><<a href="mailto:matti.linnanvuori@portalify.com">matti.linnanvuori@portalify.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi!<div><br></div><div>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.</div>
<div><br></div><div>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.</div>
<div><br></div><div>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.</div>
<div><br></div><div>I got the following state in gdb with recv:</div><div><br></div><div><div>0x00007f38e70b7935 in recv () from /lib64/libpthread.so.0</div><div>(gdb) bt</div><div>#0 0x00007f38e70b7935 in recv () from /lib64/libpthread.so.0</div>
<div>#1 0x00007f38e5cfba4d in recv (__flags=<value optimized out>, </div><div> __n=<value optimized out>, __buf=<value optimized out>, </div><div> __fd=<value optimized out>) at /usr/include/bits/socket2.h:45</div>
<div>#2 wait_frame_inner (__flags=<value optimized out>, </div><div> __n=<value optimized out>, __buf=<value optimized out>, </div><div> __fd=<value optimized out>) at amqp_socket.c:182</div>
<div>#3 0x00007f38e5ce78b9 in internal_recv (RETVAL=0xbf4f68, conn=0xbe1440, </div><div> piggyback=0) at RabbitMQ.xs:77</div><div>#4 0x00007f38e5ce8566 in XS_Net__RabbitMQ_recv (</div><div> my_perl=<value optimized out>, cv=<value optimized out>) at RabbitMQ.xs:424</div>
<div>#5 0x000000000047e115 in Perl_pp_entersub ()</div><div>#6 0x0000000000455ad3 in Perl_runops_debug ()</div><div>#7 0x000000000047a1af in perl_run ()</div><div>#8 0x000000000042172c in main ()</div><div>(gdb) continue</div>
<div>Continuing.</div><div>^C</div><div>Program received signal SIGINT, Interrupt.</div><div>0x00007f38e70b7935 in recv () from /lib64/libpthread.so.0</div><div>(gdb) bt</div><div>#0 0x00007f38e70b7935 in recv () from /lib64/libpthread.so.0</div>
<div>#1 0x00007f38e5cfba4d in recv (__flags=<value optimized out>, </div><div> __n=<value optimized out>, __buf=<value optimized out>, </div><div> __fd=<value optimized out>) at /usr/include/bits/socket2.h:45</div>
<div>#2 wait_frame_inner (__flags=<value optimized out>, </div><div> __n=<value optimized out>, __buf=<value optimized out>, </div><div> __fd=<value optimized out>) at amqp_socket.c:182</div>
<div>#3 0x00007f38e5ce78b9 in internal_recv (RETVAL=0xbf4f68, conn=0xbe1440, </div><div> piggyback=0) at RabbitMQ.xs:77</div><div>#4 0x00007f38e5ce8566 in XS_Net__RabbitMQ_recv (</div><div> my_perl=<value optimized out>, cv=<value optimized out>) at RabbitMQ.xs:424</div>
<div>#5 0x000000000047e115 in Perl_pp_entersub ()</div><div>#6 0x0000000000455ad3 in Perl_runops_debug ()</div><div>#7 0x000000000047a1af in perl_run ()</div><div>#8 0x000000000042172c in main ()</div><div>(gdb) up</div>
<div>#1 0x00007f38e5cfba4d in recv (__flags=<value optimized out>, </div><div> __n=<value optimized out>, __buf=<value optimized out>, </div><div> __fd=<value optimized out>) at /usr/include/bits/socket2.h:45</div>
<div>45<span style="white-space:pre-wrap">        </span> return __recv_alias (__fd, __buf, __n, __flags);</div><div>(gdb) up</div><div>#2 wait_frame_inner (__flags=<value optimized out>, </div><div> __n=<value optimized out>, __buf=<value optimized out>, </div>
<div> __fd=<value optimized out>) at amqp_socket.c:182</div><div>182<span style="white-space:pre-wrap">        </span> res = recv(state->sockfd, state->sock_inbound_buffer.bytes,</div><div>(gdb) up</div><div>#3 0x00007f38e5ce78b9 in internal_recv (RETVAL=0xbf4f68, conn=0xbe1440, </div>
<div> piggyback=0) at RabbitMQ.xs:77</div><div>77<span style="white-space:pre-wrap">        </span> result = amqp_simple_wait_frame(conn, &frame);</div><div>(gdb) print conn</div><div>$1 = (amqp_connection_state_t) 0xbe1440</div>
<div>(gdb) print *conn</div><div>$2 = {frame_pool = {pagesize = 131072, pages = {num_blocks = 5, </div><div> blocklist = 0xc5d4f0}, large_blocks = {num_blocks = 0, blocklist = 0x0}, </div><div> next_page = 0, alloc_block = 0x0, alloc_used = 0}, decoding_pool = {</div>
<div> pagesize = 131072, pages = {num_blocks = 1, blocklist = 0xbf22e0}, </div><div> large_blocks = {num_blocks = 0, blocklist = 0x0}, next_page = 0, </div><div> alloc_block = 0x0, alloc_used = 0}, state = CONNECTION_STATE_IDLE, </div>
<div> channel_max = 0, frame_max = 131072, heartbeat = 0, inbound_buffer = {</div><div> len = 131072, bytes = 0x0}, inbound_offset = 0, target_size = 7, </div><div> outbound_buffer = {len = 131072, bytes = 0xc67f90}, sockfd = 3, </div>
<div> sock_inbound_buffer = {len = 131072, bytes = 0x7f38e7b57010}, </div><div> sock_inbound_offset = 79, sock_inbound_limit = 79, first_queued_frame = 0x0, </div><div> last_queued_frame = 0x0, most_recent_api_result = {</div>
<div> reply_type = AMQP_RESPONSE_NORMAL, reply = {id = 3932181, </div><div> decoded = 0x7f38e7af1038}, library_error = 0}}</div></div><div><br></div><div><br><div>
<div style="word-wrap:break-word"><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">
<div>regards, Matti Linnanvuori</div></div></span></div>
</div>
<br></div></div><br>_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
<br></blockquote></div><br></div>