bugmake - Bugs: bug #24277, make leaks FDs through $(shell)

 
 

bug #24277: make leaks FDs through $(shell)

Submitter:  Petr Machata <ant_39>
Submitted:  Tue 16 Sep 2008 03:59:30 PM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  3.81 Operating System:  POSIX-Based
Fixed Release:  3.82 Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 02 Jun 2009 04:17:05 AM UTC, comment #2: 

Thanks for the report.  I ended up fixing this slightly differently, by adding a test for fileno() into configure.in and running CLOSE_ON_EXEC() on fileno() of the FILE*.  Checking /proc/self/fd in a $(shell ...) confirms this works.

Paul D. Smith <psmith>
Group administrator
Tue 16 Sep 2008 04:37:03 PM UTC, comment #1: 

(The patch is against today's CVS, even though the component version is filed as 3.81.)

Petr Machata <ant_39>
Tue 16 Sep 2008 03:59:30 PM UTC, original submission:  

$ cat mk
X := $(shell ./x.py)
all:; echo "$(X)"

$ cat x.py
#!/usr/bin/env python
import os

$ make -f mk

  1. lr-x------ 1 petr petr 64 2008-09-16 17:36 3 -> /home/petr/packages-fedora/make/devel/make-test-fd-leak/mk
  2. lr-x------ 1 petr petr 64 2008-09-16 17:36 6 -> /home/petr/GNUstep/Defaults

echo ""

The second file is probably WindowMaker bug, the first is the file fopened in eval_makefile (read.c).

Petr Machata <ant_39>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #16508:  make-fdleak.patch added by ant_39 (1KiB - application/octet-stream - Fix above problem by opening the fila via open/fdopen/CLOSE_ON_EXEC combo (if fdopen is available).)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by ant_39 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-07-28 psmith Fixed Release4.0 3.82
    2009-06-02 psmith StatusNone Fixed
        Assigned toNone psmith
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.0
    2008-09-16 ant_39 Attached File- Added make-fdleak.patch, #16508

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code