netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [nft PATCH 0/4] cli: Make valgrind (kind of) happy
Date: Tue, 4 Jul 2023 13:04:38 +0200	[thread overview]
Message-ID: <ZKP8xo8S1eyd9QrE@orbyte.nwl.cc> (raw)
In-Reply-To: <20230622154634.25862-1-phil@nwl.cc>

On Thu, Jun 22, 2023 at 05:46:30PM +0200, Phil Sutter wrote:
> The following series is more or less a v2 of my previous single patch
> adding nft_ctx_free() calls to cli.c, following a different path:
> Eliminate any program exit points from cli.c so nft context deinit at
> end of main() happens. This is nicer design as said function allocates
> the context in the first place.
> 
> Patch 1 is minor cleanup, patch 2 updates main() to free the context in
> all cases, too and patch 3 then changes CLI code as described above.
> Patch 4 extends shell testsuite by a '-V' (valgrind) mode as present in
> iptables' shell testsuite already which wraps all calls to $NFT by
> valgrind and collects non-empty logs.
> 
> Sadly, I could not eliminate all valgrind complaints because each of the
> three CLI backends leaves allocated memory in place at exit. None seem
> to have sufficient deinit functions, except linenoise - but that code
> runs only for terminals put in raw mode.
> 
> Phil Sutter (4):
>   main: Make 'buf' variable branch-local
>   main: Call nft_ctx_free() before exiting
>   cli: Make cli_init() return to caller
>   tests: shell: Introduce valgrind mode

Series applied.

      parent reply	other threads:[~2023-07-04 11:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-22 15:46 [nft PATCH 0/4] cli: Make valgrind (kind of) happy Phil Sutter
2023-06-22 15:46 ` [nft PATCH 1/4] main: Make 'buf' variable branch-local Phil Sutter
2023-06-22 15:46 ` [nft PATCH 2/4] main: Call nft_ctx_free() before exiting Phil Sutter
2023-06-22 15:46 ` [nft PATCH 3/4] cli: Make cli_init() return to caller Phil Sutter
2023-06-22 15:46 ` [nft PATCH 4/4] tests: shell: Introduce valgrind mode Phil Sutter
2023-07-04 11:04 ` Phil Sutter [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=ZKP8xo8S1eyd9QrE@orbyte.nwl.cc \
    --to=phil@nwl.cc \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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).