Do you get the same problems building it off of the master branch?<br><div>On Thu, Apr 10, 2014 at 4:46 AM, Dushin Fred <<a href="mailto:fred@dushin.net">fred@dushin.net</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Sorry, I should have been more clear.<div><br></div><div>The original issue I hit was from a build off the 2.3 tag (<span style="font-family:Helvetica;font-size:13px">418f31f</span>).  So the patch I applied was slightly different:</div>
<div><br></div><div>> git diff<br>diff --git a/src/ChannelImpl.cpp b/src/ChannelImpl.cpp<br>index 9749556..864502b 100644<br>--- a/src/ChannelImpl.cpp<br>+++ b/src/ChannelImpl.cpp<br>@@ -152,6 +152,7 @@ amqp_channel_t ChannelImpl::GetChannel()<br>
 <br> void ChannelImpl::ReturnChannel(amqp_channel_t channel)<br> {<br>+       amqp_maybe_release_buffers_on_channel(m_connection, channel);<br>     <a href="http://m_channels.at" target="_blank">m_channels.at</a>(channel) = CS_Open;<br>
     m_last_used_channel = channel;<br> }<br><br></div><div>I fully respect that this may not be the "right" fix, but in my limited scenario (the sender.cpp program I posted off github), it does the trick.</div>
<div><br></div><div>I have done zero analysis of the right fix, but I'd be happy to crack open the code and look into it, if the root cause of the bug is not immediately evident to you.  Otherwise, if you have any thoughts, feel free to let me know.</div>
<div><br></div><div>And of course I would prefer (as I suspect many would) that the fix go into master, as this bug seems to effectively render the C++ client library unsuitable for production, and I would prefer not to maintain a fix that is not endorsed by the author/maintainer.</div>
</div><div style="word-wrap:break-word"><div><br></div><div>-Fred</div></div><div style="word-wrap:break-word"><div><br><div><div>On Apr 10, 2014, at 1:11 AM, Alan Antonuk <<a href="mailto:alan.antonuk@gmail.com" target="_blank">alan.antonuk@gmail.com</a>> wrote:</div>
<br><blockquote type="cite"><div dir="ltr"><div class="gmail_extra">What version of SimpleAmqpClient are you using? The lines surrounding your change <a href="https://github.com/alanxz/SimpleAmqpClient/blob/master/src/ChannelImpl.cpp#L153" target="_blank">don't seem to match what is currently</a> in the master branch of SimpleAmqpClient. I believe behavior you're seeing was addressed a while ago (see <a href="https://github.com/alanxz/SimpleAmqpClient/issues/56" target="_blank">Issue #56</a>). Please download the master branch and build from that, you will also need rabbitmq-c v0.4.1 or newer for this to work.</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">FYI: the patch you are suggesting using will likely cause undefined behavior. Because of the way rabbitmq-c's memory management works, the SimpleAmqpClient cannot call amqp_maybe_release_buffers() until it no longer holds any references to frames returned from amqp_simple_wait_frame(). Once amqp_maybe_release_buffers() (or amqp_maybe_release_buffers_on_channel()) any outstanding frames are considered freed and their use will lead to undefined behavior. SimpleAmqpClient maintains a list of frames that it has seen from the broker, in <a href="https://github.com/alanxz/SimpleAmqpClient/blob/master/src/ChannelImpl.cpp#L446" target="_blank">ChannelImpl::MaybeReleaseBuffersOnChannel</a> it checks to see if there are any frames that it still has a reference to before calling amqp_maybe_release_buffers()</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">-Alan</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 9, 2014 at 3:17 PM, Dushin Fred <span dir="ltr"><<a href="mailto:fred@dushin.net" target="_blank">fred@dushin.net</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">That works for me, too.  Thanks, Abhay.<div>

<div><br></div><div>Alan, would you like a pull request?  Is there a timeline for folding this an the other recent fixes into master?  Anything I can do to help expedite?</div><div><span><font color="#888888"><div>
<br></div><div>-Fred</div></font></span><div><br><div><div>On Apr 9, 2014, at 4:54 AM, Abhay Rajure <<a href="mailto:arajure@gmail.com" target="_blank">arajure@gmail.com</a>> wrote:</div><br><blockquote type="cite">

<span style="font-family:Monaco;font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">Try this --</span><br style="font-family:Monaco;font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">

<br style="font-family:Monaco;font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">

<span style="font-family:Monaco;font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">In File SimpleAmqpClient/src/ChannelImpl.cpp,</span><br style="font-family:Monaco;font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">

<span style="font-family:Monaco;font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">call amqp_maybe_release_buffers_on_channel() in ReturnChannel().</span><br style="font-family:Monaco;font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">

<br style="font-family:Monaco;font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">

<span style="font-family:Monaco;font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">void ChannelImpl::ReturnChannel(amqp_chanel_t channel)</span><br style="font-family:Monaco;font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">

<span style="font-family:Monaco;font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">{</span><br style="font-family:Monaco;font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">

<span style="font-family:Monaco;font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">  +amqp_maybe_release_buffers_on_channel(m_connection, channel);</span><br style="font-family:Monaco;font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">

<span style="font-family:Monaco;font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">   m_free_channels.push(channel);</span><br style="font-family:Monaco;font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">

<span style="font-family:Monaco;font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">}</span><br style="font-family:Monaco;font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">

</blockquote></div><br></div></div></div></div><br>_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com" target="_blank">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>
_______________________________________________<br>rabbitmq-discuss mailing list<br><a href="mailto:rabbitmq-discuss@lists.rabbitmq.com" target="_blank">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>
</blockquote></div><br></div></div>______________________________<u></u>_________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com" target="_blank">rabbitmq-discuss@lists.<u></u>rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/<u></u>cgi-bin/mailman/listinfo/<u></u>rabbitmq-discuss</a><br>
</blockquote>