<div dir="ltr">Rohit;<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 13, 2014 at 7:05 AM, Rohit Patle <span dir="ltr"><<a href="mailto:Rohit.Patle@techmahindra.com" target="_blank">Rohit.Patle@techmahindra.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div>
<div style="direction:ltr;font-size:10pt;font-family:Tahoma">Hi Alan,<br>
<br>
As suggested by you I run our code with Valgrind and also with GDB bellow is the outcome for your reference. </div></div></blockquote><div><br></div><div>For your valgrind run could you modify your program to exit the program after doing a couple runs of your loop (instead of using ^C to break out of the program)? The leak that valgrind is showing is because the program is being terminated in the middle of the loop, so the amqp_connection_state_t object isn't freed.</div>
<div><br></div><div>When I tried to reproduce your situation last night by repeatedly failing to connect to a broker in a tight loop (you should really consider having some kind of exponential back-off or a limit on the number of retries in this case too...) I was unable to reproduce the runaway memory consumption you were seeing.</div>
<div>�</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="direction:ltr;font-size:10pt;font-family:Tahoma">From GDB outcome I can see that the Segmentation fault occurs due to non availability of malloc_consolidate in malloc.c also I am not able to find the
 file in my downloaded rabbitmq-c-master package.<br></div></div></blockquote><div><br></div><div>malloc.c is part of the C standard library, probably glibc. The fact that gdb cannot find is is not surprising (and not really of too much concern in this case - gdb is just looking for it to print out the line that thinks the segfault occurred on). The segfault however is concerning - when you get these you should do a 'bt' command in gdb which will give you a backtrace. Its easier to then to figure out what call into malloc() or free() is causing the error.</div>
<div><br></div><div>-Alan�</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="direction:ltr;font-size:10pt;font-family:Tahoma">
<br>
Please suggest.<br>
<br>
========================= Valgrind ======================<br>
==6778== <br>
==6778== Process terminating with default action of signal 2 (SIGINT)<br>
==6778==��� at 0x414D311: connect (socket.S:64)<br>
==6778==��� by 0x69682E30: ???<br>
==6778== <br>
==6778== HEAP SUMMARY:<br>
==6778==���� in use at exit: 667,319 bytes in 3,295 blocks<br>
==6778==�� total heap usage: 4,393 allocs, 1,098 frees, 789,240 bytes allocated<br>
==6778== <br>
==6778== Searching for pointers to 3,295 not-freed blocks<br>
==6778== Checked 206,660 bytes<br>
==6778== <br>
==6778== 414,730 (344 direct, 414,386 indirect) bytes in 2 blocks are definitely lost in loss record 378 of 378<br>
==6778==��� at 0x402A5E6: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)<br>
==6778==��� by 0x404C623: amqp_new_connection (amqp_connection.c:68)<br>
==6778==��� by 0x40754D2: (below main) (libc-start.c:226)<br>
==6778== <br>
==6778== LEAK SUMMARY:<br>
==6778==��� definitely lost: 344 bytes in 2 blocks<br>
==6778==��� indirectly lost: 414,386 bytes in 372 blocks<br>
==6778==����� possibly lost: 0 bytes in 0 blocks<br>
==6778==��� still reachable: 252,589 bytes in 2,921 blocks<br>
==6778==�������� suppressed: 0 bytes in 0 blocks<br>
==6778== Reachable blocks (those to which a pointer was found) are not shown.<br>
==6778== To see them, rerun with: --leak-check=full --show-reachable=yes<br>
==6778== <br>
==6778== Use --track-origins=yes to see where uninitialised values come from<br>
==6778== ERROR SUMMARY: 7 errors from 2 contexts (suppressed: 0 from 0)<br>
==6778== <br>
==6778== 6 errors in context 1 of 2:<br>
==6778== Conditional jump or move depends on uninitialised value(s)<br>
==6778==��� at 0x4346494: ASN1_STRING_set (asn1_lib.c:382)<br>
==6778==��� by 0x432FF02: ASN1_mbstring_ncopy (a_mbstr.c:204)<br>
==6778==��� by 0x433018A: ASN1_mbstring_copy (a_mbstr.c:86)<br>
==6778==��� by 0x4331258: ASN1_STRING_to_UTF8 (a_strex.c:570)<br>
==6778==��� by 0x4332F0B: x509_name_canon (x_name.c:408)<br>
==6778==��� by 0x43335BF: x509_name_ex_d2i (x_name.c:210)<br>
==6778==��� by 0x433B017: ASN1_item_ex_d2i (tasn_dec.c:239)<br>
==6778==��� by 0x433BD9E: asn1_template_noexp_d2i (tasn_dec.c:746)<br>
==6778== <br>
==6778== ERROR SUMMARY: 7 errors from 2 contexts (suppressed: 0 from 0)<br>
===============================END==================<br>
<br>
GDB outcome:<br>
<br>
========================== GDB =======================<br>
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".<br>
creating connection<br>
opening SSL/TLS connection<br>
<br>
Program received signal SIGSEGV, Segmentation fault.<br>
0xb7e80175 in malloc_consolidate (av=0xb7fb0440) at malloc.c:4278<br>
4278�� �malloc.c: No such file or directory.<br>
(gdb) n<br>
===================================================== <br>
<br>
Thanks & Regards,<br>
Rohit<br>
<br>
<br>
</div>
<br>
<hr>
<font face="Arial" color="Navy"><br>
DISCLAIMER:<br>
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or
 all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.<br>
</font>
</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></div>