Skip to content

ci: add Valgrind memcheck job#356

Draft
abhinavagarwal07 wants to merge 1 commit into
libfuse:masterfrom
abhinavagarwal07:ci-valgrind
Draft

ci: add Valgrind memcheck job#356
abhinavagarwal07 wants to merge 1 commit into
libfuse:masterfrom
abhinavagarwal07:ci-valgrind

Conversation

@abhinavagarwal07
Copy link
Copy Markdown
Collaborator

@abhinavagarwal07 abhinavagarwal07 commented May 19, 2026

Add a Valgrind memcheck job running the full pytest suite under memcheck with --error-exitcode=99 and definite/indirect leak checking. Runs on every push/PR with continue-on-error: true — currently finding real sshfs-owned definite leaks that need fixing before this can be promoted to a required check.

Note: this PR only adds the valgrind-memcheck job. The existing build-and-test job in the same workflow is unchanged and will be updated by PRs #6/#7.

Test harness changes:

  • Add VALGRIND_OPTIONS env var support in test/util.py via shlex.split
  • Fix fusermount/fusermount3 inconsistency: cleanup() and fuse_test_marker() now use fusermount3 consistently
  • Scale wait_for_mount/umount timeouts 4x (30s → 120s) when running under Valgrind
  • Register Valgrind ==pid== output lines as false positives in conftest.py
  • Set G_DEBUG=fatal-warnings,gc-friendly and G_SLICE=always-malloc for cleaner Valgrind output
  • Raw Valgrind logs written via --log-file and uploaded as artifacts alongside JUnit XML

Suppressed failures:

  • test/valgrind.supp suppresses only third-party libfuse-worker-thread-alloc teardown leaks (calloc inside libfuse3.so during pthread_create). No sshfs-owned code is suppressed — project leaks will fail the job.
  • Job uses continue-on-error: true because it is currently surfacing real definite leaks through buf_init/sftp_read, buf_init/sftp_send_iov, and cache_add_link. Promote to required once those leaks are fixed.

Valgrind memcheck is the most thorough dynamic memory analysis available for C — it catches use-after-free, uninitialized reads, and leaks that sanitizers can miss due to compiler optimizations.

A weekly schedule trigger also runs the Valgrind job on master even without pushes, catching regressions from runner image updates or dependency changes.

- Add valgrind-memcheck job running full pytest suite under memcheck with continue-on-error: true
- Uses --error-exitcode=99 with definite/indirect leak checking
- Currently finding real sshfs-owned leaks (buf_init/sftp_read, buf_init/sftp_send_iov, cache_add_link) — will go green once those are fixed
- Raw Valgrind logs written via --log-file and uploaded as artifacts alongside JUnit XML
- Add VALGRIND_OPTIONS support to test/util.py via shlex.split
- Suppression file covers only third-party libfuse worker-thread teardown leaks
- Fix fusermount/fusermount3 mismatch, scale timeouts 4x under Valgrind
- Set G_DEBUG/G_SLICE for cleaner Valgrind output
- Hard-fail FUSE preflight, workflow-level permissions and concurrency
- All actions pinned to Node 24-capable SHAs, runner pinned to ubuntu-24.04
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.

1 participant