Problems with h2root

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

>>>>>> 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

1 Like

Maybe @couet can give it a try

Can you post your .hbook file having problems ?

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.

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

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

1 Like

evt_charged_exp55_r0_s0.hbook.zip (76.0 KB)

Here is one of the .hbook files.

1 Like

indeed I see an issue on my IMac too:

% 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)

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:

$~ 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

1 Like

Can you try on an other platform ? lxplus ?

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

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.

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 ?

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.

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