Re: Concerns regarding some library functions
authorAustin Clements <amdragon@MIT.EDU>
Thu, 29 Sep 2011 14:51:29 +0000 (10:51 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:39:30 +0000 (09:39 -0800)
e9/a3fa00bad4e7ddf6c8f46006770d44805cf32d [new file with mode: 0644]

diff --git a/e9/a3fa00bad4e7ddf6c8f46006770d44805cf32d b/e9/a3fa00bad4e7ddf6c8f46006770d44805cf32d
new file mode 100644 (file)
index 0000000..2466769
--- /dev/null
@@ -0,0 +1,112 @@
+Return-Path: <amdragon@mit.edu>\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 266C4431FD0\r
+       for <notmuch@notmuchmail.org>; Thu, 29 Sep 2011 07:49:10 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 3BHd+NCIC4h7 for <notmuch@notmuchmail.org>;\r
+       Thu, 29 Sep 2011 07:49:09 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-8.mit.edu (DMZ-MAILSEC-SCANNER-8.MIT.EDU\r
+       [18.7.68.37])\r
+       by olra.theworths.org (Postfix) with ESMTP id 984F6431FB6\r
+       for <notmuch@notmuchmail.org>; Thu, 29 Sep 2011 07:49:09 -0700 (PDT)\r
+X-AuditID: 12074425-b7f116d0000008fe-c2-4e848564eca6\r
+Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
+       by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 42.CF.02302.465848E4; Thu, 29 Sep 2011 10:49:09 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id p8TEn88i010557; \r
+       Thu, 29 Sep 2011 10:49:08 -0400\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+       (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id p8TEn6E5016066\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Thu, 29 Sep 2011 10:49:07 -0400 (EDT)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.72)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1R9HxR-0006p7-Ti; Thu, 29 Sep 2011 10:51:29 -0400\r
+Date: Thu, 29 Sep 2011 10:51:29 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Ali Polatel <polatel@gmail.com>\r
+Subject: Re: Concerns regarding some library functions\r
+Message-ID: <20110929145129.GB17905@mit.edu>\r
+References: <871uv2unfd.fsf@gmail.com> <87fwjhx6p5.fsf@convex-new.cs.unb.ca>\r
+       <20110927224622.GR17905@mit.edu> <877h4tyug1.fsf@gmail.com>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <877h4tyug1.fsf@gmail.com>\r
+User-Agent: Mutt/1.5.20 (2009-06-14)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFuphleLIzCtJLcpLzFFi42IRYrdT101tbfEz6P7NYXGjtZvR4vrNmcwW\r
+       fXu+sTowe+ycdZfd49mqW8weWw69Zw5gjuKySUnNySxLLdK3S+DK+PLlIUvBI96Klb93sjcw\r
+       fuDqYuTkkBAwkWh7/YIVwhaTuHBvPVsXIxeHkMA+Rom3f/vYQRJCAhsYJWbttoVInGSS+LXg\r
+       DzOEs4RRYtvtu0wgVSwCqhILJuwE62AT0JDYtn85YxcjB4eIgLJE3/ZEkDCzgJ3Eke9dYGFh\r
+       ATOJVwvlQMK8AjoSTW+mMUKM7GOUuNyygxEiIShxcuYTFoheLYkb/14ygfQyC0hLLP/HARLm\r
+       FFCXOPvnAzOILSqgInFtfzvbBEahWUi6ZyHpnoXQvYCReRWjbEpulW5uYmZOcWqybnFyYl5e\r
+       apGuhV5uZoleakrpJkZwoLuo7mCccEjpEKMAB6MSD++PpGY/IdbEsuLK3EOMkhxMSqK8m5ta\r
+       /IT4kvJTKjMSizPii0pzUosPMUpwMCuJ8PoXAOV4UxIrq1KL8mFS0hwsSuK8r3c4+AkJpCeW\r
+       pGanphakFsFkZTg4lCR4z7cANQoWpaanVqRl5pQgpJk4OEGG8wANfwBSw1tckJhbnJkOkT/F\r
+       qCglznsFJCEAksgozYPrhSWiV4ziQK8I854DqeIBJjG47ldAg5mABn8tbAQZXJKIkJJqYNQs\r
+       enJu+rKQxrr41oorbtPKVnJJXOFsvbuw4v/emAs15js/XCubUCi44fdBeZf1d3T7AndIKXA3\r
+       fp67KnIiU2jszZ9CSTNnvnGfxpbzdO+5rWcmLU9v7NpiOjHqHoP82WmaiyN+fvHQCSp5Eutp\r
+       l5T45KCm8+RaXsugW5V7asPs91XpcLBXOiuxFGckGmoxFxUnAgBnF3+2HwMAAA==\r
+Cc: notmuch@notmuchmail.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, 29 Sep 2011 14:49:10 -0000\r
+\r
+Quoth Ali Polatel on Sep 28 at 10:53 am:\r
+> On Tue, 27 Sep 2011 18:46:22 -0400, Austin Clements <amdragon@MIT.EDU> wrote:\r
+> > Quoth David Bremner on Sep 27 at  1:59 pm:\r
+> > > On Tue, 27 Sep 2011 16:25:58 +0300, Ali Polatel <polatel@gmail.com> wrote:\r
+> > > \r
+> > > > The problem with their design is NULL return may both mean an error\r
+> > > > condition and "message not found". However, we already have a similar\r
+> > > > function which does not have such a flaw, namely notmuch_database_add_message().\r
+> > > \r
+> > > So, I take there is no way to distinguish those two outcomes? That does\r
+> > > sound bad. Looking at the code for notmuch-new, it looks like the return\r
+> > > value of notmuch_database_find_message_by_filename is used without\r
+> > > checking it for NULL.  Austin, can you comment on that at all?\r
+> > \r
+> > I'd be happy to distinguish these outcomes.  I did\r
+> > notmuch_database_find_message_by_filename the way I did only to be\r
+> > consistent with notmuch_database_find_message.  Since ndfmbf isn't\r
+> > entrenched yet, now is a good time to change it.\r
+> \r
+> What about notmuch_database_find_message()? If we leave it as it is,\r
+> this will lead to inconsistency and if we change it, we need to think\r
+> about API breakage issues.\r
+\r
+Yes.  We could just deal with that (there aren't *that* many API\r
+consumers).  For binary compatibility, I suppose we could even use\r
+symbol versioning.\r
+\r
+> > The call in notmuch-new should check the return, though if it can't\r
+> > find the message at that point, something has gone terribly wrong.\r
+> > Segfaulting is never the answer, though.\r
+> \r
+> Indeed, just not to step on each other's feet, are you going to write a\r
+> patch or shall I start writing one?\r
+\r
+Please feel free to write a patch.\r