Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 41C104196F2 for ; Fri, 23 Apr 2010 06:38:06 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p-49Xfk77QhH for ; Fri, 23 Apr 2010 06:38:05 -0700 (PDT) Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) by olra.theworths.org (Postfix) with ESMTP id 56ED5431FC1 for ; Fri, 23 Apr 2010 06:38:05 -0700 (PDT) Received: from localhost (unknown [192.168.200.4]) by max.feld.cvut.cz (Postfix) with ESMTP id 4B2E019F33D6; Fri, 23 Apr 2010 15:38:04 +0200 (CEST) X-Virus-Scanned: IMAP AMAVIS Received: from max.feld.cvut.cz ([192.168.200.1]) by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new, port 10044) with ESMTP id rCm5xrhbu0B2; Fri, 23 Apr 2010 15:38:00 +0200 (CEST) Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) by max.feld.cvut.cz (Postfix) with ESMTP id 9F6DE19F332E; Fri, 23 Apr 2010 15:38:00 +0200 (CEST) Received: from steelpick.2x.cz (k335-30.felk.cvut.cz [147.32.86.30]) (Authenticated sender: sojkam1) by imap.feld.cvut.cz (Postfix) with ESMTPSA id 8B83DFA003; Fri, 23 Apr 2010 15:38:00 +0200 (CEST) Received: from wsh by steelpick.2x.cz with local (Exim 4.71) (envelope-from ) id 1O5J4x-0003vq-9l; Fri, 23 Apr 2010 15:37:59 +0200 From: Michal Sojka To: Sebastian Spaeth , Notmuch development list Subject: Re: notmuch segfault In-Reply-To: <87d3xqti3o.fsf@SSpaeth.de> References: <8739ym4mxk.fsf@SSpaeth.de> <87d3xqti3o.fsf@SSpaeth.de> Date: Fri, 23 Apr 2010 15:37:59 +0200 Message-ID: <87sk6m2sso.fsf@steelpick.2x.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2010 13:38:06 -0000 On Fri, 23 Apr 2010, Sebastian Spaeth wrote: > Can it be that in thread.cc in _thread_add_matched_message () > ... > subject = notmuch_message_get_header (message, "subject"); > > if ((strncasecmp (subject, "Re: ", 4) == 0) || > ... > > If the underlying message disappeared, get_header will return NULL and > we pass strncasecmp NULL as first parameter. Could that be? Yes, it is very likely the problem. The fix is obvious (see bellow), but the question is how will be this "missing message" presented to the user e.g. in notmuch show. It may be that we will need some other checks to not break other things. diff --git a/lib/thread.cc b/lib/thread.cc index 5bf8354..29b8336 100644 --- a/lib/thread.cc +++ b/lib/thread.cc @@ -148,6 +148,9 @@ _thread_add_matched_message (notmuch_thread_t *thread, subject = notmuch_message_get_header (message, "subject"); + if (!subject) + return; + if ((strncasecmp (subject, "Re: ", 4) == 0) || (strncasecmp (subject, "Aw: ", 4) == 0) || (strncasecmp (subject, "Vs: ", 4) == 0) ||