Skip to content

Conversation

@aitap
Copy link
Member

@aitap aitap commented Jan 12, 2026

The n array is only initialised if even is true, so skip the comparisons otherwise. Detected by checking with --use-valgrind or performing a frollmedian() with an odd window size under R -d valgrind.

Fixes: #7546

The 'n' array is only initialised if 'even' is true, so skip the
comparisons otherwise. Detected by checking with --use-valgrind or
performing a frollmedian() with an odd window size under R -d valgrind.

Fixes: #7546
@aitap aitap requested a review from jangorecki as a code owner January 12, 2026 20:05
@codecov
Copy link

codecov bot commented Jan 12, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 99.02%. Comparing base (a325db9) to head (f11e0ff).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/froll.c 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7589      +/-   ##
==========================================
- Coverage   99.02%   99.02%   -0.01%     
==========================================
  Files          87       87              
  Lines       16803    16804       +1     
==========================================
  Hits        16640    16640              
- Misses        163      164       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link

No obvious timing issues in HEAD=frollmedian-even-undefined
Comparison Plot

Generated via commit f11e0ff

Download link for the artifact containing the test results: ↓ atime-results.zip

Task Duration
R setup and installing dependencies 5 minutes and 18 seconds
Installing different package versions 11 minutes and 16 seconds
Running and plotting the test cases 3 minutes and 59 seconds

@MichaelChirico
Copy link
Member

LGTM, I'll let Jan give final approval. Should we add a new test? codecov says we lost a line.

Copy link
Member

@ben-schwen ben-schwen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I understand the hot path argument, but given that we just had a bug about access to an uninitialized array (in only 1 of 2 paths), I would be in favor of trying to unify both paths in favor lowering the maintenance burden.

n[B] = tail;
if (even) {
if (n[A]!=tail && m[A] == n[A]) {
n[A] = tail;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm struggling to devise a test that would reach this line. The closest I've got was n[A] = m[A] = tail = 4 for frollmedian(c(1:4, rep(1,3)), 4).

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.

valgrind issue in 1.18.0

3 participants