Skip to content

[hbook] Pass the full 64 bit buffer address to HBNAM - #23938

Merged
guitargeek merged 1 commit into
root-project:masterfrom
guitargeek:h2root-cwn-address-23628
Nov 3, 2026
Merged

guitargeek merged 1 commit into
root-project:masterfrom
guitargeek:h2root-cwn-address-23628

Conversation

@guitargeek

@guitargeek guitargeek commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Since 21cb0e6 (6.40.04), LOCF returns the full 64 bit word address instead of the low 32 bits. HNMADR computes the word offset of a column-wise ntuple variable as IADDW - LOCF(IQ(1)), but h2root and THbookFile still passed the buffer address to HBNAM as a 32 bit int, so IADDW lost bits 32 and 33 of the address while LOCF kept them. The stored offset was off by a multiple of 2^30 words whenever those bits were set, which is the case for most PIE placements, and HGNT2 then wrote the ntuple columns to a wild address.

Pass the address as INTEGER*8 through HBNAM and compute the offset from the full addresses. THbookFile::SetBranchAddress also passed the value stored at the user pointer instead of the pointer; it now passes the address like the other call sites.

Add a roottest that converts a small column-wise ntuple with h2root. The input file is written by the included mkcwn.f with CERNLIB.

Fixes #23628

Assisted-by: claude-code:claude-fable-5-1

Needs to be backported to 6.40 and 6.42

Since 21cb0e6 (6.40.04), LOCF returns the full 64 bit word address
instead of the low 32 bits. HNMADR computes the word offset of a
column-wise ntuple variable as IADDW - LOCF(IQ(1)), but h2root and
THbookFile still passed the buffer address to HBNAM as a 32 bit int, so
IADDW lost bits 32 and 33 of the address while LOCF kept them. The
stored offset was off by a multiple of 2^30 words whenever those bits
were set, which is the case for most PIE placements, and HGNT2 then
wrote the ntuple columns to a wild address.

Pass the address as INTEGER*8 through HBNAM and compute the offset from
the full addresses. THbookFile::SetBranchAddress also passed the value
stored at the user pointer instead of the pointer; it now passes the
address like the other call sites.

Add a roottest that converts a small column-wise ntuple with h2root.
The input file is written by the included mkcwn.f with CERNLIB.

Fixes root-project#23628

Assisted-by: claude-code:claude-fable-5-1
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Test Results

    22 files      22 suites   3d 10h 6m 0s ⏱️
 3 884 tests  3 535 ✅   0 💤 349 ❌
76 028 runs  74 497 ✅ 837 💤 694 ❌

For more details on these failures, see this check.

Results for commit 40ab178.

♻️ This comment has been updated with latest results.

@hageboeck hageboeck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks!

@guitargeek
guitargeek merged commit 25df3ab into root-project:master Nov 3, 2026
55 of 63 checks passed
@guitargeek
guitargeek deleted the h2root-cwn-address-23628 branch November 3, 2026 13:13
@guitargeek

Copy link
Copy Markdown
Contributor Author

/backport to 6.42

@root-project-bot

Copy link
Copy Markdown

Preparing to backport PR #23938 to branch 6.42 requested by guitargeek

@root-project-bot

Copy link
Copy Markdown

This PR has been backported to branch 6.42: #23966

Comment thread hist/hbook/src/THbookFile.cxx Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

regression in h2root

4 participants