Skip to content

Commit 477688f

Browse files
rocketmarkclaude
authored andcommitted
fix use-of-uninitialized-value in survive_kalman_tracker_stats
integration_variance[16] is stack-allocated but variance_tracker_calc() may not write all elements when the tracker had zero observations (counts == 0 or variance.size == 0). The uninitialized array is then read by SV_VERBOSE via LINMATH_VEC7_EXPAND / LINMATH_VEC6_EXPAND. Found by MSan when running test_replays. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 32cf62c commit 477688f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/survive_kalman_tracker.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1485,7 +1485,7 @@ void survive_kalman_tracker_stats(SurviveKalmanTracker *tracker) {
14851485
SV_VERBOSE(5, "\t%-32s " Point19_format, "Mean reported variance", LINMATH_VEC19_EXPAND(var));
14861486
scalend(var, tracker->stats.dropped_var, 1. / tracker->stats.reported_poses, SURVIVE_MODEL_MAX_STATE_CNT);
14871487
SV_VERBOSE(5, "\t%-32s " Point19_format, "Mean dropped variance", LINMATH_VEC19_EXPAND(var));
1488-
FLT integration_variance[16];
1488+
FLT integration_variance[16] = {0};
14891489
variance_tracker_calc(&tracker->pose_variance, integration_variance);
14901490
SV_VERBOSE(5, "\t%-32s %e (%7u integrations, %7.3fhz) " Point7_format, "Obs error",
14911491
tracker->stats.obs_total_error / (FLT)tracker->stats.obs_count, (unsigned)tracker->stats.obs_count,

0 commit comments

Comments
 (0)