DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: dev <dev@dpdk.org>, "Morten Brørup" <mb@smartsharesystems.com>,
	"Bruce Richardson" <bruce.richardson@intel.com>
Subject: Re: [PATCH v4] rte_dump_stack: make in async signal safe
Date: Thu, 23 Jun 2022 09:51:04 +0200	[thread overview]
Message-ID: <CAJFAV8zehW-jQ2EqaVk8w5EWAQg=UeBmWKSHvexwS1aZN6pv3A@mail.gmail.com> (raw)
In-Reply-To: <20220414201940.266711-1-stephen@networkplumber.org>

On Thu, Apr 14, 2022 at 10:19 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> rte_dump_stack() needs to be usable in situations when a bug is
> encountered and from signal handlers (such as SEGV).
>
> Glibc backtrace_symbols() calls malloc which makes it
> dangerous in a signal handler that is handling errors that maybe
> due to memory corruption. Additionally, rte_log() is unsafe because
> syslog() is not signal safe; printf() is also documented as
> not being safe.
>
> This version formats message and uses writev for each line in a manner
> similar to what glibc version of backtrace_symbols_fd() does. The
> FreeBSD version of backtrace_symbols_fd() is not signal safe.
>
> Sample output:
>
> 0: ./build/app/dpdk-testpmd (rte_dump_stack+0x2b) [560a6e9c002b]
> 1: ./build/app/dpdk-testpmd (main+0xad) [560a6decd5ad]
> 2: /lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main+0xcd) [7fd43d3e27fd]
> 3: ./build/app/dpdk-testpmd (_start+0x2a) [560a6e83628a]
>
> Bugzilla ID: 929
> Acked-by: Morten Brørup <mb@smartsharesystems.com>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: David Marchand <david.marchand@redhat.com>

Applied, thanks.


-- 
David Marchand


      reply	other threads:[~2022-06-23  7:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-29  1:10 [RFC] eal_debug: do not use malloc in rte_dump_stack Stephen Hemminger
2022-01-29  8:25 ` Morten Brørup
2022-02-12 18:44 ` [PATCH v2 0/2] rte_dump_stack: improvements Stephen Hemminger
2022-02-12 18:44   ` [PATCH v2 1/2] eal_debug: do not use malloc in rte_dump_stack Stephen Hemminger
2022-02-13 11:41     ` Thomas Monjalon
2022-03-17 23:13       ` Stephen Hemminger
2022-02-12 18:44   ` [PATCH v2 2/2] eal: common rte_dump_stack for both Linux and FreeBSD Stephen Hemminger
2022-02-14 11:10   ` [PATCH v2 0/2] rte_dump_stack: improvements Morten Brørup
2022-02-14 11:51     ` Bruce Richardson
2022-04-07 12:45   ` David Marchand
2022-04-07 23:06     ` Stephen Hemminger
2022-04-14 19:41 ` [PATCH v3] rte_dump_stack: make in async signal safe Stephen Hemminger
2022-04-14 20:19 ` [PATCH v4] " Stephen Hemminger
2022-06-23  7:51   ` David Marchand [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='CAJFAV8zehW-jQ2EqaVk8w5EWAQg=UeBmWKSHvexwS1aZN6pv3A@mail.gmail.com' \
    --to=david.marchand@redhat.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=mb@smartsharesystems.com \
    --cc=stephen@networkplumber.org \
    /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).