Asan build jolt memory bug catches [SYNTH-270]#1434
Open
BrandonPacewic wants to merge 3 commits into
Open
Conversation
Dhruv-0-Arora
self-requested a review
July 24, 2026 20:33
Comment on lines
-609
to
+637
| // TODO | ||
| // Figure out if this cast is necessary | ||
| // If not, replace with `this.newConstraint()` | ||
| const fixedConstraint = JOLT.castObject(fixedSettings.Create(bodyMain, bodyWheel), JOLT.TwoBodyConstraint) | ||
| const fixedConstraint = fixedSettings.Create(bodyMain, bodyWheel) |
Collaborator
There was a problem hiding this comment.
How come we are removing JOLT.castObject() ?
It looks to me as though it was a load-bearing cast
in SynthesisBrain, this is now dead:
// Two body constraints are part of wheels and are used to determine which way a wheel is facing
const fixedConstraints: Jolt.TwoBodyConstraint[] = this._mechanism.constraints
.filter(mechConstraint => mechConstraint.primaryConstraint instanceof JOLT.TwoBodyConstraint)
.map(mechConstraint => mechConstraint.primaryConstraint as Jolt.TwoBodyConstraint)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Task
SYNTH-270
Resolve as many "simple" jolt memory leaks and issues as could be found through empirical testing.
Symptom
Several instances of us not fully understanding some cases of jolt memory were causing us to miss things. Proper teardown of some objects never happened, some cases of true use after free bugs were present.
Solution
This list of memory bugs is exhaustive for the files included. With these changes the Asan build now passes which previously failed.
Verification
Every single change here was verified with a full Jolt Asan build and run. No remaining leaks are in the files present in this pr.
Verify that everything still works, this should be a no-op with current behavior. Test current known memory related bugs and crashes to see if this indirectly fixed any.
Before merging, ensure the following criteria are met: