Skip to content

macos query process info wrong #25

@kekeimiku

Description

@kekeimiku
fn main() {
    let pid = std::env::args().nth(1).unwrap().parse().unwrap();
    let maps = proc_maps::get_process_maps(pid).unwrap();
    for map in maps.into_iter().filter(|x| !x.is_write()) {
        println!(
            "{:x}-{:x} {:?}",
            map.start(),
            map.size() + map.start(),
            map.filename()
        )
    }
}

In the vmmap command, the filename obtained should be None.

proc-maps output:

...
108c80000-108cc0000 Some("/Users/****/UnityFramework")
...

vmmap command output:

...
VM_ALLOCATE                 108c80000-108cc0000    [  256K     0K     0K     0K] ---/rwx SM=NUL  
...

But for very small processes, such as print helloworld , proc-maps can get the filename correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions