1 Return-Path: <amdragon@mit.edu>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id DFE49431FAF
\r
6 for <notmuch@notmuchmail.org>; Thu, 20 Dec 2012 17:55:28 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id OHkPP91heIW7 for <notmuch@notmuchmail.org>;
\r
16 Thu, 20 Dec 2012 17:55:28 -0800 (PST)
\r
17 Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id 3D156431FAE
\r
20 for <notmuch@notmuchmail.org>; Thu, 20 Dec 2012 17:55:28 -0800 (PST)
\r
21 X-AuditID: 12074424-b7f4e6d0000004ca-25-50d3c18f2b25
\r
22 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])
\r
23 by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id 35.54.01226.F81C3D05; Thu, 20 Dec 2012 20:55:27 -0500 (EST)
\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])
\r
26 by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id qBL1tQ4r028751;
\r
27 Thu, 20 Dec 2012 20:55:26 -0500
\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])
\r
29 (authenticated bits=0)
\r
30 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
31 by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id qBL1tNhH002730
\r
32 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);
\r
33 Thu, 20 Dec 2012 20:55:25 -0500 (EST)
\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)
\r
35 (envelope-from <amdragon@mit.edu>)
\r
36 id 1Tlrpb-0007Hb-9x; Thu, 20 Dec 2012 20:55:23 -0500
\r
37 Date: Thu, 20 Dec 2012 20:55:23 -0500
\r
38 From: Austin Clements <amdragon@MIT.EDU>
\r
39 To: david@tethera.net
\r
40 Subject: Re: [PATCH 1/3] CLI: add talloc leak report, controlled by an
\r
41 environment variable.
\r
42 Message-ID: <20121221015523.GQ6187@mit.edu>
\r
43 References: <1355714648-23144-1-git-send-email-david@tethera.net>
\r
44 <1355714648-23144-2-git-send-email-david@tethera.net>
\r
46 Content-Type: text/plain; charset=us-ascii
\r
47 Content-Disposition: inline
\r
48 In-Reply-To: <1355714648-23144-2-git-send-email-david@tethera.net>
\r
49 User-Agent: Mutt/1.5.21 (2010-09-15)
\r
50 X-Brightmail-Tracker:
\r
51 H4sIAAAAAAAAA+NgFuphleLIzCtJLcpLzFFi42IR4hRV1u0/eDnA4MNUKYuNy34yW9xo7Wa0
\r
52 uH5zJrMDs8evtrnMHs9W3WL22HLoPXMAcxSXTUpqTmZZapG+XQJXxsuZCQWveCuOnrzC1sB4
\r
53 nauLkZNDQsBE4m/3VGYIW0ziwr31bF2MXBxCAvsYJZZ/uMYE4WxglFi/4j07hHORSeJWQzsr
\r
54 SIuQwBJGiUf7U0BsFgFViROr2tlBbDYBDYlt+5czgtgiAqISpzdNAqtnFrCXWDR7EliNsECc
\r
55 xL9lb8BqeAW0Jfb+fs8OMbNS4viF6awQcUGJkzOfsED0aknc+PcS6CIOIFtaYvk/DpAwp4CT
\r
56 xKG789hAbFEBFYkpJ7exTWAUmoWkexaS7lkI3QsYmVcxyqbkVunmJmbmFKcm6xYnJ+blpRbp
\r
57 muvlZpbopaaUbmIEBTq7i8oOxuZDSocYBTgYlXh4IywuBwixJpYVV+YeYpTkYFIS5dXbDxTi
\r
58 S8pPqcxILM6ILyrNSS0+xCjBwawkwvt8CVCONyWxsiq1KB8mJc3BoiTOez3lpr+QQHpiSWp2
\r
59 ampBahFMVoaDQ0mCt+0AUKNgUWp6akVaZk4JQpqJgxNkOA/Q8G0gNbzFBYm5xZnpEPlTjIpS
\r
60 4rzf9wElBEASGaV5cL2wRPSKURzoFWHefSDtPMAkBtf9CmgwE9DgIL0LIINLEhFSUg2MYfwT
\r
61 REsmxq7VMthS9jFna3X61AwGkcxJXzzjPZ5yf/AxOnaKU3P7V0/2hY/jvE8e0Vw2UeNj4PrP
\r
62 HK6JMnqiFtmts35du/CmxURDvPoQr9XTMxPmS93cJL1WdrLz8tcJYU8nWsgIbju2W2t1R+a6
\r
63 4w99m8Pe6PW79ty6ce7I1R8TTMvd5W8uUGIpzkg01GIuKk4EAPun4JYfAwAA
\r
64 Cc: notmuch@notmuchmail.org, David Bremner <bremner@debian.org>
\r
65 X-BeenThere: notmuch@notmuchmail.org
\r
66 X-Mailman-Version: 2.1.13
\r
68 List-Id: "Use and development of the notmuch mail system."
\r
69 <notmuch.notmuchmail.org>
\r
70 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
71 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
72 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
73 List-Post: <mailto:notmuch@notmuchmail.org>
\r
74 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
75 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
76 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
77 X-List-Received-Date: Fri, 21 Dec 2012 01:55:29 -0000
\r
79 Quoth david@tethera.net on Dec 16 at 11:24 pm:
\r
80 > From: David Bremner <bremner@debian.org>
\r
82 > The argument handling in notmuch.c seems due for an overhaul, but
\r
83 > until then use an environment variable to specify a location to write
\r
84 > the talloc leak report to. This is only enabled for the (interesting)
\r
85 > case where some notmuch subcommand is invoked.
\r
87 > notmuch.c | 16 ++++++++++++++--
\r
88 > 1 file changed, 14 insertions(+), 2 deletions(-)
\r
90 > diff --git a/notmuch.c b/notmuch.c
\r
91 > index 9516dfb..fb49c5a 100644
\r
94 > @@ -322,8 +322,20 @@ main (int argc, char *argv[])
\r
95 > for (i = 0; i < ARRAY_SIZE (commands); i++) {
\r
96 > command = &commands[i];
\r
98 > - if (strcmp (argv[1], command->name) == 0)
\r
99 > - return (command->function) (local, argc - 1, &argv[1]);
\r
100 > + if (strcmp (argv[1], command->name) == 0) {
\r
102 > + char *talloc_report;
\r
104 > + ret = (command->function) (local, argc - 1, &argv[1]);
\r
106 > + talloc_report=getenv ("NOTMUCH_TALLOC_REPORT");
\r
108 Missing spaces around =.
\r
110 I think hacking this in as an environment variable is fine, but maybe
\r
111 there should be a comment here saying that it would be better to
\r
112 follow Samba's talloc command-line argument conventions?
\r
114 > + if (talloc_report && strcmp(talloc_report, "") != 0) {
\r
116 Missing space before paren.
\r
118 > + FILE *report = fopen (talloc_report, "w");
\r
119 > + talloc_report_full (NULL, report);
\r
121 Maybe I'm missing something here, but don't you have to call
\r
122 talloc_enable_leak_report_full before the first use of talloc to get a
\r
123 complete leak report?
\r
131 > fprintf (stderr, "Error: Unknown command '%s' (see \"notmuch help\")\n",
\r