Re: talloc_abort in notmuch_thread_get_tags () when db has been modified
authorGaute Hope <eg@gaute.vetsj.com>
Mon, 7 Mar 2016 09:14:00 +0000 (09:14 +0000)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 23:21:14 +0000 (16:21 -0700)
71/a09830291a64d6328d6bc09dea773ff57c3294 [new file with mode: 0644]

diff --git a/71/a09830291a64d6328d6bc09dea773ff57c3294 b/71/a09830291a64d6328d6bc09dea773ff57c3294
new file mode 100644 (file)
index 0000000..bbc6aab
--- /dev/null
@@ -0,0 +1,119 @@
+Return-Path: <eg@gaute.vetsj.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 arlo.cworth.org (Postfix) with ESMTP id 7F60C6DE021D\r
+ for <notmuch@notmuchmail.org>; Mon,  7 Mar 2016 01:14:12 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.604\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.604 tagged_above=-999 required=5 tests=[AWL=0.307,\r
+  DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7,\r
+ RCVD_IN_MSPIKE_H2=-0.211] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id 7_2lrbajME3u for <notmuch@notmuchmail.org>;\r
+ Mon,  7 Mar 2016 01:14:08 -0800 (PST)\r
+Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com\r
+ [209.85.217.176])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id A04D46DE020D\r
+ for <notmuch@notmuchmail.org>; Mon,  7 Mar 2016 01:14:07 -0800 (PST)\r
+Received: by mail-lb0-f176.google.com with SMTP id xr8so26226435lbb.1\r
+ for <notmuch@notmuchmail.org>; Mon, 07 Mar 2016 01:14:07 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=gaute-vetsj-com.20150623.gappssmtp.com; s=20150623;\r
+ h=date:from:subject:to:references:in-reply-to:user-agent:message-id\r
+ :mime-version:content-transfer-encoding;\r
+ bh=IyKCXE+PfUM7ixZxsQi7Cl9HDDLY8FQo1KHuZCo9DQc=;\r
+ b=qP4sJaZqR5xHoPWb0cHGynD/6N4YhaxD1vAeN63vDtubFTqzAL2XePO2UgKIL3QyWf\r
+ s4bf5iWU3zhlL43s5snK0cTX3DpljH6rLFsWFRzQkoY8119w/NZA0T5QbNpBz8DcHx/H\r
+ 0OEypwc608RVI4SbaivY4hi60/JLvfIwsG7pVLrwKGX1N6IsfH/NDLYQfSETha0FVOxm\r
+ /4Nbz7h14cMRQj1dmdFghp2YCKRvRsWTdlmKIlSDuT7TV1/mMn+Itovb/ewaHleg0maA\r
+ S+1L1E4QB2NEjNDEZEIgMglajS909q75ii7CeyyTfoARvnkYLWXlklSvSPvf4fladEv/\r
+ 7r+g==\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:date:from:subject:to:references:in-reply-to\r
+ :user-agent:message-id:mime-version:content-transfer-encoding;\r
+ bh=IyKCXE+PfUM7ixZxsQi7Cl9HDDLY8FQo1KHuZCo9DQc=;\r
+ b=LatXzirL/PyWxFb7zSNLNsDOCKbcbhzOnDduX/Fna/+RZb1PU6i8i66TyxtSneqiXe\r
+ 86usxOyc/Srto3YmCAXjRqyNvmLAPgduSP/g5/o8w88UEqZZvSfbgSQuWF+6eWsp51Pw\r
+ KNI+X8BdDcqX2SqltxJfoLwvArTaTS53y9yAT5KfppnuH29gTnnPQZEL2sHKDNvKtDvF\r
+ m7fGxI15o7FiM+VqFLoejEbqmquWGCaygMyA1UbtwfRY/UrRKMmpMYuLHjjbfpW2D3uL\r
+ BJjxo9J1zTtHb0h+WtpG6GJk5R5cxj9d2uICM26gYbNaxnTPltFJkvLJm5j3gYePCuXx\r
+ 4HyQ==\r
+X-Gm-Message-State:\r
+ AD7BkJKnFH5r7dQ28jZNZexXyS8Q7jQ+sZgoqGXAnvvIi+eONLQ/+BreS9hlQL99/Ze/eQ==\r
+X-Received: by 10.112.201.133 with SMTP id ka5mr7529494lbc.1.1457342042936;\r
+ Mon, 07 Mar 2016 01:14:02 -0800 (PST)\r
+Received: from localhost ([128.39.46.106])\r
+ by smtp.gmail.com with ESMTPSA id f134sm2654531lff.34.2016.03.07.01.14.01\r
+ (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Mon, 07 Mar 2016 01:14:01 -0800 (PST)\r
+Date: Mon, 07 Mar 2016 09:14:00 +0000\r
+From: Gaute Hope <eg@gaute.vetsj.com>\r
+Subject: Re: talloc_abort in notmuch_thread_get_tags () when db has been\r
+ modified\r
+To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
+References: <1453121100-astroid-2-c62fwcrm91-18877@strange>\r
+In-Reply-To: <1453121100-astroid-2-c62fwcrm91-18877@strange>\r
+User-Agent: astroid/v0.5-84-gb119b4ce (https://github.com/gauteh/astroid)\r
+Message-Id: <1457341792-astroid-0-2wtydh6y1q-15951@strange>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8; format=flowed\r
+Content-Transfer-Encoding: quoted-printable\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://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: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 07 Mar 2016 09:14:12 -0000\r
+\r
+Gaute Hope writes on January 18, 2016 13:45:\r
+> David Bremner writes on January 18, 2016 13:25:\r
+>> The most likely cause of such a crash looks to me like nm_thread is NULL\r
+>> or corrupted when passed in to get_tags. It's used without checking as a\r
+>> talloc context, and that call to talloc never returns.\r
+>>\r
+>=20\r
+> Ok, I'll check some further. I am checking whether nm_thread is NULL\r
+> though, [...]\r
+\r
+Hi,\r
+\r
+The stack trace that I get is as follows:\r
+\r
+```\r
+                Stack trace of thread 15719:\r
+                #0  0x00007fc80cd9f2a8 raise (libc.so.6)\r
+                #1  0x00007fc80cda072a abort (libc.so.6)\r
+                #2  0x00007fc80c95889c n/a (libtalloc.so.2)\r
+                #3  0x00007fc80c95a02d talloc_named_const (libtalloc.so.2)\r
+                #4  0x00007fc814d674c5 _notmuch_string_list_create (libnotm=\r
+uch.so.4)\r
+                #5  0x00007fc814d75f32 notmuch_thread_get_tags (libnotmuch.=\r
+so.4)\r
+                #6  0x00000000004757cb _ZN7Astroid13NotmuchThread8get_tagsE=\r
+P15_notmuch_thread (astroid)\r
+\r
+```\r
+\r
+this happens when:\r
+1) start a long running query loading in the background\r
+2) modify the db enough for the query to get invalidated.\r
+\r
+as far as I can see, there is _no_ way to catch this error without\r
+completely crashing the application. I would have to isolate this code\r
+in a separate process or trap SIGABRT (which is certainly messy).\r
+\r
+Best regards, Gaute\r
+\r
+=\r