Skip to content

Demangled calls containing semicolons split across multiple lines on MacOS #462

Description

@CraftSpider

I'm not certain if this error is MacOS specific for sure, but using recent cargo flamegraph with xctrace backend, functions with array types in them are being split across multiple lines on the semicolon. I've attached an example svg, generated from the following code:

//! Run with `cargo flamegraph --ignore-status`
use std::hint::black_box;
use std::time;
use std::time::Duration;

fn foo<T: Default>() -> T {
    let start = time::SystemTime::now();
    while (time::SystemTime::now().duration_since(start).unwrap()) < Duration::from_secs(1) {
        black_box(())
    }
    black_box(T::default())
}

fn main() {
    for _ in 0..10 {
        println!("{:?}", foo::<[u8; 2]>());
    }
}
Image

The --ignore-status is needed for an unrelated issue. Originally noticed while profiling something with quite a few array types in the demangled type, leading to comedically tall stacks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions