Skip to content
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

Silence a warning about a memcpy overread for gcc 13 #2002

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

jmackay2
Copy link
Contributor

This is the final fix to get gtsam building again on Ubuntu 24.04. I'm not super thrilled just ignoring this warning. This could probably use a revisit on ways to fix the issue.

Here is the error this is fixing:

    inlined from ‘void Eigen::internal::call_assignment(Dst&, const Src&) [with Dst = Eigen::Block<Eigen::Matrix<double, -1, -1>, -1, -1, false>; Src = Eigen::Matrix<double, -1, -1>]’ at gtsam/gtsam/3rdparty/Eigen/Eigen/src/Core/AssignEvaluator.h:836:18,
    inlined from ‘Derived& Eigen::MatrixBase<Derived>::operator=(const Eigen::DenseBase<OtherDerived>&) [with OtherDerived = Eigen::Matrix<double, -1, -1>; Derived = Eigen::Block<Eigen::Matrix<double, -1, -1>, -1, -1, false>]’ at gtsam/gtsam/3rdparty/Eigen/Eigen/src/Core/Assign.h:66:28,
    inlined from ‘void gtsam::JacobianFactor::fillTerms(const TERMS&, const gtsam::Vector&, const gtsam::SharedDiagonal&) [with TERMS = std::map<long unsigned int, Eigen::Matrix<double, 1, 1, 0, 1, 1> >]’ at gtsam/gtsam/linear/JacobianFactor-inl.h:94:14:
/usr/lib/gcc/x86_64-linux-gnu/13/include/emmintrin.h:169:19: error: ‘void* __builtin_memcpy(void*, const void*, long unsigned int)’ reading 16 or more bytes from a region of size 8 [-Werror=stringop-overread]
  169 |   *(__m128d *)__P = __A;
      |   ~~~~~~~~~~~~~~~~^~~~~

This seems to be pointing to this assignment:

This fix is based on the same solution used in #1978 .

I am able to get a successful Ubuntu 24.04 build after this fix.

@dellaert
Copy link
Member

CI issue?

@ProfFan
Copy link
Collaborator

ProfFan commented Jan 25, 2025

Need to guard against older GCC:
error: unknown option after ‘#pragma GCC diagnostic’ kind [-Werror=pragmas]

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.

3 participants