Bug 1301247

Summary: memory leak in killall
Product: Red Hat Enterprise Linux 7 Reporter: Badalyan Vyacheslav <v.badalyan>
Component: psmiscAssignee: Jan Rybar <jrybar>
Status: CLOSED WONTFIX QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: bnater, law, ohudlick
Target Milestone: rcKeywords: EasyFix, Upstream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-12-15 07:39:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1473612    

Description Badalyan Vyacheslav 2016-01-23 01:02:40 UTC
[root@vm-asterisk04t asterisk-13.7.0]# LD_PRELOAD=/lib64/libasan.so.2 killall 11111
11111: no process found

=================================================================
==1708==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 1024 byte(s) in 1 object(s) allocated from:
    #0 0x7fe30ef15a0a in malloc (/lib64/libasan.so.2+0x98a0a)
    #1 0x402104  (/usr/bin/killall+0x402104)
    #2 0x7fff99d3e4fb  (<unknown module>)

Direct leak of 1024 byte(s) in 1 object(s) allocated from:
    #0 0x7fe30ef15a0a in malloc (/lib64/libasan.so.2+0x98a0a)
    #1 0x402183  (/usr/bin/killall+0x402183)

Direct leak of 384 byte(s) in 3 object(s) allocated from:
    #0 0x7fe30ef15a0a in malloc (/lib64/libasan.so.2+0x98a0a)
    #1 0x402c76  (/usr/bin/killall+0x402c76)

Direct leak of 4 byte(s) in 1 object(s) allocated from:
    #0 0x7fe30ef15a0a in malloc (/lib64/libasan.so.2+0x98a0a)
    #1 0x40202b  (/usr/bin/killall+0x40202b)

SUMMARY: AddressSanitizer: 2436 byte(s) leaked in 6 allocation(s).

Comment 2 Badalyan Vyacheslav 2016-01-23 01:30:48 UTC
used devtoolset-4 (gcc-5.2)

Comment 3 Badalyan Vyacheslav 2016-01-27 19:35:01 UTC
[root@vm-asterisk04t ~]# rpm -qa | grep libasan
devtoolset-4-libasan-devel-5.2.1-2.2.el7.x86_64
libasan2-5.2.1-2.2.el7.x86_64

[root@vm-asterisk04t ~]# rpm -qa | grep psmis
psmisc-22.20-9.el7.x86_64

[root@vm-asterisk04t ~]# uname -a
Linux vm-asterisk04t.tcsbank.ru 3.10.0-327.4.4.el7.x86_64 #1 SMP Tue Jan 5 16:07:00 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Comment 5 Jan Rybar 2017-03-13 12:21:49 UTC
Hello Badalyan,

you're right, one of the four leaks is actually lost memory allocation. Thanks for your eagle eye!

The rest is actually not lost memory, it's just not returned right before the termination of the program. I'm not sure if upstream will accept the fix. IMO it's nothing against nothing.

I will propose the fix of the former to the upstream and let's see.

Thanks.

Comment 8 RHEL Program Management 2020-12-15 07:39:47 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.