You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.
Hi, thank you for providing access to this excellent tool! In the following minimal example, libc::sysconf shows up in the call graph output, but libc::sysctlbyname doesn't. I haven't been able to track down why:
Run cargo init in a new folder, then replace the main.rs file with the above code.
Add the config.json file to this folder
Set MIRAI_FLAGS to f"--call_graph_config config.json"
Then run cargo mirai and inspect the output graph.dot
Expected Behavior
In the graph.dot output (and call_sites.json as well), I expect to see a main function with call graph edges to both libc::sysconf and libc::sysctlbyname (as well as another edge, to CStr::from_bytes_with_nul).
Actual Results
Here's the call graph that is generated. It contains two of the expected edges, but libc::sysctlbyname is missing:
I also took a look at call_sites.json, which contains an entry for libc.unix.foreign_1.sysconf, but nothing for sysctlbyname.
Environment
This is (possibly) MacOS specific code; I've only tested it on a mac (MacOS Monterey M1). But I think the libc function calls should show up regardless.
Rust version (rustc --version): rustc 1.64.0 (a55dd71d5 2022-09-19)
Possible explanations
I thought this might be due to code inlining, but I made a quick test file with #[inline(always)] and #[inline(never)] annotations, and both types of function calls show up.
It occurs to me that the syscall could be being optimized out prior to the MIR level, but that seems unlikely for this case.
Thank you and really appreciate any help that you can provide to diagnose this!
The text was updated successfully, but these errors were encountered:
Issue
Hi, thank you for providing access to this excellent tool! In the following minimal example,
libc::sysconf
shows up in the call graph output, butlibc::sysctlbyname
doesn't. I haven't been able to track down why:Here's the
config.json
file we're using to generate the call graph:Steps to Reproduce
cargo init
in a new folder, then replace themain.rs
file with the above code.config.json
file to this folderMIRAI_FLAGS
tof"--call_graph_config config.json"
cargo mirai
and inspect the outputgraph.dot
Expected Behavior
In the
graph.dot
output (andcall_sites.json
as well), I expect to see amain
function with call graph edges to bothlibc::sysconf
andlibc::sysctlbyname
(as well as another edge, toCStr::from_bytes_with_nul
).Actual Results
Here's the call graph that is generated. It contains two of the expected edges, but
libc::sysctlbyname
is missing:And here's the raw
graph.dot
file:I also took a look at
call_sites.json
, which contains an entry forlibc.unix.foreign_1.sysconf
, but nothing forsysctlbyname
.Environment
This is (possibly) MacOS specific code; I've only tested it on a mac (MacOS Monterey M1). But I think the
libc
function calls should show up regardless.Rust version (rustc --version):
rustc 1.64.0 (a55dd71d5 2022-09-19)
Possible explanations
I thought this might be due to code inlining, but I made a quick test file with
#[inline(always)]
and#[inline(never)]
annotations, and both types of function calls show up.It occurs to me that the syscall could be being optimized out prior to the MIR level, but that seems unlikely for this case.
Thank you and really appreciate any help that you can provide to diagnose this!
The text was updated successfully, but these errors were encountered: