Skip to content

JVM profiler rejects traces dirs whose path contains a dot, so tests fail in dotted checkouts #6455

Open

Description

@runningcode

Problem

JavaContinuousProfiler (sentry-async-profiler) refuses any profiling traces directory whose path contains one of 26 characters, . among them. That has two effects:

  • Tests: JavaContinuousProfilerTest's fixture uses a relative tmp cache dir that resolves to an absolute path. In any checkout whose path has a dot, such as a worktree under .claude/worktrees/ or a .workflow directory, 16 of the 23 tests fail. CI's checkout path has no dot, so CI never sees it.
  • Users: a cache dir like /home/app/.sentry or /opt/my.app/cache logs "Disabling profiling because traces directory path contains invalid character: .". Because init() returned true on every call after the first, only the first start was refused, so users lose the first profile chunk and see a misleading warning.

Cause

The blocklist was added in b065ef1 ("re-add asyncprofiler classes, cr changes", #4556), about an hour after Seer flagged the async-profiler command string as a possible injection risk. It reads like a list of shell metacharacters, but no shell runs the command. async-profiler 4.4's Arguments::parse treats only two characters in the path specially:

  • , separates arguments (start,jfr,...,file=<path>);
  • % starts a file-name pattern (%p, %t, %n{MAX}, %{ENV}).

It splits key=value at the first =, so = is safe too.

Fix

#6334 rejects only , and %, and makes a rejected config stay rejected, as AndroidContinuousProfiler does.

Activity

  1. self-assigned this
    on Nov 3, 2026
  2. linear-code commented on Nov 3, 2026

    @linear-code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions