SUMMARY When using the Massif tool to display the memory allocation stack, the XTree file cannot be output。 STEPS TO REPRODUCE 1. valgrind --tool=massif /usr/bin/ceph-osd -f --cluster ceph --id 1 --setuser ceph --setgroup ceph 2. 3. OBSERVED RESULT [root@node118 ~]# valgrind --tool=massif /usr/bin/ceph-osd -f --cluster ceph --id 1 --setuser ceph --setgroup ceph ==1742361== Massif, a heap profiler ==1742361== Copyright (C) 2003-2017, and GNU GPL'd, by Nicholas Nethercote ==1742361== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info ==1742361== Command: /usr/bin/ceph-osd -f --cluster ceph --id 1 --setuser ceph --setgroup ceph ==1742361== ==1742361== Warning: unimplemented fcntl command: 1038 ==1742361== Warning: unimplemented fcntl command: 1038 2020-09-22 15:32:29.472 a1dd7c0 -1 Falling back to public interface [pick_addresses:344] ==1742361== Warning: unimplemented fcntl command: 1038 ==1742361== Warning: unimplemented fcntl command: 1038 ==1742361== Warning: unimplemented fcntl command: 1038 ==1742361== Warning: unimplemented fcntl command: 1038 2020-09-22 15:33:04.237 a1dd7c0 -1 osd.1 1178 log_to_monitors {default=true} [OSD::update_log_config:10416] 2020-09-22 15:33:06.962 1b211700 -1 osd.1 1330 set_numa_affinity unable to identify public interface 'eth0' numa node: (2) No such file or directory [OSD::set_numa_affinity:2459] ^C2020-09-22 15:34:16.316 17564700 -1 received signal: Interrupt, si_code : 128, si_value (int): 0, si_value (ptr): 0, si_errno: 0, si_pid : 0, si_uid : 0, si_addr0, si_status0 [SignalHand 2020-09-22 15:34:16.318 17564700 -1 osd.1 1332 *** Got signal Interrupt *** [OSD::handle_signal:2390] 2020-09-22 15:34:16.320 17564700 -1 osd.1 1332 *** Immediate shutdown (osd_fast_shutdown=true) *** [OSD::shutdown:3999] ==1742361== ==1742361== Error: can not open xtree output file `/root/massif.out.1742361' ==1742361== could not unlink /tmp/vgdb-pipe-from-vgdb-to-1742361-by-root-on-node118 ==1742361== could not unlink /tmp/vgdb-pipe-to-vgdb-from-1742361-by-root-on-node118 ==1742361== could not unlink /tmp/vgdb-pipe-shared-mem-vgdb-1742361-by-root-on-node118 [root@node118 ~]# EXPECTED RESULT can open xtree output file `/root/massif.out.1742361' SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: CentOS Linux release 7.4.1708 (Core) Linux node118 4.14.179-1.el7.x86_64 #1 SMP Tue May 12 02:22:15 EDT 2020 x86_64 x86_64 x86_64 GNU/Linux (available in About System) KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION 1、Memcheck tool can be used by the target application 2、The examples on the official website can also output the results properly using the Massif tool https://www.valgrind.org/docs/manual/ms-manual.html
The message "Error: can not open xtree output file" is produced when the open system call fails. Such qn "open" failing is likely caused by some protection problems at operating system level. I see e.g. that the program gets argument such as --setuser ceph. Are you sure the user ceph can write in /root ? You could use the valgrind arguments --massif-out-file=... to change the location where the file is produced.