Bug 1731117

Summary: podman exec leaks an exec_pid_<hash> file for every exec in tmpfs
Product: Red Hat Enterprise Linux 8 Reporter: Michele Baldessari <michele>
Component: podmanAssignee: Matthew Heon <mheon>
Status: CLOSED ERRATA QA Contact: atomic-bugs <atomic-bugs>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 8.0CC: aarcange, ajia, bdobreli, dornelas, dwalsh, emacchi, jligon, jnovy, lichenn, lsm5, mheon, smccarty, toneata, ypu
Target Milestone: rcKeywords: ZStream
Target Release: 8.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: podman-1.4.2-2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1731268 1731270 (view as bug list) Environment:
Last Closed: 2019-11-05 21:02: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: 1186913, 1727325, 1731268, 1731270, 1734574    
Attachments:
Description Flags
fix for podman exec memleak none

Description Michele Baldessari 2019-07-18 10:53:20 UTC
Description of problem:
This is the cousin of https://bugzilla.redhat.com/show_bug.cgi?id=1730281

In short for every podman exec we create a file in tmpfs which will then occupy slab then can never be fred:
[root@rhel8newkernelnoselinux rhel8podmanexec]# podman exec flamboyant_roentgen /bin/true
[root@rhel8newkernelnoselinux rhel8podmanexec]# podman exec flamboyant_roentgen /bin/true
[root@rhel8newkernelnoselinux rhel8podmanexec]# podman exec flamboyant_roentgen /bin/true
[root@rhel8newkernelnoselinux rhel8podmanexec]# find /run/containers/storage -type f -iname 'exec_pid_*'
/run/containers/storage/overlay-containers/b6ad46a7e946e4dce574b4c638632bab14ecad91f6d97b30f7503a51763308c8/userdata/exec_pid_c0a6cc05cdca622169d43f9becaf9ebd7ef912c567a5afb7b65902e6c1977c9c
/run/containers/storage/overlay-containers/b6ad46a7e946e4dce574b4c638632bab14ecad91f6d97b30f7503a51763308c8/userdata/exec_pid_e306a2dd784a663e04ad850247bd4b7fe8f91d074458d785619ebc62de345c7f
/run/containers/storage/overlay-containers/b6ad46a7e946e4dce574b4c638632bab14ecad91f6d97b30f7503a51763308c8/userdata/exec_pid_1b3a8510bcda74f39131e01998a75394aaa2200231fc066397e945de8db1b8da

This likely represents the largest chunk of the leak as observed in https://bugzilla.redhat.com/show_bug.cgi?id=1699202

Seen this with podman podman-1.0.2-1.git4426985.module+el8.0.0.z+3525+56c076c3.x86_64 but also with podman 1.4.5-dev with the staticdir return code for the podman create tmpfs leak.

Comment 1 Andrea Arcangeli 2019-07-18 11:19:44 UTC
Created attachment 1591744 [details]
fix for podman exec memleak

Comment 14 Alex Jia 2019-09-27 12:33:44 UTC
I can reproduce this issue in podman-1.0.2-1.git4426985.module+el8.0.0.z+3525+56c076c3.x86_64,
and verified in podman-1.4.2-5.module+el8.1.0+4240+893c1ab8.x86_64.

[root@kvm-06-guest17 ~]# rpm -q podman 
podman-1.0.2-1.git4426985.module+el8.0.0.z+3525+56c076c3.x86_64

[root@kvm-06-guest17 ~]# podman exec youthful_wilson /bin/true
[root@kvm-06-guest17 ~]# podman exec youthful_wilson /bin/true
[root@kvm-06-guest17 ~]# podman exec youthful_wilson /bin/true
[root@kvm-06-guest17 ~]# find /run/containers/storage -type f -iname 'exec_pid_*'
/run/containers/storage/overlay-containers/2765a2e6a96075a6339ba47faf1b5bda76306e33d318b5304e7fa747165132da/userdata/exec_pid_f42eae430ab74ece31888abb0019db85a90ae5b822ab8aa2bc5f59095002c84d
/run/containers/storage/overlay-containers/2765a2e6a96075a6339ba47faf1b5bda76306e33d318b5304e7fa747165132da/userdata/exec_pid_82967412a5d4ac07e49cd160f6dba1bd372d998c67246893addff4b67361f77d
/run/containers/storage/overlay-containers/2765a2e6a96075a6339ba47faf1b5bda76306e33d318b5304e7fa747165132da/userdata/exec_pid_e3970a4f8732fc5405f68454625a2a6bf8aab5acc919ff35bba1f8b7c9294293

[root@kvm-06-guest17 ~]# rpm -q podman
podman-1.4.2-5.module+el8.1.0+4240+893c1ab8.x86_64

[root@kvm-06-guest17 ~]# find /run/containers/storage -type f -iname 'exec_pid_*'
[root@kvm-06-guest17 ~]# podman exec angry_nash /bin/true
[root@kvm-06-guest17 ~]# podman exec angry_nash /bin/true
[root@kvm-06-guest17 ~]# podman exec angry_nash /bin/true
[root@kvm-06-guest17 ~]# find /run/containers/storage -type f -iname 'exec_pid_*'
[root@kvm-06-guest17 ~]#

Comment 15 lichenn 2019-10-11 13:01:35 UTC
Hi guys I also found some issue about podman socket crash with version podman-1.0.2-1.git4426985.module+el8.0.0.z+3525+56c076c3.x86_64 in OCP4.1 coreOS node

How could I get the latest version of podman pacakge podman-1.4.2-5.module+el8.1.0+4240+893c1ab8.x86_64 to verify the issue?

Comment 17 errata-xmlrpc 2019-11-05 21:02:47 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:3403