Add tcmalloc hangs to FAQ
authorPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 21 Sep 2025 19:01:30 +0000 (21:01 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 21 Sep 2025 19:01:30 +0000 (21:01 +0200)
docs/manual/faq.html

index 35b08b3fb7b70f0f32f6966763ec5cce5e3188c4..e46e2a542e577a978da9c404b7cf59d4eb150469 100644 (file)
@@ -84,6 +84,8 @@
       "Mismatched free() / delete / delete []" errors when
       my code is correct?</a>
 </dd>
+<dd>4.8. <a href="faq.html#faq.hangs">Why does Valgrind hang when using tcmalloc?</a>
+</dd>
 </dl>
 <dl>
 <dt>5.  <a href="faq.html#faq.misc">Miscellaneous</a>
@@ -653,6 +655,30 @@ int main(void)
     </p>
 </td>
 </tr>
+<tr><td colspan="2"> </td></tr>
+<tr class="question">
+<td align="left" valign="top">
+<a name="faq.hangs"></a><a name="q-hangs"></a><b>4.8.</b>
+</td>
+<td align="left" valign="top"><b>Why does Valgrind hang when using tcmalloc?</b></td>
+</tr>
+<tr class="answer">
+<td align="left" valign="top"><a name="a-hangss"></a></td>
+<td align="left" valign="top">
+<p>This is because tcmalloc makes a recursive call in its initialisation code.
+      Under Valgrind that becomes either an infinite loop with optimised builds of tcmalloc
+      or a stack overflow crash with debug builds of it.</p>
+<p>Your options are:
+      </p>
+<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
+<li class="listitem">Do not use tcmalloc in the builds that you test with Valgrind.</li>
+<li class="listitem">Use an older version of tcmalloc. This problem started on 2024-03-24.
+          If you use gperftools 2.15 or older you should not have this problem.</li>
+</ul></div>
+<p>
+    </p>
+</td>
+</tr>
 </table>
 <br><table width="100%" summary="Q and A Div" cellpadding="2" cellspacing="2" border="0">
 <tr class="qandadiv"><td align="left" valign="top" colspan="2">
This page took 0.072804 seconds and 5 git commands to generate.