From: Stephen Hemminger <stephen@networkplumber.org>
To: Robin Jarry <rjarry@redhat.com>
Cc: dev@dpdk.org, "Bruce Richardson" <bruce.richardson@intel.com>,
"Morten Brørup" <mb@smartsharesystems.com>,
"Chengwen Feng" <fengchengwen@huawei.com>
Subject: Re: [PATCH dpdk] log: fix double free on cleanup
Date: Fri, 29 Nov 2024 08:54:50 -0800 [thread overview]
Message-ID: <20241129085450.57473230@hermes.local> (raw)
In-Reply-To: <20241129161013.704859-2-rjarry@redhat.com>
On Fri, 29 Nov 2024 17:10:14 +0100
Robin Jarry <rjarry@redhat.com> 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.
next prev parent reply other threads:[~2024-11-29 16:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-29 16:10 Robin Jarry
2024-11-29 16:54 ` Stephen Hemminger [this message]
2024-11-29 17:00 ` Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241129085450.57473230@hermes.local \
--to=stephen@networkplumber.org \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=fengchengwen@huawei.com \
--cc=mb@smartsharesystems.com \
--cc=rjarry@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).