<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>
<channel>
	<title>Comments on: Sending buffer overflows fixed in bitcoind, and other cleanups</title>
	<atom:link href="http://jfxpt.com/2022/sending-buffer-overflows-fixed-in-bitcoind-and-other-cleanups/feed/" rel="self" type="application/rss+xml" />
	<link>http://jfxpt.com/2022/sending-buffer-overflows-fixed-in-bitcoind-and-other-cleanups/</link>
	<description>The search for invariants</description>
	<pubDate>Sat, 04 Apr 2026 19:33:47 +0000</pubDate>
	<generator>http://polimedia.us</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: A thorny memory leak in bitcoind, and a way forward &#171; Fixpoint</title>
		<link>http://jfxpt.com/2022/sending-buffer-overflows-fixed-in-bitcoind-and-other-cleanups/#comment-3334</link>
		<dc:creator>A thorny memory leak in bitcoind, and a way forward &#171; Fixpoint</dc:creator>
		<pubDate>Thu, 09 Oct 2025 22:35:52 +0000</pubDate>
		<guid isPermaLink="false">http://fixpoint.welshcomputing.com/?p=183#comment-3334</guid>
		<description>[...] case one remotely exploitable leak wasn't enough, the Bitcoin codebase keeps on giving! The price chart, of course, keeps on taking [...]</description>
		<content:encoded><![CDATA[<p>[...] case one remotely exploitable leak wasn't enough, the Bitcoin codebase keeps on giving! The price chart, of course, keeps on taking [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jacob Welsh</title>
		<link>http://jfxpt.com/2022/sending-buffer-overflows-fixed-in-bitcoind-and-other-cleanups/#comment-2626</link>
		<dc:creator>Jacob Welsh</dc:creator>
		<pubDate>Wed, 20 Mar 2024 23:57:41 +0000</pubDate>
		<guid isPermaLink="false">http://fixpoint.welshcomputing.com/?p=183#comment-2626</guid>
		<description>Since apparently I didn't previously see the need to fully rub it in regarding the degree of deny-and-blame-others politicking that was at work here in place of anything resembling responsible stewardship:

&lt;blockquote&gt;
2020-05-15 19:26:19
&lt;strong&gt;asciilifeform&lt;/strong&gt;: http://logs.nosuchlabs.com/log/therealbitcoin/2020-05-15#1000138 &#60;&#60; btw i notice the wedge pill aint in there. may be 1 reason why jfw's box can't sync .
&lt;em&gt;&lt;strong&gt;snsabot&lt;/strong&gt;: Logged on 2020-05-15 14:09:11 jfw: I've read or at least skimmed all the vpatches ftr, signed &#38; hosted at http://fixpoint.welshcomputing.com/v/bitcoin/&lt;/em&gt;
...

&lt;strong&gt;jfw&lt;/strong&gt;: http://logs.nosuchlabs.com/log/therealbitcoin/2020-05-15#1000235 - from mod6's article I got the idea that his was still a halfway-fix, and yours still flagged experimental. I thought I'd wait for a finished thing before digging into it. Did I miss such a thing?
&lt;strong&gt;jfw&lt;/strong&gt;: don't think the 'wedge' is afflicting me though, RPC remains responsive.
...

&lt;strong&gt;asciilifeform&lt;/strong&gt;: http://logs.nosuchlabs.com/log/therealbitcoin/2020-05-16#1000278 &#60;&#60; this is half-correct : the patch asciilifeform &#38; mod6 baked, caps the mass of reply to 'getdata' for blox, but not tx. but thus far no one has observed a wedge powered by requesting mempool tx ( both asciilifeform and mod6 tried to make one artificially, and mod6 iirc wrote a debug log parser to look for 'heavy' tx, to throw in 'wedger' . )
&lt;em&gt;&lt;strong&gt;snsabot&lt;/strong&gt;: Logged on 2020-05-16 14:12:41 jfw: http://logs.nosuchlabs.com/log/therealbitcoin/2020-05-15#1000235 - from mod6's article I got the idea that his was still a halfway-fix, and yours still flagged experimental. I thought I'd wait for a finished thing before digging into it. Did I miss such a thing?&lt;/em&gt;
&lt;strong&gt;asciilifeform&lt;/strong&gt;: ( 100% proper patch would cap both. but neither of us at the time was immediately able to figure out how to use the internal knobs to determine tx mass )
...

&lt;strong&gt;jfw&lt;/strong&gt;: asciilifeform: hm, ok.
&lt;/blockquote&gt;</description>
		<content:encoded><![CDATA[<p>Since apparently I didn't previously see the need to fully rub it in regarding the degree of deny-and-blame-others politicking that was at work here in place of anything resembling responsible stewardship:</p>
<blockquote><p>
2020-05-15 19:26:19<br />
<strong>asciilifeform</strong>: <a href="http://logs.nosuchlabs.com/log/therealbitcoin/2020-05-15#1000138" rel="nofollow">http://logs.nosuchlabs.com/log/therealbitcoin/2020-05-15#1000138</a> &lt;&lt; btw i notice the wedge pill aint in there. may be 1 reason why jfw's box can't sync .<br />
<em><strong>snsabot</strong>: Logged on 2020-05-15 14:09:11 jfw: I've read or at least skimmed all the vpatches ftr, signed &amp; hosted at <a href="http://fixpoint.welshcomputing.com/v/bitcoin/" rel="nofollow">http://fixpoint.welshcomputing.com/v/bitcoin/</a></em><br />
...</p>
<p><strong>jfw</strong>: <a href="http://logs.nosuchlabs.com/log/therealbitcoin/2020-05-15#1000235" rel="nofollow">http://logs.nosuchlabs.com/log/therealbitcoin/2020-05-15#1000235</a> - from mod6's article I got the idea that his was still a halfway-fix, and yours still flagged experimental. I thought I'd wait for a finished thing before digging into it. Did I miss such a thing?<br />
<strong>jfw</strong>: don't think the 'wedge' is afflicting me though, RPC remains responsive.<br />
...</p>
<p><strong>asciilifeform</strong>: <a href="http://logs.nosuchlabs.com/log/therealbitcoin/2020-05-16#1000278" rel="nofollow">http://logs.nosuchlabs.com/log/therealbitcoin/2020-05-16#1000278</a> &lt;&lt; this is half-correct : the patch asciilifeform &amp; mod6 baked, caps the mass of reply to 'getdata' for blox, but not tx. but thus far no one has observed a wedge powered by requesting mempool tx ( both asciilifeform and mod6 tried to make one artificially, and mod6 iirc wrote a debug log parser to look for 'heavy' tx, to throw in 'wedger' . )<br />
<em><strong>snsabot</strong>: Logged on 2020-05-16 14:12:41 jfw: <a href="http://logs.nosuchlabs.com/log/therealbitcoin/2020-05-15#1000235" rel="nofollow">http://logs.nosuchlabs.com/log/therealbitcoin/2020-05-15#1000235</a> - from mod6's article I got the idea that his was still a halfway-fix, and yours still flagged experimental. I thought I'd wait for a finished thing before digging into it. Did I miss such a thing?</em><br />
<strong>asciilifeform</strong>: ( 100% proper patch would cap both. but neither of us at the time was immediately able to figure out how to use the internal knobs to determine tx mass )<br />
...</p>
<p><strong>jfw</strong>: asciilifeform: hm, ok.
</p></blockquote>
]]></content:encoded>
	</item>
	<item>
		<title>By: cgra</title>
		<link>http://jfxpt.com/2022/sending-buffer-overflows-fixed-in-bitcoind-and-other-cleanups/#comment-2057</link>
		<dc:creator>cgra</dc:creator>
		<pubDate>Sat, 11 Jun 2022 18:22:13 +0000</pubDate>
		<guid isPermaLink="false">http://fixpoint.welshcomputing.com/?p=183#comment-2057</guid>
		<description>Hi dorion, 

&lt;blockquote&gt;So then, mind sharing either here or, preferably, in some blog articles, just who you might be ?&lt;/blockquote&gt;

If you find it worthwile, see my &lt;a href="http://logs.nosuchlabs.com/log-search?q=from%3Acgra&#38;chan=asciilifeform" rel="nofollow"&gt;chat history&lt;/a&gt;. A couple of possibly interesting shortcuts: a &lt;a href="http://logs.nosuchlabs.com/log/asciilifeform/2020-11-22#1025201" rel="nofollow"&gt;micro self-intro&lt;/a&gt;, and a &lt;a href="http://logs.nosuchlabs.com/log/asciilifeform/2021-11-10#1064689" rel="nofollow"&gt;mini-review&lt;/a&gt;.

In summary and addition, I'm a Finn, with a personal interest in dependable tech (while not implying any kind of proficiency in the field). When I was a kid, dad explained to me how a carpenter may choose to build not the best wooden spoon he can, but one that wears out, or breaks in time -- just &lt;i&gt;to stay in business&lt;/i&gt;. I don't know why, but this idea has bothered me ever since. It sounds cheating to me. And of course, the &lt;i&gt;whole world&lt;/i&gt; somehow seems to be built on this exact principle.

And I fiddle with bitcoin, because I believe it's better for my future if it succeeds. Or, if not better for myself (say, I blow my chances somehow), I suppose better for the more honest people: perhaps a non-cheating carpenter.</description>
		<content:encoded><![CDATA[<p>Hi dorion, </p>
<blockquote><p>So then, mind sharing either here or, preferably, in some blog articles, just who you might be ?</p></blockquote>
<p>If you find it worthwile, see my <a href="http://logs.nosuchlabs.com/log-search?q=from%3Acgra&amp;chan=asciilifeform" rel="nofollow">chat history</a>. A couple of possibly interesting shortcuts: a <a href="http://logs.nosuchlabs.com/log/asciilifeform/2020-11-22#1025201" rel="nofollow">micro self-intro</a>, and a <a href="http://logs.nosuchlabs.com/log/asciilifeform/2021-11-10#1064689" rel="nofollow">mini-review</a>.</p>
<p>In summary and addition, I'm a Finn, with a personal interest in dependable tech (while not implying any kind of proficiency in the field). When I was a kid, dad explained to me how a carpenter may choose to build not the best wooden spoon he can, but one that wears out, or breaks in time -- just <i>to stay in business</i>. I don't know why, but this idea has bothered me ever since. It sounds cheating to me. And of course, the <i>whole world</i> somehow seems to be built on this exact principle.</p>
<p>And I fiddle with bitcoin, because I believe it's better for my future if it succeeds. Or, if not better for myself (say, I blow my chances somehow), I suppose better for the more honest people: perhaps a non-cheating carpenter.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jacob Welsh</title>
		<link>http://jfxpt.com/2022/sending-buffer-overflows-fixed-in-bitcoind-and-other-cleanups/#comment-2056</link>
		<dc:creator>Jacob Welsh</dc:creator>
		<pubDate>Fri, 10 Jun 2022 20:54:12 +0000</pubDate>
		<guid isPermaLink="false">http://fixpoint.welshcomputing.com/?p=183#comment-2056</guid>
		<description>&lt;blockquote&gt;I meant the BeginMessage()/EndMessage()/AbortMessage() composition, stuff your patches here replace.&lt;/blockquote&gt;

Oh I see.

&lt;blockquote&gt;Do you mean the CRITICAL_BLOCK() macro? In what ways?&lt;/blockquote&gt;

No, strictly what I wrote - the behavior of older versions of the code, as a whole, of which the locking is but one facet.</description>
		<content:encoded><![CDATA[<blockquote><p>I meant the BeginMessage()/EndMessage()/AbortMessage() composition, stuff your patches here replace.</p></blockquote>
<p>Oh I see.</p>
<blockquote><p>Do you mean the CRITICAL_BLOCK() macro? In what ways?</p></blockquote>
<p>No, strictly what I wrote - the behavior of older versions of the code, as a whole, of which the locking is but one facet.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robinson Dorion</title>
		<link>http://jfxpt.com/2022/sending-buffer-overflows-fixed-in-bitcoind-and-other-cleanups/#comment-2055</link>
		<dc:creator>Robinson Dorion</dc:creator>
		<pubDate>Fri, 10 Jun 2022 20:35:30 +0000</pubDate>
		<guid isPermaLink="false">http://fixpoint.welshcomputing.com/?p=183#comment-2055</guid>
		<description>Hi cgra, nice of you to drop by and ask some informed questions. I see you've got some articles on your blog about bitcoin code study. While that's well and good, there's nothing there about who you are. The trouble with that being, technology can't, nor can ever, be &lt;a href="http://ossasepia.com/2020/04/20/ossasepia-logs-for-21-Oct-2019/#1006991" rel="nofollow"&gt;apolitical&lt;/a&gt;. So then, mind sharing either here or, preferably, in some blog articles, just who you might be ? It'll be healthier for everyone. Cheers.</description>
		<content:encoded><![CDATA[<p>Hi cgra, nice of you to drop by and ask some informed questions. I see you've got some articles on your blog about bitcoin code study. While that's well and good, there's nothing there about who you are. The trouble with that being, technology can't, nor can ever, be <a href="http://ossasepia.com/2020/04/20/ossasepia-logs-for-21-Oct-2019/#1006991" rel="nofollow">apolitical</a>. So then, mind sharing either here or, preferably, in some blog articles, just who you might be ? It'll be healthier for everyone. Cheers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cgra</title>
		<link>http://jfxpt.com/2022/sending-buffer-overflows-fixed-in-bitcoind-and-other-cleanups/#comment-2054</link>
		<dc:creator>cgra</dc:creator>
		<pubDate>Wed, 08 Jun 2022 16:02:06 +0000</pubDate>
		<guid isPermaLink="false">http://fixpoint.welshcomputing.com/?p=183#comment-2054</guid>
		<description>&lt;blockquote&gt;I'm not sure what you refer to there - something pre-0.5.3 ?&lt;/blockquote&gt;

I meant the BeginMessage()/EndMessage()/AbortMessage() composition, stuff your patches here replace.

&lt;blockquote&gt;the old one was broken in however-many ways&lt;/blockquote&gt;

Do you mean the CRITICAL_BLOCK() macro? In what ways?</description>
		<content:encoded><![CDATA[<blockquote><p>I'm not sure what you refer to there - something pre-0.5.3 ?</p></blockquote>
<p>I meant the BeginMessage()/EndMessage()/AbortMessage() composition, stuff your patches here replace.</p>
<blockquote><p>the old one was broken in however-many ways</p></blockquote>
<p>Do you mean the CRITICAL_BLOCK() macro? In what ways?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jacob Welsh</title>
		<link>http://jfxpt.com/2022/sending-buffer-overflows-fixed-in-bitcoind-and-other-cleanups/#comment-2053</link>
		<dc:creator>Jacob Welsh</dc:creator>
		<pubDate>Wed, 08 Jun 2022 15:21:08 +0000</pubDate>
		<guid isPermaLink="false">http://fixpoint.welshcomputing.com/?p=183#comment-2053</guid>
		<description>"Schelling point" would be the term I was looking for re "what was meant".</description>
		<content:encoded><![CDATA[<p>"Schelling point" would be the term I was looking for re "what was meant".</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jacob Welsh</title>
		<link>http://jfxpt.com/2022/sending-buffer-overflows-fixed-in-bitcoind-and-other-cleanups/#comment-2052</link>
		<dc:creator>Jacob Welsh</dc:creator>
		<pubDate>Wed, 08 Jun 2022 15:07:29 +0000</pubDate>
		<guid isPermaLink="false">http://fixpoint.welshcomputing.com/?p=183#comment-2052</guid>
		<description>&lt;blockquote&gt;I was apparently somehow still stuck in my head with the old composition of the code where the ENTER/LEAVE were necessary.&lt;/blockquote&gt;

I'm not sure what you refer to there - something pre-0.5.3 ?

&lt;blockquote&gt;history-aware reader is doomed to answer those (annoying) questions anyway&lt;/blockquote&gt;

I'm not sure about that either ; presumably it would depend on what he wants to know. If the goal is to verify that a new version has fully equivalent behavior to an old one then I can make it easy: it does not, because the old one was broken in however-many ways. What's more important not to change is the block validation rules (which is why I'm more cautious about ripping out e.g. BOOST_FOREACH) ; but even there to some extent we have to compare with the "ideal form" of "what was meant" because the original contained nondeterministic failure cases such as the &lt;a href="http://trilema.com/2019/forum-logs-for-01-aug-2015/#1818112" rel="nofollow"&gt;BDB locks exhaustion&lt;/a&gt; &lt;a href="http://jfxpt.com/v/bitcoin/asciilifeform_maxint_locks_corrected.vpatch" rel="nofollow"&gt;business&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<blockquote><p>I was apparently somehow still stuck in my head with the old composition of the code where the ENTER/LEAVE were necessary.</p></blockquote>
<p>I'm not sure what you refer to there - something pre-0.5.3 ?</p>
<blockquote><p>history-aware reader is doomed to answer those (annoying) questions anyway</p></blockquote>
<p>I'm not sure about that either ; presumably it would depend on what he wants to know. If the goal is to verify that a new version has fully equivalent behavior to an old one then I can make it easy: it does not, because the old one was broken in however-many ways. What's more important not to change is the block validation rules (which is why I'm more cautious about ripping out e.g. BOOST_FOREACH) ; but even there to some extent we have to compare with the "ideal form" of "what was meant" because the original contained nondeterministic failure cases such as the <a href="http://trilema.com/2019/forum-logs-for-01-aug-2015/#1818112" rel="nofollow">BDB locks exhaustion</a> <a href="http://jfxpt.com/v/bitcoin/asciilifeform_maxint_locks_corrected.vpatch" rel="nofollow">business</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cgra</title>
		<link>http://jfxpt.com/2022/sending-buffer-overflows-fixed-in-bitcoind-and-other-cleanups/#comment-2051</link>
		<dc:creator>cgra</dc:creator>
		<pubDate>Wed, 08 Jun 2022 08:41:34 +0000</pubDate>
		<guid isPermaLink="false">http://fixpoint.welshcomputing.com/?p=183#comment-2051</guid>
		<description>jfw, thank you for your thorough response!

So I had already forgotten these macros were Satoshi's handwriting, and not Boost items, and was thinking "why bring in &lt;i&gt;more Boost&lt;/i&gt;?" when asking my question.

Re: CRITICAL_BLOCK vs ENTER/LEAVE_CRITICAL_SECTION: I completely agree, I was apparently somehow still stuck in my head with the old composition of the code where the ENTER/LEAVE were necessary.

Re: CRITICAL_BLOCK implementation: history-aware reader is doomed to answer those (annoying) questions anyway, so in that sense, I don't see much gain.

Fwiw, I would've perhaps used the name "CRITICAL_SCOPE", for consistency.</description>
		<content:encoded><![CDATA[<p>jfw, thank you for your thorough response!</p>
<p>So I had already forgotten these macros were Satoshi's handwriting, and not Boost items, and was thinking "why bring in <i>more Boost</i>?" when asking my question.</p>
<p>Re: CRITICAL_BLOCK vs ENTER/LEAVE_CRITICAL_SECTION: I completely agree, I was apparently somehow still stuck in my head with the old composition of the code where the ENTER/LEAVE were necessary.</p>
<p>Re: CRITICAL_BLOCK implementation: history-aware reader is doomed to answer those (annoying) questions anyway, so in that sense, I don't see much gain.</p>
<p>Fwiw, I would've perhaps used the name "CRITICAL_SCOPE", for consistency.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jacob Welsh</title>
		<link>http://jfxpt.com/2022/sending-buffer-overflows-fixed-in-bitcoind-and-other-cleanups/#comment-2050</link>
		<dc:creator>Jacob Welsh</dc:creator>
		<pubDate>Wed, 08 Jun 2022 02:21:40 +0000</pubDate>
		<guid isPermaLink="false">http://fixpoint.welshcomputing.com/?p=183#comment-2050</guid>
		<description>See &lt;a href="http://jfxpt.com/2021/a-tetrad-of-tuneups-for-bitcoind/?b=Actually&#38;e=implementation.#select" rel="nofollow"&gt;here&lt;/a&gt; ; it was added in the &lt;a href="http://jfxpt.com/2021/a-tetrad-of-tuneups-for-bitcoind/?b=bitcoin_tx_fee_cleanup&#38;e=#select" rel="nofollow"&gt;transaction fee cleanup patch&lt;/a&gt; when I had cause to look at the locking constructs.

The closer comparison would be to CRITICAL_BLOCK rather than ENTER/LEAVE_CRITICAL_SECTION. The main reasons to prefer the first to the second I'd say are that it leverages builtin language syntax and semantics, making for less code to keep track of (would you really prefer to malloc+free when stack allocation would suffice?), and that it does the right thing on nonlocal exits (eg return, goto, or exception being thrown which can happen in unexpected places).

Then compare CRITICAL_BLOCK with SCOPED_LOCK &lt;a href="http://jfxpt.com/codeview/tree/bitcoin/bitcoin_tx_fee_cleanup/bitcoin/src/util.h#L220" rel="nofollow"&gt;implementations&lt;/a&gt; and look at it from the other side: why on earth does the first involve an if-statement, wtf does a bare object evaluate to in boolean context, what's the scope of such an object declared inside the condition of such a statement, and how is it justified that the reader even has to ask these questions ?</description>
		<content:encoded><![CDATA[<p>See <a href="http://jfxpt.com/2021/a-tetrad-of-tuneups-for-bitcoind/?b=Actually&amp;e=implementation.#select" rel="nofollow">here</a> ; it was added in the <a href="http://jfxpt.com/2021/a-tetrad-of-tuneups-for-bitcoind/?b=bitcoin_tx_fee_cleanup&amp;e=#select" rel="nofollow">transaction fee cleanup patch</a> when I had cause to look at the locking constructs.</p>
<p>The closer comparison would be to CRITICAL_BLOCK rather than ENTER/LEAVE_CRITICAL_SECTION. The main reasons to prefer the first to the second I'd say are that it leverages builtin language syntax and semantics, making for less code to keep track of (would you really prefer to malloc+free when stack allocation would suffice?), and that it does the right thing on nonlocal exits (eg return, goto, or exception being thrown which can happen in unexpected places).</p>
<p>Then compare CRITICAL_BLOCK with SCOPED_LOCK <a href="http://jfxpt.com/codeview/tree/bitcoin/bitcoin_tx_fee_cleanup/bitcoin/src/util.h#L220" rel="nofollow">implementations</a> and look at it from the other side: why on earth does the first involve an if-statement, wtf does a bare object evaluate to in boolean context, what's the scope of such an object declared inside the condition of such a statement, and how is it justified that the reader even has to ask these questions ?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
