-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix dangling reference in static allocation. #1
Conversation
With gcc 10.3 this line leads to a segfault in the static initialisation.
I'm not exactly sure how the .finished() is supposed to work, because it creates a reference to a temporary. Which I think is not guaranteed to outlive the reference? @efernandez any thoughts on this? With the #include <iostream>
#include <Eigen/Core>
using Vector = Eigen::VectorXd;
int main(int argc, char* argv[])
{
const auto& x = (Vector(1) << 0).finished();
std::cout << x[0] << std::endl;
return 0;
} Which causes an invalid read when indexing into Similar backtraces are seen in this upstream ticket. |
@iwanders TBH I've never looked at It's used to "convert" the I suspect the Maybe we should also sent this PR upstream, to avoid diverging. |
Valgrind reports;
|
Fix contributed by @iwanders that resolves a static initialization crash in graph_manager.
FYI @efernandez