-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
RNTuple: fields with mixed STL types sometimes fail to be filled #15534
Comments
Root cause may actually be a bug in the |
I cannot reproduce it on Linux, it could be a macOS specific issue. |
The PR contains a test that demonstrates that user code can produce empty variants, which the I/O system needs to handle. |
Several fixes are up in the PR, however there is something strange about Could it be related to empty base class optimization, or in this case the lack thereof due to multiple inheritance? But in this case, why is the padding missing for
|
So it turns out this is due to EBCO, or rather its non-happening: The reason is that both class Empty {};
class Inner : private Empty {
int i;
};
class Outer1 {
Inner i;
};
class Outer2 : private Empty {
Inner i;
};
static_assert(sizeof(Outer1) == 4);
static_assert(sizeof(Outer2) == 8); (https://godbolt.org/z/6dGdTK6ha) where The problem for RNTuple code is that this can happen for other STL (value) containers as well; we should probably check
|
Nice investigation!
As a slightly larger type |
Check duplicate issues.
Description
When having fields with mixed STL types sometimes you run into issues when trying to fill them. I've attached an example below.
Reproducer
This is a minimal script that shows that issue.
And this is the error that it produces.
Another way to get it to fail is by using
std::vector<std::variant<std::atomic<int>,float>>
.ROOT version
6.33/01 (commit eef2244)
Installation method
Built from source
Operating system
macOS
Additional context
I found this issue while trying to generate
std::variant
types in an invalid state by doing something like this.The spec indicates that invalid states are supported, as shown in the line below. I wanted to ask what's the reason for them being supported given that they are not really supposed to be "legal", and it seems like one can't successfully generate an RNTuple with an invalid state. It either ends up initializing the first variant or it crashes.
root/tree/ntuple/v7/doc/specifications.md
Line 780 in 9530711
The text was updated successfully, but these errors were encountered: