From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 33966 invoked by alias); 29 Sep 2018 12:49:34 -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 33950 invoked by uid 89); 29 Sep 2018 12:49:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=observe X-HELO: gateway33.websitewelcome.com Received: from gateway33.websitewelcome.com (HELO gateway33.websitewelcome.com) (192.185.146.130) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 29 Sep 2018 12:49:31 +0000 Received: from cm15.websitewelcome.com (cm15.websitewelcome.com [100.42.49.9]) by gateway33.websitewelcome.com (Postfix) with ESMTP id 0342E247348E for ; Sat, 29 Sep 2018 07:49:29 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 6EgBgDYGa8YaU6EgNgh8C4; Sat, 29 Sep 2018 07:49:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=biJGImVLx6Qkl06I5hq4k/5gmhOU11vUoki3A3y0kyc=; b=Vy6AWiHZHvfPKQCHZoMH0Bxixz XJzz97sFhtEUunMgd4OjUNbLMkQISmYO1G6iDCQgcCJlCV8qKRE3u0FWjupVDjglr3nphmHucAof2 4qFjbNBHHvBExbgvxpQhsR6QB; Received: from 97-122-190-66.hlrn.qwest.net ([97.122.190.66]:54648 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1g6EgB-003qI3-G6; Sat, 29 Sep 2018 07:49:03 -0500 From: Tom Tromey To: Simon Marchi Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [RFC 4/6] Use mkostemp, not mkstemp References: <20180926111130.18956-1-tom@tromey.com> <20180926111130.18956-5-tom@tromey.com> <2b6097b6-5ffd-6531-4e58-06e1ca62b3d8@simark.ca> Date: Sat, 29 Sep 2018 12:49:00 -0000 In-Reply-To: <2b6097b6-5ffd-6531-4e58-06e1ca62b3d8@simark.ca> (Simon Marchi's message of "Fri, 28 Sep 2018 23:09:06 -0400") Message-ID: <87a7o0ii4h.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2018-09/txt/msg00931.txt.bz2 >>>>> "Simon" == Simon Marchi writes: Simon> 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. Simon> While this looks like the correct thing to do, I am curious to know if Simon> you encountered an actual issue or this is theoretical. I don't see Simon> how a fork/exec could happen while one of these temp files are open. It can happen if there is a Python or Guile thread that fork+execs. It seems like it would be hard to observe, but on the other hand, fixing it seems pretty easy. Tom