Giter Club home page Giter Club logo

Comments (5)

dellaert avatar dellaert commented on August 30, 2024

Wow, crazy! We pride ourselves on const correctness, but this could be a subtle memory bug. Unfortunately, it seems you are currently in the best position to uncover the bug. Maybe run with memory checking software, or do some print debugging? Printing a bunch of stuff and then doing a diff on both output files could uncover where the issue is introduced.

from gtsam.

dellaert avatar dellaert commented on August 30, 2024

@DanMcGann I was able to reproduce this. On My MAc I can't run valgrind, though. Could you try this?

from gtsam.

dellaert avatar dellaert commented on August 30, 2024

Interestingly, only occurs in Release mode, not in debug mode.

from gtsam.

dellaert avatar dellaert commented on August 30, 2024

@DanMcGann, I tracked down the issue with Xcode. Turns out auto and Eigen do not play well together. Changing this line:

    auto error = -gtsam::traits<VALUE>::Local(val, prior_);

to

    const Vector error = -gtsam::traits<VALUE>::Local(val, prior_);

will fix the issue. FYI, address sanitizer said:

AddressSanitizer: stack-use-after-scope on address 0x00016fdfce20 at pc 0x0001000512fc bp 0x00016fdfc6a0 sp 0x00016fdfc698

Closing as not a GTSAM issue.

from gtsam.

DanMcGann avatar DanMcGann commented on August 30, 2024

Interesting! Glad its not a deeper problem.

Also looks like this is well documented by Eigen which I will link here for posterity (https://eigen.tuxfamily.org/dox/TopicPitfalls.html).

Although, given this documentation I'm surprised to see the issue crop up here as the definition of traits<VALUE>::Local will have an explicit type, so I would not expect it to return an intermediate Eigen expression type. Something to be careful of I suppose.

from gtsam.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.