Skip to content

[cling] DlClose what DlLibMan has DlOpened in reverse order - #19268

Open
ferdymercury wants to merge 5 commits into
root-project:masterfrom
ferdymercury:dlclose
Open

ferdymercury wants to merge 5 commits into
root-project:masterfrom
ferdymercury:dlclose

Conversation

@ferdymercury

@ferdymercury ferdymercury commented Jul 3, 2025 •

Copy link
Copy Markdown
Collaborator

All credit goes to @Axel-Naumann, this is just a rebase of #5568 to see if it still works / makes sense or if it should just be closed.

Not sure if this is exhaustive, there might be other places to take care:

core/metacling/src/TClingCallbacks.cxx
core/base/src/TROOT.cxx
core/metacling/src/TCling.cxx
interpreter/cling/lib/Utils/PlatformPosix.cpp
interpreter/cling/lib/Interpreter/IncrementalParser.cpp
interpreter/CppInterOp/lib/CppInterOp/CppInterOpInterpreter.h
interpreter/cling/lib/Utils/PlatformPosix.cpp
bindings/pyroot/pythonizations/python/ROOT/_numbadeclare.py
bindings/pyroot/pythonizations/python/ROOT/_jupyroot/helpers/cppcompleter.py

Related:
https://its.cern.ch/jira/browse/ROOT-10659
https://its.cern.ch/jira/browse/ROOT-6022

@ferdymercury

Copy link
Copy Markdown
Collaborator Author

@hageboeck I see some failures, maybe related with CMake targets. Do I need to add here the clean-build label?

@hageboeck

Copy link
Copy Markdown
Member

@hageboeck I see some failures, maybe related with CMake targets. Do I need to add here the clean-build label?

Most likely yes.

@ferdymercury ferdymercury added the clean build Ask CI to do non-incremental build on PR label Jul 3, 2025
@ferdymercury ferdymercury reopened this Jul 3, 2025
@github-actions

github-actions Bot commented Jul 3, 2025 •

Copy link
Copy Markdown

Test Results

    22 files      22 suites   3d 9h 41m 48s ⏱️
 3 938 tests  3 938 ✅ 0 💤 0 ❌
77 209 runs  77 209 ✅ 0 💤 0 ❌

Results for commit 29057c1.

♻️ This comment has been updated with latest results.

@pcanal

pcanal commented Jul 15, 2025

Copy link
Copy Markdown
Member

There are still failures, so they maybe actually related. Let's try one more rerun ...

@pcanal pcanal closed this Jul 15, 2025
@pcanal pcanal reopened this Jul 15, 2025
@ferdymercury

Copy link
Copy Markdown
Collaborator Author

There are still failures, so they maybe actually related. Let's try one more rerun ...

Yes, the failures seem related.

@ferdymercury

Copy link
Copy Markdown
Collaborator Author

One of the failing tests is https://github.com/root-project/root/blob/master/roottest/root/tree/cloning/runtreeCloneTest2.C

which does not cleanup memory before the end of the script.

Question: should we investigate why the crash happens? Or should we just do a proper cleanup at the end of the script, meaning file->Close() delete file;?

@pcanal

pcanal commented Jul 15, 2025

Copy link
Copy Markdown
Member

Unfortunately we need to investigate the failure. However awkward that setup is, it is supported (on a best effort basis only though).

@ferdymercury

ferdymercury commented Jul 16, 2025 •

Copy link
Copy Markdown
Collaborator Author

Since there are less tests failing in debug mode, I'd bet it's a race condition.
I'm not sure how to debug this though since I don't have mac. Is there a way to activate valgrind in the CI in addition to coredump?

Or do you think rather that the problem is from other dlopen or dlclose places that are not being taken care of?

@ferdymercury ferdymercury removed the clean build Ask CI to do non-incremental build on PR label Jul 16, 2025
@dpiparo dpiparo closed this Jul 30, 2025
@dpiparo dpiparo reopened this Jul 30, 2025
@dpiparo

dpiparo commented Jul 30, 2025

Copy link
Copy Markdown
Member

restarting the build with the new code in master...

@ferdymercury

ferdymercury commented Jul 30, 2025 •

Copy link
Copy Markdown
Collaborator Author

Still failing :s

Maybe related? #16270

@ferdymercury
ferdymercury marked this pull request as draft November 4, 2025 16:03
@ferdymercury
ferdymercury force-pushed the dlclose branch 2 times, most recently from 7fea60f to 3efc822 Compare August 20, 2026 08:07
@ferdymercury
ferdymercury force-pushed the dlclose branch 3 times, most recently from 835c4df to 8e6695a Compare August 20, 2026 09:57
@hahnjo hahnjo added the in:Cling label Nov 5, 2026
@hahnjo
hahnjo self-requested a review November 5, 2026 08:51
All credit goes to anaumann, this is just a rebase of root-project#5568

[cling] move destructor to different cpp file
Before deleting the interpreter, ensure nothing
is pending in global lists, otherwise things from TTreePlayer.so
get destructed at teardown, after it was dlclosed by the
interpreter.

Finding this fix was AI-assisted.
@ferdymercury ferdymercury added the skip ci Skip the full builds on the actions runners label Nov 19, 2026
@ferdymercury ferdymercury removed the skip ci Skip the full builds on the actions runners label Nov 19, 2026
@ferdymercury
ferdymercury marked this pull request as ready for review November 19, 2026 10:32
@ferdymercury
ferdymercury requested a review from pcanal as a code owner November 19, 2026 10:32
@ferdymercury ferdymercury reopened this Nov 20, 2026
@ferdymercury

Copy link
Copy Markdown
Collaborator Author

CI failure seems unrelated

@ferdymercury
ferdymercury marked this pull request as draft November 21, 2026 17:23
@ferdymercury
ferdymercury marked this pull request as ready for review November 22, 2026 00:24

This branch has not been deployed

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