DPDK patches and discussions
 help / color / mirror / Atom feed
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 09:00:56 -0800	[thread overview]
Message-ID: <20241129090056.6ba07d39@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:

> Fix the following crash when closing a log file after rte_eal_cleanup():
> 
>     double free or corruption (!prev)
> 
>     Thread 1 "grout" received signal SIGABRT, Aborted.
>     __pthread_kill_implementation (threadid=<optimized out>,
>     signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
>     ...
>     #10 _IO_new_fclose (fp=0xb63090) at iofclose.c:74
>     #11 0x000000000049c04e in dpdk_fini () at ../main/dpdk.c:204
>     #12 0x0000000000402ab8 in main (...) at ../main/main.c:217
>     (gdb) up 11
>     #11 0x000000000049c04e in dpdk_fini () at ../main/dpdk.c:204
>     202             rte_eal_cleanup();
>     203             if (log_stream != NULL)
>     204                     fclose(log_stream);
> 
> When the application has passed a custom file via rte_openlog_stream()
> DPDK should not call fclose() on it.
> 
> Add an internal is_internal_file field to track whether the file has
> been allocated by DPDK (syslog or journald) to determine if it should be
> closed or not.
> 
> Fixes: 985130369be3 ("log: rework syslog handling")
> Signed-off-by: Robin Jarry <rjarry@redhat.com>

Looks good, will look into adding more test cases for this in later release.

Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>

      parent reply	other threads:[~2024-11-29 17:01 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
2024-11-29 17:00 ` Stephen Hemminger [this message]

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=20241129090056.6ba07d39@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).