Skip to content

minicern fixes#20556

Open
couet wants to merge 3 commits intoroot-project:masterfrom
couet:minicern-fix
Open

minicern fixes#20556
couet wants to merge 3 commits intoroot-project:masterfrom
couet:minicern-fix

Conversation

@couet
Copy link
Copy Markdown
Member

@couet couet commented Nov 27, 2025

  • Put PAWC and QUEST common blocks to have a unique centralised definition
  • In kernlib.f: enlarge the size of the input string MT to be compatible with some calls.
  • In zebra.f: use pawc.inc and quest.inc
  • In hbook.f: use pawc.inc and quest.inc, fixes the output character strings called from C++

@couet couet requested a review from dpiparo as a code owner November 27, 2025 18:16
@couet couet requested a review from ferdymercury November 27, 2025 18:24
Copy link
Copy Markdown
Collaborator

@ferdymercury ferdymercury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot, I think this goes in the right direction,
but with these changes I still get crash on alma9 arm64 and mac14 if I remove the -O0 flag, which is a sign that there is something still fishy with the memory mapping C vs Fortran

See failure here: https://github.com/root-project/root/actions/runs/19748615052/job/56587668201?pr=20538
as well as https://github.com/root-project/root/actions/runs/19748615052/job/56587668122?pr=20538

   *** Break *** segmentation violation
   Generating stack trace...
   0x000000000040a7ec in hrfile_ at /github/home/ROOT-CI/src/misc/minicern/src/hbook.f:343 from h2root
   0x000000000040feb8 in hropen_ at /github/home/ROOT-CI/src/misc/minicern/src/hbook.f:268 from h2root
   0x0000000000404d70 in main at /github/home/ROOT-CI/src/main/src/h2root.cxx:333 from h2root
   0x0000ffff94cf8540 in <unknown> from /lib64/libc.so.6
   0x0000ffff94cf8618 in __libc_start_main at :? from /lib64/libc.so.6
   0x00000000004050b0 in _start + 0x30 from h2root


  -- BEGIN TEST OUTPUT --
   RZIODO. Error at record =    2 LUN =    10 IOSTAT =  5001
   >>>>>> CALL RZEND(CHDIR)
   Cannot open fileHROPEN           0
   Error on hropen was 101 
  Error cannot open input file: mb4i1.hbook

If you turn on address sanitizer on minicern/CMakeLists.txt it will show some warnings

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Nov 28, 2025

Test Results

3 687 tests   3 677 ✅  3h 55m 50s ⏱️
    1 suites      9 💤
    1 files        1 ❌

For more details on these failures, see this check.

Results for commit 1c52712.

♻️ This comment has been updated with latest results.

@couet couet self-assigned this Nov 28, 2025
@couet
Copy link
Copy Markdown
Member Author

couet commented Nov 28, 2025

I can reproduce the crash on macphsft19.

@ferdymercury
Copy link
Copy Markdown
Collaborator

Maybe using https://cmake.org/cmake/help/latest/module/FortranCInterface.html, https://fortran-lang.discourse.group/t/cmake-fortrancinterface/7573 could help in simplifying the connection C - Fortran

@ferdymercury
Copy link
Copy Markdown
Collaborator

If I turn on Wall Wextra warnings via set_target_properties(minicern PROPERTIES COMPILE_FLAGS "-Wall -Wextra"), I see (https://github.com/root-project/root/actions/runs/20062341758/job/57542127199?pr=20538)

several warnings of the type:

 Warning: Array reference at (1) out of bounds (8729 > 8704) in loop beginning at (2) [-Wdo-subscript]
  /github/home/ROOT-CI/src/misc/minicern/src/zebra.f:574:45:

   /github/home/ROOT-CI/src/misc/minicern/src/hbook.f:2514:72:
  
   2514 |       BSLASH='\\'
        |                                                                        1
  Warning: CHARACTER expression will be truncated in assignment (1/2) at (1) [-Wcharacter-truncation]

- Remove some unused labels
- Initialize some un-initialized variables
- Fix some rank mismatches
@dpiparo dpiparo closed this Feb 26, 2026
@dpiparo dpiparo reopened this Feb 26, 2026
@dpiparo
Copy link
Copy Markdown
Member

dpiparo commented Feb 26, 2026

let's see what happens on mac beta after rebasing.

@dpiparo
Copy link
Copy Markdown
Member

dpiparo commented Feb 26, 2026

Unfortunately these fixes have no effect on the current issue on macbeta.

@ferdymercury ferdymercury requested a review from hageboeck March 5, 2026 16:21
@ferdymercury ferdymercury mentioned this pull request Mar 18, 2026
1 task
Comment thread misc/minicern/src/hbook.f
Comment on lines 1580 to 1593
@@ -1829,14 +1591,7 @@ FUNCTION HIE(IDD,I)
+LSLIY,LBANX,LBANY,LPRX,LPRY,LFIX,LLID,LR1,LR2,LNAME,LCHAR,LINT,
+LREAL,LBLOK,LLBLK,LBUFM,LBUF,LTMPM,LTMP,LTMP1,LHPLIP,LHDUM(9),
+LHFIT,LFUNC,LHFCO,LHFNA,LCIDN
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
INCLUDE 'param3.inc'

There are 39 repetitions of this same block in this file. Moving it to param3.inc would improve readability and shorten code.

Comment thread misc/minicern/src/hbook.f
Comment on lines 161 to 167
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
INCLUDE 'param4.inc'

There are 11 repetitions of this pattern

Comment thread misc/minicern/src/hbook.f
Comment on lines 2097 to 2105
@@ -2427,7 +2103,7 @@ SUBROUTINE HFIND(IDD,CHROUT)
+ NH ,MSTEP ,NOENT ,NOLD ,IDOLAR,IBLANC,KBINSZ,INO ,
+ KSQUEZ,NCOLMA,NCOLPA,NLINPA,BIGP ,ICBLAC,ICSTAR,ICFUNC,
+ IDG ,MAXBIT,IDENT
Copy link
Copy Markdown
Collaborator

@ferdymercury ferdymercury Mar 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
INCLUDE 'param5.inc'

4 repetitions of this pattern

      INTEGER       IFW   ,NW    ,NB    ,IH    ,NHT   ,ICN   ,IPONCE,
     +       NH    ,MSTEP ,NOENT ,NOLD  ,IDOLAR,IBLANC,KBINSZ,INO   ,
     +       KSQUEZ,NCOLMA,NCOLPA,NLINPA,       ICBLAC,ICSTAR,ICFUNC,
     +       IDG(42),MAXBIT(30),IDENT(9)
      REAL BIGP
      COMMON/HCPRIN/IFW   ,NW    ,NB    ,IH    ,NHT   ,ICN   ,IPONCE,
     +       NH    ,MSTEP ,NOENT ,NOLD  ,IDOLAR,IBLANC,KBINSZ,INO   ,
     +       KSQUEZ,NCOLMA,NCOLPA,NLINPA,BIGP  ,ICBLAC,ICSTAR,ICFUNC,
     +       IDG   ,MAXBIT,IDENT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants