Re: Concerns regarding some library functions
authorAli Polatel <polatel@gmail.com>
Wed, 28 Sep 2011 07:53:02 +0000 (10:53 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:39:30 +0000 (09:39 -0800)
ab/224eca0fe3b303a2b7d8dec39f8adbda0e50ca [new file with mode: 0644]

diff --git a/ab/224eca0fe3b303a2b7d8dec39f8adbda0e50ca b/ab/224eca0fe3b303a2b7d8dec39f8adbda0e50ca
new file mode 100644 (file)
index 0000000..a7525fb
--- /dev/null
@@ -0,0 +1,114 @@
+Return-Path: <polatel@gmail.com>\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 BA800431FD0\r
+       for <notmuch@notmuchmail.org>; Wed, 28 Sep 2011 00:53:14 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.789\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.789 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, T_MIME_NO_TEXT=0.01]\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 1mGdJybCuofH for <notmuch@notmuchmail.org>;\r
+       Wed, 28 Sep 2011 00:53:14 -0700 (PDT)\r
+Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com\r
+       [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 233C3431FB6\r
+       for <notmuch@notmuchmail.org>; Wed, 28 Sep 2011 00:53:14 -0700 (PDT)\r
+Received: by bkbzt12 with SMTP id zt12so9148977bkb.26\r
+       for <notmuch@notmuchmail.org>; Wed, 28 Sep 2011 00:53:11 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=from:to:cc:subject:in-reply-to:references:user-agent:date\r
+       :message-id:mime-version:content-type;\r
+       bh=pTGlSshghy7gaF127lt1GTcHej3KMJ9sz86TrBMm600=;\r
+       b=oBEN65WOoczRxQM1+oxKZg335fnADzgM2IITj6ap2eMoMEi7fAkC7dJ5e+yPhe1Nas\r
+       xCkDLTXBzABlgT/+yEUjPMno673KOBmyFxxADIutHiv/3MmKzzY0MEVRya68oz8zrWf2\r
+       Yv1ABe/k9TuQBr6+848UfbPglMQ/6Ymv7WsUQ=\r
+Received: by 10.204.154.194 with SMTP id p2mr5802996bkw.56.1317196391424;\r
+       Wed, 28 Sep 2011 00:53:11 -0700 (PDT)\r
+Received: from localhost ([88.251.189.177])\r
+       by mx.google.com with ESMTPS id j16sm21766924bks.3.2011.09.28.00.53.09\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Wed, 28 Sep 2011 00:53:10 -0700 (PDT)\r
+From: Ali Polatel <polatel@gmail.com>\r
+To: Austin Clements <amdragon@MIT.EDU>, David Bremner <david@tethera.net>\r
+Subject: Re: Concerns regarding some library functions\r
+In-Reply-To: <20110927224622.GR17905@mit.edu>\r
+References: <871uv2unfd.fsf@gmail.com> <87fwjhx6p5.fsf@convex-new.cs.unb.ca>\r
+       <20110927224622.GR17905@mit.edu>\r
+User-Agent: Notmuch/0.8-39-gdd7cb35 (http://notmuchmail.org) Emacs/23.3.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Wed, 28 Sep 2011 10:53:02 +0300\r
+Message-ID: <877h4tyug1.fsf@gmail.com>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="=-=-=";\r
+       micalg=pgp-sha1; protocol="application/pgp-signature"\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: Wed, 28 Sep 2011 07:53:14 -0000\r
+\r
+--=-=-=\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+On Tue, 27 Sep 2011 18:46:22 -0400, Austin Clements <amdragon@MIT.EDU> wrot=\r
+e:\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> wro=\r
+te:\r
+> >=20\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=\r
+_message().\r
+> >=20\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
+>=20\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
+> 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
+         -alip\r
+\r
+--=-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v2.0.18 (GNU/Linux)\r
+\r
+iEYEARECAAYFAk6C0mAACgkQQU4yORhF8iD/IQCgl4jc5BGVFauAIvnSuhV+4DIX\r
+cWMAoMsEkiq4IPfEpuKEyIFj7oNOLWGo\r
+=vZa4\r
+-----END PGP SIGNATURE-----\r
+--=-=-=--\r