# Problems with h2root

**URL:** <https://root-forum.cern.ch/t/problems-with-h2root/43676>\
**Category:** Newbie\
**Created:** [February 23, 2021, 4:42pm UTC](https://root-forum.cern.ch/t/problems-with-h2root/43676 "2021-02-23T16:42:03Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![R\_L](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/e79b87/32.png) [@R\_L](https://root-forum.cern.ch/u/R_L)\
**Post date:** [February 23, 2021, 4:42pm UTC](https://root-forum.cern.ch/t/problems-with-h2root/43676/1 "2021-02-23T16:42:03Z")

</div>

Hello,  
I installed Root Version 6.22/06 using homebrew on MacOS 10.15.7. I need to convert hbook files to root files with h2root. I get the following error message when I try to convert a file:  
Converting directory //example

```auto
>>>>>> CALL HRZKEY(IDN)

Converting RWN with ID= 1, nentries = 3324

***Break*** bus error

[/usr/local/Cellar/root/6.22.06_2/lib/root/libCore.so] TUnixSystem::DispatchSignals(ESignals) (no debug info)
[/usr/local/Cellar/root/6.22.06_2/lib/root/libCore.so] SigHandler(ESignals) (no debug info)
[/usr/local/Cellar/root/6.22.06_2/lib/root/libCore.so] sighandler(int) (no debug info)
[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[<unknown binary>] (no debug info)
[/usr/local/bin/h2root] hgiven_ (no debug info)
[/usr/local/bin/h2root] convert_rwn(int) (no debug info)
[/usr/local/bin/h2root] convert_directory(char const*) (no debug info)
[/usr/local/bin/h2root] main (no debug info)
[/usr/lib/system/libdyld.dylib] start (no debug info)

```

A .root file is created but it is empty.  
Does anyone have any idea how to save that problem? Your help is greatly appreciated

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [February 23, 2021, 5:00pm UTC](https://root-forum.cern.ch/t/problems-with-h2root/43676/2 "2021-02-23T17:00:55Z")

</div>

Maybe @couet can give it a try

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [February 24, 2021, 7:00am UTC](https://root-forum.cern.ch/t/problems-with-h2root/43676/3 "2021-02-24T07:00:07Z")

</div>

Can you post your `.hbook` file having problems ?

---

<div class="post-metadata">

**Author:** ![R\_L](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/e79b87/32.png) [@R\_L](https://root-forum.cern.ch/u/R_L)\
**Post date:** [February 24, 2021, 2:39pm UTC](https://root-forum.cern.ch/t/problems-with-h2root/43676/4 "2021-02-24T14:39:36Z")

</div>

I could not solve the problem with the installed binary version on my mac. It seems to be a problem concerning the installation of ROOT on my laptop.  
I did manage to convert the files on a machine running ubuntu.

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [February 24, 2021, 2:44pm UTC](https://root-forum.cern.ch/t/problems-with-h2root/43676/5 "2021-02-24T14:44:11Z")

</div>

I think that would be interesting to see if it’s really an issue on Mac, so we can try to fix it…

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [February 24, 2021, 3:02pm UTC](https://root-forum.cern.ch/t/problems-with-h2root/43676/6 "2021-02-24T15:02:26Z")

</div>

If you give me access to your `.hbook` file I can try to convert it on my IMac.

---

<div class="post-metadata">

**Author:** ![R\_L](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/e79b87/32.png) [@R\_L](https://root-forum.cern.ch/u/R_L)\
**Post date:** [February 24, 2021, 3:21pm UTC](https://root-forum.cern.ch/t/problems-with-h2root/43676/7 "2021-02-24T15:21:35Z")

</div>

[evt\_charged\_exp55\_r0\_s0.hbook.zip](https://root-forum.cern.ch/uploads/short-url/h0LGv5dtUUzQ7ABf9DkSvTDcCFq.zip) (76.0 KB)

Here is one of the .hbook files.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [February 24, 2021, 3:35pm UTC](https://root-forum.cern.ch/t/problems-with-h2root/43676/8 "2021-02-24T15:35:54Z")

</div>

indeed I see an issue on my IMac too:

```auto
% h2root evt_charged_exp55_r0_s0.hbook 
 Converting directory //example
 >>>>>> CALL HRZKEY(IDN)
 Converting RWN with ID= 1, nentries = 2758

 ***Break*** bus error
[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[<unknown binary>] (no debug info)
[/Users/couet/git/couet-root-bin/bin/h2root] hgiven_ (no debug info)
[/Users/couet/git/couet-root-bin/bin/h2root] convert_rwn(int) (no debug info)
[/Users/couet/git/couet-root-bin/bin/h2root] convert_directory(char const*) (no debug info)
[/Users/couet/git/couet-root-bin/bin/h2root] main (no debug info)
[/usr/lib/system/libdyld.dylib] start (no debug info)

```

---

<div class="post-metadata">

**Author:** ![valya](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/v/a9adbd/32.png) [@valya](https://root-forum.cern.ch/u/valya)\
**Post date:** [March 2, 2021, 11:47am UTC](https://root-forum.cern.ch/t/problems-with-h2root/43676/9 "2021-03-02T11:47:21Z")

</div>

Hi!  
I have the same problem. I successfully converted .hbook files on a linux machine, but when I try to do it on MacOS I see the following:

```auto
$~ h2root 07.hist rootfiles/07.root

 >Converting directory //example
/>>>>>>> CALL HRZKEY(IDN)
 Converting RWN with ID= 1, nentries = 7283
 ***Break*** bus error
[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[<unknown binary>] (no debug info)
[/opt/local/bin/h2root] hgiven_ (no debug info)
[/opt/local/bin/h2root] convert_rwn(int) (no debug info)
[/opt/local/bin/h2root] convert_directory(char const*) (no debug info)
[/opt/local/bin/h2root] main (no debug info)
[/usr/lib/system/libdyld.dylib] start (no debug info)

```

Created .root file is empty.

I would appreciate any help.  
Thanks a lot,  
Valentina

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [March 2, 2021, 1:46pm UTC](https://root-forum.cern.ch/t/problems-with-h2root/43676/10 "2021-03-02T13:46:17Z")

</div>

Can you try on an other platform ? lxplus ?

---

<div class="post-metadata">

**Author:** ![valya](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/v/a9adbd/32.png) [@valya](https://root-forum.cern.ch/u/valya)\
**Post date:** [March 10, 2021, 2:10pm UTC](https://root-forum.cern.ch/t/problems-with-h2root/43676/11 "2021-03-10T14:10:22Z")

</div>

I can do it on another machine with Scientific Linux 7, there is problem only with macos

---

<div class="post-metadata">

**Author:** ![Michael\_Paolone](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/michael_paolone/32/26260_2.png) [@Michael\_Paolone](https://root-forum.cern.ch/u/Michael_Paolone)\
**Post date:** [May 27, 2021, 8:13pm UTC](https://root-forum.cern.ch/t/problems-with-h2root/43676/13 "2021-05-27T20:13:00Z")

</div>

It seems like this is a problem with the convert\_rwn subroutine in the hbook.f file. I was able to get a working h2root by commenting out the following line on line 886 of misc/minicern/src/hbook.f:

IF (NCH .GT. 0) CHTITL = ’ ’

I’m not a fortran expert so I’m not sure why this line breaks the code (is CHITITL allocatable?). Anyway, I could then recompile and run the code with no obvious issues with my hbook → root file output. I’m not entirely sure if this fix will work for all files (or correctly convert all files). In other words, this is more of a kludge than a fix. Use at your own risk.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [May 28, 2021, 6:19am UTC](https://root-forum.cern.ch/t/problems-with-h2root/43676/14 "2021-05-28T06:19:51Z")

</div>

Interesting. CHTITL is a returned parameter. It returns the ntuple name. This line was meant to clean the title in case it was not empty . I am not sure why it should produce a crash. It should not arm commenting it. On which kind of machine are you working ?

---

<div class="post-metadata">

**Author:** ![Michael\_Paolone](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/michael_paolone/32/26260_2.png) [@Michael\_Paolone](https://root-forum.cern.ch/u/Michael_Paolone)\
**Post date:** [June 17, 2021, 3:47pm UTC](https://root-forum.cern.ch/t/problems-with-h2root/43676/15 "2021-06-17T15:47:31Z")

</div>

I work on macOS (Catalina). This has been a bug on mac for a while now (at least a year or two). I’ve been using various newer gcc versions for a while (not the standard mac clang), but I’m not sure with what version this bug showed up.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [June 17, 2021, 4:00pm UTC](https://root-forum.cern.ch/t/problems-with-h2root/43676/16 "2021-06-17T16:00:16Z")

</div>

May be try to comment this line to see if it helps.
