# TBufferMerger fails to write histograms to output file for Alma Linux

**URL:** <https://root-forum.cern.ch/t/tbuffermerger-fails-to-write-histograms-to-output-file-for-alma-linux/64787>\
**Category:** ROOT\
**Tags:** hist\
**Created:** [April 10, 2026, 11:23pm UTC](https://root-forum.cern.ch/t/tbuffermerger-fails-to-write-histograms-to-output-file-for-alma-linux/64787 "2026-04-10T23:23:11Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![crafter312](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/crafter312/32/36890_2.png) [@crafter312](https://root-forum.cern.ch/u/crafter312)\
**Post date:** [April 10, 2026, 11:23pm UTC](https://root-forum.cern.ch/t/tbuffermerger-fails-to-write-histograms-to-output-file-for-alma-linux/64787/1 "2026-04-10T23:23:12Z")

</div>

Continuing the discussion from [Multi-threaded output of TH\* histograms via TBufferMerger](https://root-forum.cern.ch/t/multi-threaded-output-of-th-histograms-via-tbuffermerger/64089):

* * *

_ROOT Version:_ 6.36.10  
_Platform:_ Alma Linux 8.10 (linuxx8664gcc)  
_Compiler:_ c++ (GCC) 8.5.0 20210514 (Red Hat 8.5.0-28)

* * *

Details about this issue, along with a small code to reproduce, are contained in the original linked discussion. The original issue was never resolved, and this has become a crucial issue for me that now needs to be fixed. The gist is as follows:

> [@Multi-threaded output of TH\* histograms via TBufferMerger](https://root-forum.cern.ch/t/multi-threaded-output-of-th-histograms-via-tbuffermerger/64089/1):
>
> I am writing a program which uses `TTreeProcessorMT` for multi-threaded processing of an input tree and `TBufferMerger` for output in this multi-threaded context. I can easily create a `TTree` and fill it from multiple threads. This works, and I have done this a few different times already.
> 
> However, when I try to create and fill a `TH1I` histogram alongside the tree, **it fails to appear in the output file**. As far as I’m aware, I should just be able to create and fill the histogram in the same way as I do for the tree, at least this is what I would do for a normal `TFile`:
> 
> ```auto
> auto f = merger.GetFile();
> TTree t(“t”, “t”);
> t.Branch(“whatever”, &whatever);
> 
> TH1I h(“h”, “h”, 100, -1., 1.);
> 
> ```

I have tried all manner of different ways of writing a histogram to the thread-local file, with no success.

**Crucially: The writing of histograms in this manner works just fine on other versions of Linux.**

Mainly, I have tested and verified that this works on Rocky Linux for the same version 6.36.10 of ROOT. However, for some unexplicable reason, it fails to work on Alma Linux 8.10.

I have a data analysis code which relies on this functionality, and this issue needs to be resolved before I can continue with my work. I am so incredibly confused by this problem, and have made absolutely no progress in fixing it.

---

<div class="post-metadata">

**Author:** ![devajith](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/devajith/32/37165_2.png) [@devajith](https://root-forum.cern.ch/u/devajith)\
**Post date:** [April 11, 2026, 8:54am UTC](https://root-forum.cern.ch/t/tbuffermerger-fails-to-write-histograms-to-output-file-for-alma-linux/64787/2 "2026-04-11T08:54:28Z")

</div>

Hi @crafter312, thanks for your question. @pcanal might be able to help here.

---

<div class="post-metadata">

**Author:** ![ferhue](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ferhue/32/29462_2.png) [@ferhue](https://root-forum.cern.ch/u/ferhue)\
**Post date:** [April 12, 2026, 7:16am UTC](https://root-forum.cern.ch/t/tbuffermerger-fails-to-write-histograms-to-output-file-for-alma-linux/64787/3 "2026-04-12T07:16:22Z")

</div>

> [@crafter312](#):
>
> Details about this issue, along with a small code to reproduce, are contained in the original linked discussion.

Could you share a full reproducer? Meaning either posting also the input ROOT files you used (or linking them on a public repo), or creating a dummy TFile with a hist and TTree with those branches and 10 entries, directly in the code.

---

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [April 12, 2026, 3:03pm UTC](https://root-forum.cern.ch/t/tbuffermerger-fails-to-write-histograms-to-output-file-for-alma-linux/64787/4 "2026-04-12T15:03:52Z")

</div>

I don’t know if, as-is, the macro in the linked post reproduces the issue, but it does not really need any specific root file, it only needs to contain a tree (named “t”) for a TTreeReader loop but without reading data from it, and the macro creates a new file with a new “t” tree containing the (new) histogram with random values and as many entries as the tree in the “input” file.  
Adding to the mentioned Rocky Linux, where it is reported to work, for me it worked as well on Linux Mint 22 (root binaries 6.36.08 and 6.36.10) and Fedora 43 (compiled version 6.36.08), using a random file containing around 4.6 million entries (not sure if enough for multithreading).

---

<div class="post-metadata">

**Author:** ![crafter312](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/crafter312/32/36890_2.png) [@crafter312](https://root-forum.cern.ch/u/crafter312)\
**Post date:** [April 13, 2026, 5:31pm UTC](https://root-forum.cern.ch/t/tbuffermerger-fails-to-write-histograms-to-output-file-for-alma-linux/64787/5 "2026-04-13T17:31:26Z")

</div>

I made a fully self-contained version of the test macro used to reproduce my issue, my apologies for not doing so at the start:

[tbuffermerger\_hist.C](https://root-forum.cern.ch/uploads/short-url/vUJthvjLTcgtixAInUD2ESHDg4N.C) (1.8 KB)

With this new version of the test macro, I once again verified that the output tree fills just fine, but the histogram fails to show up on Alma Linux 8.10. I also verified that the code _does_ work properly on Arch Linux.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [April 13, 2026, 6:19pm UTC](https://root-forum.cern.ch/t/tbuffermerger-fails-to-write-histograms-to-output-file-for-alma-linux/64787/6 "2026-04-13T18:19:07Z")

</div>

I see the same problem on Ubuntu 22.04 LTS / x86\_64 with ROOT 6.26.14, 6.26.18, 6.28.14, 6.30.04, 6.30.10, 6.32.22, 6.34.10, and 6.36.10.  
The test macro works fine with ROOT 6.38.04.

---

<div class="post-metadata">

**Author:** ![ferhue](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ferhue/32/29462_2.png) [@ferhue](https://root-forum.cern.ch/u/ferhue)\
**Post date:** [April 13, 2026, 8:03pm UTC](https://root-forum.cern.ch/t/tbuffermerger-fails-to-write-histograms-to-output-file-for-alma-linux/64787/7 "2026-04-13T20:03:55Z")

</div>

@vpadulan @silverweed @pcanal is it viable to backport the fix (when identified which commit it was) from 6.38 to 6.36 ?

---

<div class="post-metadata">

**Author:** ![crafter312](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/crafter312/32/36890_2.png) [@crafter312](https://root-forum.cern.ch/u/crafter312)\
**Post date:** [April 13, 2026, 11:35pm UTC](https://root-forum.cern.ch/t/tbuffermerger-fails-to-write-histograms-to-output-file-for-alma-linux/64787/8 "2026-04-13T23:35:49Z")

</div>

I can confirm that both the self-contained macro attached above and my full code work on Alma Linux 8.10 with ROOT 6.38.04.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [April 27, 2026, 1:52pm UTC](https://root-forum.cern.ch/t/tbuffermerger-fails-to-write-histograms-to-output-file-for-alma-linux/64787/9 "2026-04-27T13:52:26Z")

</div>

This problem is still present in [ROOT 6.36.12](https://root-forum.cern.ch/t/root-6-36-12-is-out/64822).

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [May 11, 2026, 1:53pm UTC](https://root-forum.cern.ch/t/tbuffermerger-fails-to-write-histograms-to-output-file-for-alma-linux/64787/10 "2026-05-11T13:53:08Z")

</div>

Closed on May 11, 2026, 1:53pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![silverweed](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/silverweed/32/36670_2.png) [@silverweed](https://root-forum.cern.ch/u/silverweed)\
**Post date:** [July 21, 2026, 2:17pm UTC](https://root-forum.cern.ch/t/tbuffermerger-fails-to-write-histograms-to-output-file-for-alma-linux/64787/11 "2026-07-21T14:17:12Z")

</div>

Sorry if this took forever: I somehow missed the forum notifications where I was tagged.  
I tracked down the fix and opened a [backport PR](https://github.com/root-project/root/pull/22870) for it, so this will be fixed in 6.36.14.

Thank you for your patience.
