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

Double free when unused but optimized variable appears appears in cpp solver #380

Closed
michael-fennel-skydio opened this issue Jan 11, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@michael-fennel-skydio
Copy link

Describe the bug
A double free happens within the C++ solver, when a factor is given that contains a variable that is marked as optimized but never appears in the actual problem statement.

To Reproduce

  1. Use any optimization problem formulation in python using the Factor class.
  2. Remove an arbitrary symbolic variable from your problem entirely, but leave its definition.
  3. Add this symbolic variable to the optimized_keys in factor.generate()
  4. Use the generate code in the LM solver.
  5. Watch it crash.

Expected behavior
Optimized variable should simply be kept at its initial value,

Environment (please complete the following information):

  • Skydio developer station
@michael-fennel-skydio michael-fennel-skydio added the bug Something isn't working label Jan 11, 2024
asa pushed a commit to asa/symforce that referenced this issue Feb 16, 2024
Previously it was possible to construct an optimization problem with
sparse factors with symbolic zeros on the diagonal.  We now explicitly
add entries to the symbolic diagonal so that the sparsity pattern is
correct after damping

Fixes symforce-org#380

Topic: sf-sparse-zeroes
Reviewers: ryan-b,chao,nathan,brad,michael-f,philipp
GitOrigin-RevId: 6d4b44cbf6fcd977515e557c9a95eab6a5ca1b6a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant