[PATCH 0/2] Multiples calls of g_mime_init
authorKazuo Teramoto <kaz.rag@gmail.com>
Fri, 30 Dec 2011 21:58:08 +0000 (19:58 +2200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:41:26 +0000 (09:41 -0800)
bc/490b36c776b74091fdc0966a60c9bc20ab5955 [new file with mode: 0644]

diff --git a/bc/490b36c776b74091fdc0966a60c9bc20ab5955 b/bc/490b36c776b74091fdc0966a60c9bc20ab5955
new file mode 100644 (file)
index 0000000..a2bd013
--- /dev/null
@@ -0,0 +1,87 @@
+Return-Path: <kaz.rag@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 6A5BB431FD0\r
+       for <notmuch@notmuchmail.org>; Fri, 30 Dec 2011 13:58:45 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 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] 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 yZKvLLIKZuwL for <notmuch@notmuchmail.org>;\r
+       Fri, 30 Dec 2011 13:58:44 -0800 (PST)\r
+Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com\r
+       [209.85.216.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 81D4F431FB6\r
+       for <notmuch@notmuchmail.org>; Fri, 30 Dec 2011 13:58:44 -0800 (PST)\r
+Received: by qcha6 with SMTP id a6so10990719qch.26\r
+       for <notmuch@notmuchmail.org>; Fri, 30 Dec 2011 13:58:43 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       bh=lauABo9r4FwiAtE0C1cxn4KP7g1IqOPGWBSLsaZ7+4Q=;\r
+       b=FciZ7qpSVbnDFNURDu8pcaPhw7DtrUnObTk1msm+JN4U2GUWauSPc6hcZXlpBNj64T\r
+       xJPgFoXkxo3LcmZclkQlx4AzQO/B8An1TFCVmg+ADv6pZrtHyjP/t7cFKEL2axRWcgDN\r
+       +efTTfs/9PKdFLSrLUzjbw+dPdQIEny0XVfEA=\r
+Received: by 10.229.75.144 with SMTP id y16mr15035739qcj.87.1325282323835;\r
+       Fri, 30 Dec 2011 13:58:43 -0800 (PST)\r
+Received: from localhost.localdomain (201-1-35-143.dsl.telesp.net.br.\r
+       [201.1.35.143])\r
+       by mx.google.com with ESMTPS id z1sm74916346qao.1.2011.12.30.13.58.41\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Fri, 30 Dec 2011 13:58:43 -0800 (PST)\r
+From: Kazuo Teramoto <kaz.rag@gmail.com>\r
+To: notmuch@notmuchmail.org,\r
+       David Bremner <david@tethera.net>\r
+Subject: [PATCH 0/2] Multiples calls of g_mime_init\r
+Date: Fri, 30 Dec 2011 19:58:08 -0200\r
+Message-Id: <1325282290-29565-1-git-send-email-kaz.rag@gmail.com>\r
+X-Mailer: git-send-email 1.7.8.1\r
+In-Reply-To: <877h1e6r9d.fsf@zancas.localnet>\r
+References: <877h1e6r9d.fsf@zancas.localnet>\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: Fri, 30 Dec 2011 21:58:45 -0000\r
+\r
+The gmime docs don't says if is ok to call g_mime_init multiple times,\r
+but the code have a check for it in a form like this:\r
+~~~~~~~~\r
+static unsigned int initialized = 0;\r
+g_mime_init (guint32 flags)\r
+{\r
+    if (initialized++)\r
+        return;\r
+~~~~~~~~\r
+so the init code is run only once and notmuch don't need to explicit\r
+check for an already initialized gmime.\r
+\r
+This make possible to call g_mime_init again in lib/database.cc and this\r
+call really solve the OP segmentation fault in python bindings.\r
+\r
+Kazuo Teramoto (2):\r
+  lib: Remove unnecessary checks when calling g_mime_init\r
+  lib: call g_mime_init from notmuch_database_open\r
+\r
+ lib/database.cc    |    5 +++++\r
+ lib/index.cc       |    4 ----\r
+ lib/message-file.c |    4 ----\r
+ 3 files changed, 5 insertions(+), 8 deletions(-)\r
+\r
+-- \r
+1.7.8.1\r
+\r