Skip to content

[core] Move TClass tests to core/meta #19586

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 14, 2025
Merged

Conversation

hahnjo
Copy link
Member

@hahnjo hahnjo commented Aug 8, 2025

The test in core/clingutils is meant for unit testing of TClingUtils and statically links ClingUtils and Cling/Clang/LLVM libraries. Calling Cling, TInterpreter, or TClass results in two copies of the functions being around (in libCling.so and the test binary) with not much guarantees which ones are called at which moment.

(causes a test failure with the upgrade to LLVM 20)

@hahnjo hahnjo requested review from vgvassilev and devajithvs August 8, 2025 12:32
@hahnjo hahnjo self-assigned this Aug 8, 2025
Copy link
Contributor

@devajithvs devajithvs left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks.

@pcanal
Copy link
Member

pcanal commented Aug 8, 2025

(causes a test failure with the upgrade to LLVM 20)

Having twice the same symbols is indeed bad. What was the symptoms in the failures?

Copy link
Member

@pcanal pcanal left a comment

Choose a reason for hiding this comment

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

Thanks. (and indeed a test using TClass belongs to core/meta).

Copy link

github-actions bot commented Aug 8, 2025

Test Results

    20 files      20 suites   3d 4h 24m 20s ⏱️
 3 257 tests  3 257 ✅ 0 💤 0 ❌
63 502 runs  63 502 ✅ 0 💤 0 ❌

Results for commit 44e5bb2.

♻️ This comment has been updated with latest results.

@hahnjo
Copy link
Member Author

hahnjo commented Aug 11, 2025

(causes a test failure with the upgrade to LLVM 20)

Having twice the same symbols is indeed bad. What was the symptoms in the failures?

There were two symptoms with LLVM 20, depending on your "luck":

  1. Without JITLink, target machines & triples were registered in the static copy of the symbols and then libCling.so could not find them. This was "caused" by a change in symbol visibility in LLVM 20 and left us confused for quite some time.
  2. When hacking around this (for example by reverting that symbol visibility change), llvm::Module destruction would fail at the end of the test execution because hash values were different. That's because of a second change that now uses a process-specific seed for hashing. That is implemented by taking the address of a known function (install_fatal_error_handler) and relying on address space layout randomization (ASLR) to load code at different virtual addresses every time. The problem here is that we have two install_fatal_error_handler, one in the static binary and one in libCling.so.

We focused on the second point and eventually I guessed what is going on when seeing the size of coreclingutilstestUnit.

hahnjo added 4 commits August 12, 2025 09:05
The test in core/clingutils is meant for unit testing of TClingUtils
and statically links ClingUtils and Cling/Clang/LLVM libraries.
Calling Cling, TInterpreter, or TClass results in two copies of the
functions being around (in libCling.so and the test binary) with not
much guarantees which ones are called at which moment.
This is (unfortunately) needed for core/foundation headers.
@hahnjo hahnjo requested a review from vgvassilev August 12, 2025 07:16
@hahnjo hahnjo merged commit c6302f2 into root-project:master Aug 14, 2025
25 of 26 checks passed
@hahnjo hahnjo deleted the core-tests branch August 14, 2025 06:18
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.

5 participants