Re: [PATCH 1/3] CLI: add talloc leak report, controlled by an environment variable.
authorTomi Ollila <tomi.ollila@iki.fi>
Thu, 20 Dec 2012 15:40:05 +0000 (17:40 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:52:33 +0000 (09:52 -0800)
46/8e19b5b580edd9ba981d8e0d40b40c78648b38 [new file with mode: 0644]

diff --git a/46/8e19b5b580edd9ba981d8e0d40b40c78648b38 b/46/8e19b5b580edd9ba981d8e0d40b40c78648b38
new file mode 100644 (file)
index 0000000..28ae453
--- /dev/null
@@ -0,0 +1,107 @@
+Return-Path: <tomi.ollila@iki.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 9FBED431FB6\r
+       for <notmuch@notmuchmail.org>; Thu, 20 Dec 2012 07:40:16 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id l2r++ll-zbFq for <notmuch@notmuchmail.org>;\r
+       Thu, 20 Dec 2012 07:40:13 -0800 (PST)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id 0ECEC431FAE\r
+       for <notmuch@notmuchmail.org>; Thu, 20 Dec 2012 07:40:13 -0800 (PST)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+       by guru.guru-group.fi (Postfix) with ESMTP id 268AE100094;\r
+       Thu, 20 Dec 2012 17:40:06 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: david@tethera.net, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 1/3] CLI: add talloc leak report,\r
+       controlled by an environment variable.\r
+In-Reply-To: <1355714648-23144-2-git-send-email-david@tethera.net>\r
+References: <1355714648-23144-1-git-send-email-david@tethera.net>\r
+       <1355714648-23144-2-git-send-email-david@tethera.net>\r
+User-Agent: Notmuch/0.14+211~g71b47e9 (http://notmuchmail.org) Emacs/24.2.1\r
+       (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+       $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+       !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Thu, 20 Dec 2012 17:40:05 +0200\r
+Message-ID: <m2hangivfu.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+Cc: David Bremner <bremner@debian.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 20 Dec 2012 15:40:16 -0000\r
+\r
+On Mon, Dec 17 2012, david@tethera.net wrote:\r
+\r
+> From: David Bremner <bremner@debian.org>\r
+>\r
+> The argument handling in notmuch.c seems due for an overhaul, but\r
+> until then use an environment variable to specify a location to write\r
+> the talloc leak report to.  This is only enabled for the (interesting)\r
+> case where some notmuch subcommand is invoked.\r
+> ---\r
+\r
+I'd still suggest to have similar command-line interface option(s) as\r
+samba4 use: --leak-report and/or --leak-report-full\r
+\r
+(search --leak-r in talloc(3) namual page)\r
+\r
+Tomi\r
+\r
+>  notmuch.c |   16 ++++++++++++++--\r
+>  1 file changed, 14 insertions(+), 2 deletions(-)\r
+>\r
+> diff --git a/notmuch.c b/notmuch.c\r
+> index 9516dfb..fb49c5a 100644\r
+> --- a/notmuch.c\r
+> +++ b/notmuch.c\r
+> @@ -322,8 +322,20 @@ main (int argc, char *argv[])\r
+>      for (i = 0; i < ARRAY_SIZE (commands); i++) {\r
+>      command = &commands[i];\r
+>  \r
+> -    if (strcmp (argv[1], command->name) == 0)\r
+> -        return (command->function) (local, argc - 1, &argv[1]);\r
+> +    if (strcmp (argv[1], command->name) == 0) {\r
+> +        int ret;\r
+> +        char *talloc_report;\r
+> +\r
+> +        ret = (command->function) (local, argc - 1, &argv[1]);\r
+> +\r
+> +        talloc_report=getenv ("NOTMUCH_TALLOC_REPORT");\r
+> +        if (talloc_report && strcmp(talloc_report, "") != 0) {\r
+> +            FILE *report = fopen (talloc_report, "w");\r
+> +            talloc_report_full (NULL, report);\r
+> +        }\r
+> +\r
+> +        return ret;\r
+> +    }\r
+>      }\r
+>  \r
+>      fprintf (stderr, "Error: Unknown command '%s' (see \"notmuch help\")\n",\r
+> -- \r
+> 1.7.10.4\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r