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

 
 

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

Submitted by:  Petr Machata <ant_39>
Submitted on:  Tue 16 Sep 2008 03:59:30 PM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: FixedPrivacy: Public
Assigned to: Paul D. Smith <psmith>Open/Closed: Closed
Component Version: 3.81Operating System: POSIX-Based
Fixed Release: 3.82Triage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project AdministratorIn charge of this item.
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 File(s):
   
   
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
  • -unavailable- added by psmith (Posted a comment)
  • -unavailable- added by ant_39 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 28 Jul 2010 06:17:08 AM UTCpsmithFixed Release4.0=>3.82
    Tue 02 Jun 2009 04:17:05 AM UTCpsmithStatusNone=>Fixed
      Assigned toNone=>psmith
      Open/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.0
    Tue 16 Sep 2008 03:59:30 PM UTCant_39Attached File-=>Added make-fdleak.patch, #16508

    Back to the top


    Powered by Savane 3.1-cleanup1