omniti-labs / Net--RabbitMQ

Perl bindings to the librabbitmq-c AMQP library.
Other
25 stars 18 forks source link

SIGPIPE / Bad frame read #20

Closed emarcotte closed 12 years ago

emarcotte commented 12 years ago

It seems like there's some sort of heartbeat/timeout bug that I'm encountering. I have a little script waiting for messages using recv. My initial first pass was to undef my broker and reconnect, but doing so causes DESTROY to crash with SIGPIPE. Below is some GDB output.

Bad frame read. 

Program received signal SIGPIPE, Broken pipe.
0x0000003b1260d8c0 in __write_nocancel () from /lib64/libpthread.so.0
(gdb) bt
#0  0x0000003b1260d8c0 in __write_nocancel () from /lib64/libpthread.so.0
#1  0x00002aaaafb50aac in amqp_send_frame (state=0x18cf670, frame=<value optimized out>) at amqp_connection.c:384
#2  0x00002aaaafb5a04e in amqp_send_method (state=0x8, channel=<value optimized out>, id=22, 
    decoded=0xffffffffffffffff) at amqp_socket.c:249
#3  0x00002aaaafb5a0b2 in amqp_simple_rpc (state=0x18cf670, channel=800, request_id=4294967264, 
    expected_reply_ids=0x7fffffffda30, decoded_request_method=0x7fffffffdb40) at amqp_socket.c:272
#4  0x00002aaaafb503aa in amqp_connection_close (state=0x18cf670, code=200) at amqp_api.c:116
#5  0x00002aaaafb469dd in XS_Net__RabbitMQ_DESTROY (my_perl=<value optimized out>, cv=<value optimized out>)
    at RabbitMQ.xs:705
#6  0x0000003935490aa6 in Perl_pp_entersub () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#7  0x00000039354338a7 in ?? () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#8  0x00000039354376f0 in Perl_call_sv () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#9  0x0000003935495426 in Perl_sv_clear () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#10 0x0000003935495bd0 in Perl_sv_free () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#11 0x0000003935495737 in Perl_sv_clear () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#12 0x0000003935495bd0 in Perl_sv_free () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#13 0x0000003935484cbc in Perl_hv_free_ent () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#14 0x0000003935484e26 in ?? () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#15 0x0000003935486750 in Perl_hv_undef () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#16 0x000000393549582a in Perl_sv_clear () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#17 0x0000003935495bd0 in Perl_sv_free () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#18 0x00000039354b82cc in Perl_free_tmps () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#19 0x000000393548b7da in Perl_pp_nextstate () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#20 0x000000393548a34e in Perl_runops_standard ()
   from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#21 0x0000003935437e9c in perl_run () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#22 0x00000000004017bc in main ()
(gdb) 
emarcotte commented 12 years ago

This may actually be due to our load balancer configuration, but ideally we wouldn't get SIGPIPE on a bad read. I may be able to provide a pull request to fix this, but I haven't gotten that far yet.

emarcotte commented 12 years ago

Argh, nevermind. I've got a secret fork killing my connections. How do I close an issue?