# Segmentation violation using h2root with 6.40.04

**URL:** <https://root-forum.cern.ch/t/segmentation-violation-using-h2root-with-6-40-04/64997>\
**Category:** ROOT\
**Created:** [September 22, 2026, 6:41pm UTC](https://root-forum.cern.ch/t/segmentation-violation-using-h2root-with-6-40-04/64997 "2026-09-22T18:41:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![graham](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/g/4af34b/32.png) [@graham](https://root-forum.cern.ch/u/graham)\
**Post date:** [September 22, 2026, 6:41pm UTC](https://root-forum.cern.ch/t/segmentation-violation-using-h2root-with-6-40-04/64997/1 "2026-09-22T18:41:54Z")

</div>

* * *

_Please fill also the fields below. Note that **`root -b -q`** will tell you this info, and starting from 6.28/06 upwards, you can call **`.forum bug`** from the ROOT prompt to pre-populate a topic._

_ROOT Version:_ 6.40.04  
_Platform:_ lxplus Linux lxplus960.cern.ch 5.14.0-687.39.1.el9\_8.x86\_64 #1 SMP PREEMPT\_DYNAMIC Tue Aug 11 21:20:33 EDT 2026 x86\_64 x86\_64 x86\_64 GNU/Linux  
_Compiler:_ Code not compiled by me.

* * *

h2root often has a segmentation violation when trying to convert a HBOOK file to a ROOT file with 6.40.04.  
This is not seen with 6.40.02 with the same file. The error does not occur on every invocation - but about 50% of the time.

It looks like I’m not currently allowed to upload files at least with this account. Please allow me to  
do this as soon as possible (you can ask Rene if I should be trusted …).

I’ve put files that reproduce the problem on my public afs space at CERN.  
See /afs/cern.ch/user/g/graham/public/BugReport  
including file.histo, Buggy.txt, Correct.txt

[graham@lxplus960 BugReport-h2root]$ whereis h2root  
h2root: /usr/bin/h2root /usr/share/man/man1/h2root.1.gz

root --version  
ROOT Version: 6.40.04  
Built for linuxx8664gcc on Aug 29 2026, 00:00:00  
From tags/6-40-04@6-40-04

(I also reproduced the error with 6.40.04 on Ubuntu 24 LTS but found  
that 6.40.02 on Ubuntu 24 LTS always worked (ie. I didn’t demonstrate the latter on lxplus).)

---

<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:** [September 23, 2026, 12:13pm UTC](https://root-forum.cern.ch/t/segmentation-violation-using-h2root-with-6-40-04/64997/2 "2026-09-23T12:13:46Z")

</div>

The offending commit (the “`INTEGER*8`” breaks it):

> <https://github.com/root-project/root/commit/21cb0e620b200976e0ac1f1bd4b8863671c31ee6>
>
> kernlib was using the LOCF function to compute distances between common
> blocks. …It shifts the numbers, but in 32 bits. On 64 bit architectures,
> this can lead to unreasonable values, and when taking the difference,
> it's either correct or wraps around to very large numbers. Due to aslr,
> the common blocks move around, which can crash the program at init time
> when the blocks are on different sides of the "wrap around" addresss.
> 
> Here, the LOCF function is changed to use 64 bit integers for the
> address, which makes the distance computation independent of where the
> kernel places the common blocks.
> 
> Fix #19329
> 
> (cherry picked from commit 0d8fe6621566b21fe910779e6d2b9eedda90fefd)
> (cherry picked from commit 074b789fb98afb6acd17cad1b09180e64858838b)

@StephanH Note: the “`PAWC`” and other commons need to be allocated/loaded in the (lowest) 32 bit address space (also, the “`-no-pie`” flag is needed when building utilities, and often the “`-fno-automatic`” for the Fortran code, too).

@graham For the time being … download the [“official” 6.40.02 binary release](https://root.cern/releases/release-64002/) for your system, extract the “`root/bin/g2root`” and “`root/bin/h2root`” executables, and put them somewhere in your “`PATH`” (or simply overwrite the executables that came with your 6.40.04 binaries).

---

<div class="post-metadata">

**Author:** ![graham](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/g/4af34b/32.png) [@graham](https://root-forum.cern.ch/u/graham)\
**Post date:** [September 24, 2026, 4:02pm UTC](https://root-forum.cern.ch/t/segmentation-violation-using-h2root-with-6-40-04/64997/3 "2026-09-24T16:02:41Z")

</div>

Thanks for looking into this. I implemented the workaround also on lxplus, and got that to work (I personally already had the same working solution of reverting to 6.40.02 on Ubuntu).  
Maybe this is something that would benefit from a unit test going forward especially with the renewed interest in legacy workflows. Thanks again.

---

<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:** [October 6, 2026, 2:10pm UTC](https://root-forum.cern.ch/t/segmentation-violation-using-h2root-with-6-40-04/64997/4 "2026-10-06T14:10:38Z")

</div>

Thanks for the report, I opened [regression in h2root · Issue #23628 · root-project/root · GitHub](https://github.com/root-project/root/issues/23628)

---

<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:** [October 20, 2026, 2:11pm UTC](https://root-forum.cern.ch/t/segmentation-violation-using-h2root-with-6-40-04/64997/5 "2026-10-20T14:11:10Z")

</div>

Closed on October 20, 2026, 2:11pm UTC

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