From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110761 invoked by alias); 29 Sep 2018 03:09:17 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 110750 invoked by uid 89); 29 Sep 2018 03:09:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=importing, fork, Hx-languages-length:486 X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 29 Sep 2018 03:09:15 +0000 Received: from [10.0.0.136] (modemcable044.137-81-70.mc.videotron.ca [70.81.137.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 0D44A1E186; Fri, 28 Sep 2018 23:09:13 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=simark.ca; s=mail; t=1538190553; bh=yrQMJNcyU0Eotxz6+473FlMclhnYvZQc6SiGeulDOnE=; h=Subject:To:References:From:Date:In-Reply-To:From; b=Er7MgopVPRsP6kxCvu16ne2VLcTlOa/MHVESfKQaUanKj9escxeqMQrN0sCMSnEjy h/yv2jCVR3yXOIxAqQMXzy7wm1Fl6chGCAKxCOMjIJXGxMNVzjU80wgCsekPxhsPRC /zeQ1pzgu14S2VPj2SJxi6RWh2jqDoOBDORen2qA= Subject: Re: [RFC 4/6] Use mkostemp, not mkstemp To: Tom Tromey , gdb-patches@sourceware.org References: <20180926111130.18956-1-tom@tromey.com> <20180926111130.18956-5-tom@tromey.com> From: Simon Marchi Message-ID: <2b6097b6-5ffd-6531-4e58-06e1ca62b3d8@simark.ca> Date: Sat, 29 Sep 2018 03:09:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20180926111130.18956-5-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-09/txt/msg00927.txt.bz2 On 2018-09-26 7:11 a.m., Tom Tromey wrote: > I noticed that gdb could leak file descriptors coming from mkstemp. > This patch fixes the problem by importing the gnulib mkostemp instead, > and then changing gdb to pass O_CLOEXEC. While this looks like the correct thing to do, I am curious to know if you encountered an actual issue or this is theoretical. I don't see how a fork/exec could happen while one of these temp files are open. Simon