Bug 426853 - vagrind+massif analyze ceph-osd memory OOM
Summary: vagrind+massif analyze ceph-osd memory OOM
Status: REPORTED
Alias: None
Product: valgrind
Classification: Developer tools
Component: massif (show other bugs)
Version: 3.15 SVN
Platform: Other Linux
: NOR major
Target Milestone: ---
Assignee: Nicholas Nethercote
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-22 07:42 UTC by purestack2012
Modified: 2020-09-26 10:39 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description purestack2012 2020-09-22 07:42:06 UTC
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
Comment 1 Philippe Waroquiers 2020-09-26 10:39:13 UTC
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.