-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[TTreeReader] Crash in TNotifyLink with reused TChain with friend #17843
Comments
Valgrind stack trace:
|
This should be fixed by: #17822 |
Hi @ferdymercury , Thanks for opening this issue! I am trying to reproduce it, but failing to do so on my machine. I'm using Fedora 41, and compiling both ROOT master and ROOT 6.34 (with debug symbols). I can't reproduce the segfault in either configuration. Also valgrind does not report anything in my case. My CMake configuration is |
Hi, thanks for the reply. You tried the second snippet right of the "Reproducer" section (not the first), right? I have tried in another Ubuntu 22 machine and downloaded the binaries from the ROOT website. I can reproduce the crash with 6.34.04 and 6.32.10. |
To demonstrate root-project#17843
Hi @vepadulano I just retried with "master" (commit) a588ea2 and built ROOT in Debug mode. I still get the crash. Happy to do a zoom if you want to see my debugging session. So I have no idea what's going on and why CI does not show it. Maybe the test is not running correctly or does not catch the segfault? (When I try locally, I do not build the test, but rather run the script in compiled mode). In case it helps, running with high gDebug, last lines before crashing:
|
I seem to be able to reproduce the problem .... but only if the script is interpreted. |
And this is the expected behavior. The broken version of the code contain undefined behavior:
where at the end the chain still uses to store and access the user data, address on the stack that are no longer available.
|
@ferdymercury Can you prepare patches to the original test files? |
I had already tried your approach some days ago, and it didn't solve my crash. :s Anyway, I just retried with your modification. I am compiling the script, and I get:
with that file containing:
|
At some point, I was thinking... "maybe my Debug ROOT-build is screwed", this is a caching issue and I have to rebuild all from scratch. But then I tried rerunning from binary download release 6.34.02, and I get the same crash, only in compiled mode:
And Got exactly same result with 6.34.04 |
I think this might be important information: If I remove the line then the script fails in both modes. If it's there, then it only fails in precompiled Mode ( As if ResetBranchAddresses was having no effect in Compiled mode. Threading issue? |
I also don't understand, if the code is broken/wrong without that line, how come that the CI does not detect it here: https://github.com/root-project/root/pull/17823/files ? |
Without the |
Running the address sanitizer with the attached file shows the following:
results in:
|
Would a debug build lead the address sanitizer to give more information (line number)? |
Sure, here it is, both ROOT-debug and g++ -DNDEBUG -O0 -g and a modified repro: reproducer.txt Maybe the ResetBranchAddresses is not fully resetting the friend's branch address?
|
Otherwise it is undefined behavior. See related discussion root-project#17843 Co-authored-by: Philippe Canal <[email protected]>
asan also reports a memory leak fixed by:
|
The problem is that we have:
but A work around is:
The solution is to investigate why |
as suggested by pcanal in root-project#17843 (comment)
Maybe related: #8027 (comment) |
Check duplicate issues.
Description
Reproducer
This works:
This fails:
ROOT version
Installation method
Build from source
Operating system
Ubuntu 22.04
Additional context
Maybe related: #10096
Found out in this test: https://github.com/root-project/root/pull/17823/files#r1973347654
The text was updated successfully, but these errors were encountered: