Skip to content

fix: pass null pointer for jemalloc prof.dump#1227

Merged
kixelated merged 1 commit into
mainfrom
fix/jemalloc-prof-dump
Apr 7, 2026
Merged

fix: pass null pointer for jemalloc prof.dump#1227
kixelated merged 1 commit into
mainfrom
fix/jemalloc-prof-dump

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Summary

  • jemalloc's prof.dump mallctl expects a NULL pointer to use the prof_prefix path from MALLOC_CONF
  • The previous code passed an empty C string (b"\0"), which jemalloc treated as an invalid filename, causing dumps to fail with EFAULT
  • Confirmed on usc.cdn.moq.dev — profiling is active but kill -USR1 produces: failed to dump heap profile err=An interface with side effects failed

Test plan

  • Deploy to a relay node and send SIGUSR1
  • Verify heap dump files appear at /tmp/moq-relay.heap.<pid>.<seq>.heap

🤖 Generated with Claude Code

jemalloc's prof.dump mallctl expects a NULL pointer to use the
prof_prefix path. An empty C string ("\0") is treated as an invalid
filename, causing the dump to fail with EFAULT.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0af981c5-e30e-46f7-9073-93a6c92de4b7

📥 Commits

Reviewing files that changed from the base of the PR and between 373e6da and 3913ab6.

📒 Files selected for processing (1)
  • rs/moq-relay/src/jemalloc.rs

Walkthrough

The jemalloc module in the moq-relay crate updates the heap-profile dump trigger mechanism. The change modifies the second argument passed to raw::write when invoking prof.dump, replacing a cast empty byte-string literal with a typed null pointer. The surrounding signal handling logic, match-based success and error logging behavior, and overall control flow remain unchanged.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: replacing an empty C string with a null pointer for jemalloc's prof.dump mallctl argument.
Description check ✅ Passed The description clearly explains the problem (jemalloc expecting NULL pointer, previous code passing empty string causing EFAULT), the observed failure, and the intended fix.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/jemalloc-prof-dump
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch fix/jemalloc-prof-dump

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kixelated kixelated enabled auto-merge (squash) April 7, 2026 02:19
@kixelated kixelated disabled auto-merge April 7, 2026 02:34
@kixelated kixelated merged commit 040b75b into main Apr 7, 2026
2 checks passed
@kixelated kixelated deleted the fix/jemalloc-prof-dump branch April 7, 2026 02:34
This was referenced Apr 4, 2026
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