bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bash leaks heredoc fd to child processes


From: Siteshwar Vashisht
Subject: Bash leaks heredoc fd to child processes
Date: Tue, 17 Jan 2017 08:24:02 -0500 (EST)

Hello,

Bash leaks heredoc fd to child processes if heredoc string contains command 
substitution.

Reproducer code :

$ cat test.sh 
#!/bin/bash

cat <<EOF

`pvs`

EOF

$ ./test.sh 
File descriptor 3 (/tmp/sh-thd.Gnua0J) leaked on pvs invocation. Parent PID 
9590: /bin/bash

  PV         VG     Fmt  Attr PSize  PFree
  /dev/sda2  fedora lvm2 a--  11.00g    0 


Attached patch fixes this leak.

-- 
--
Siteshwar Vashisht

Attachment: 0001-Do-not-leak-heredoc-fd-to-child-processes.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]