Skip to content

Fix issue with Redefine, expand test coverage#8859

Merged
eguiraud merged 3 commits intoroot-project:masterfrom
eguiraud:redefine-fix
Aug 19, 2021
Merged

Fix issue with Redefine, expand test coverage#8859
eguiraud merged 3 commits intoroot-project:masterfrom
eguiraud:redefine-fix

Conversation

@eguiraud
Copy link
Copy Markdown
Contributor

Before the introduction of Redefine, RDefine::InitSlot did not
recursively call InitSlot on its table of defined columns because
it was guaranteed that some other action of filter would do it if
that defined column was ever to be used.

With the introduction of Redefine, the only user of a RDefine
might be another RDefine (RDefine serves as the workhorse of both
Defines and Redefines), so we have to trigger the recursive call
to InitSlot from RDefine as well.

This PR fixes #8857 .

Before this commit, we were not testing the case of a Redefine
that overrides a previous Define where the Define also needs to
read some input column.
@eguiraud eguiraud requested a review from etejedor August 19, 2021 10:29
@eguiraud eguiraud self-assigned this Aug 19, 2021
@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-performance-centos8-multicore/default.
Running on olbdw-01.cern.ch:/data/sftnight/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

Before the introduction of `Redefine`, `RDefine::InitSlot` did not
recursively call `InitSlot` on its table of defined columns because
it was guaranteed that some other action of filter would do it if
that defined column was ever to be used.

With the introduction of `Redefine`, the only user of a `RDefine`
might be another `RDefine` (`RDefine` serves as the workhorse of both
`Define`s and `Redefine`s), so we have to trigger the recursive call
to `InitSlot` from `RDefine` as well.

This fixes root-project#8857.
{
if (!fIsInitialized[slot]) {
for (auto &define : fDefines.GetColumns())
define.second->InitSlot(r, slot);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could the InitSlot call still be done from an action or Filter too as it was before? Is that a problem?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sure, and it should not be a problem

@eguiraud eguiraud merged commit b5e16ab into root-project:master Aug 19, 2021
@eguiraud eguiraud deleted the redefine-fix branch August 19, 2021 13:40
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.

[DF] Redefine()ing a Defined() column causes segmentation violation

3 participants