From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 81CFE45DCE; Fri, 29 Nov 2024 17:54:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 17043402AE; Fri, 29 Nov 2024 17:54:59 +0100 (CET) Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by mails.dpdk.org (Postfix) with ESMTP id 02CCC4014F for ; Fri, 29 Nov 2024 17:54:57 +0100 (CET) Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-2124ccf03edso20211935ad.2 for ; Fri, 29 Nov 2024 08:54:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1732899297; x=1733504097; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=xyBkN+23dbe0WZKvZvyur2reyrOTHR57y8+yNzxsrtc=; b=2CmIPoX7xWGaEuG1ua1cEWm0CN043bItIvbGZiB1dRfEFgpRHA3VjPu88TggKkTJyu x8pj5anNwqYsJRXg0cbEeqhikdgTEeMkzRO1JMrS6XlxDGmx1KG7fLGSZ1SOLdIoU1e7 el1SdqaGyblccHsrvasZHpNFrOIZ7oSY5/+2cmAShJ+XYOHW0bCQmaaRm37xaY+q6Gwg UeLk/qZbzNLuRts1io2h0qu5nAGjdLiRFa+qoBPAgkykU1o4/hLRagtSrWqrK6P2jNKE /dbSRx/rWybdRzdDKQMfTQHxsQ2iXAw5As9TP1d6NiE/oLAJ2gIoZ8jtg3k7tfgxSc2P o/sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732899297; x=1733504097; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xyBkN+23dbe0WZKvZvyur2reyrOTHR57y8+yNzxsrtc=; b=gy5A4ZteF/Mp1+sUdUvLsSQTTHWlr2yDZFhm1z7ZfIJ/+BxzOwd9CqPpsW/SkRqzc8 jnrkyZIQFeJ8sHd/SdLOl0PsUiOjbwo6XBB9XEbaI8P5evchzAL8V7iZZ7O9+zS1IC8J bRfW7erNH7j5G16jhYm3kOmp/Z3xDg0yOdQobvTGLiK0xiB9JtjuQ4ZgR75o/D4C4z0g 3d/wicsJuczh3/GAmeN1023H2gsfyos+LZtq421FonNej9p6F1FVQs0WlNuuJN8WASYu KG0nsHWnof+86LmVjh4iesRPyz/E1oPew7DDiuNXODn0c5QN2HNaFgTBniJha3r/LXAH sStw== X-Gm-Message-State: AOJu0Yw1BA2oHAWx7KyacYzIasHcoa0oqDgYubL15NoHmX358Ag6kuIY QBKP/HSekA2a1Vf1c5NtPzznNjRFdyi+ZbPq3GNzoGK4XJUR2zbXTMNj1MQJ/pI= X-Gm-Gg: ASbGncsFVx2Jjr/Dn/OigeJbPqSJ/74S8KU+ivN6aQa+C/UCy9HhXYg9MlP+qdoz7Sq rkpse8oA4e/p4CivBMsKMniBdQ14B3SZ99BBxOca7eQ3jVGg/O+76aaPE/817XXpFR4O08jDqJL 4y7WHRfGNvNXqZ7gkrgzT7qJsjdTqNFWnTdVveHlMv5dRKnTkco6Hjwtnv+Qa7mYIa9j2b3CGYn 4dAOVlKkO6HZoLegrZ8zIs/yYsDk/3YCPAkFtdX3xqi1OfrAckcKUB1wb9hxLHHXdNHhWj4np8T 4mgF5h9ZCOrKWElbwH0xzV/P4W4= X-Google-Smtp-Source: AGHT+IGMoueXX6fpCWGyy5j0ezVcXDCKHy2fIcP/co32I2F08qvjwYB/Z+WahkgppF66w6QjnFxkDg== X-Received: by 2002:a17:902:cf07:b0:20c:5909:cc48 with SMTP id d9443c01a7336-21501b63d18mr168914205ad.40.1732899296800; Fri, 29 Nov 2024 08:54:56 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21521985364sm32193695ad.204.2024.11.29.08.54.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2024 08:54:56 -0800 (PST) Date: Fri, 29 Nov 2024 08:54:50 -0800 From: Stephen Hemminger To: Robin Jarry Cc: dev@dpdk.org, Bruce Richardson , Morten =?UTF-8?B?QnLDuHJ1cA==?= , Chengwen Feng Subject: Re: [PATCH dpdk] log: fix double free on cleanup Message-ID: <20241129085450.57473230@hermes.local> In-Reply-To: <20241129161013.704859-2-rjarry@redhat.com> References: <20241129161013.704859-2-rjarry@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Fri, 29 Nov 2024 17:10:14 +0100 Robin Jarry wrote: > @@ -550,11 +555,8 @@ eal_log_init(const char *id) > void > rte_eal_log_cleanup(void) > { > - FILE *log_stream = rte_logs.file; > - > - /* don't close stderr on the application */ > - if (log_stream != NULL) > - fclose(log_stream); > - > + if (rte_logs.is_internal_file && rte_logs.file != NULL) > + fclose(rte_logs.file); > rte_logs.file = NULL; > + rte_logs.is_internal_file = false; > } The internal flag is ok, but we still don't want to close stderr in cleanup. Only places where syslog or journal wrapper is used.