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 E57E8431FBF; Fri, 20 Nov 2009 16:32:46 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org 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 NvMDmGYCJmxD; Fri, 20 Nov 2009 16:32:46 -0800 (PST) Received: from cworth.org (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id EE09E431FAE; Fri, 20 Nov 2009 16:32:45 -0800 (PST) From: Carl Worth To: Adrian Perez de Castro , notmuch@notmuchmail.org In-Reply-To: <20091120200300.55ba8736@hikari> References: <935ead450911181000w2cddfe95qe9efd5bea9f9209d@mail.gmail.com> <20091119164543.25e7afe5@hikari> <935ead450911191823s776fda6eyb6f6949ac982bd03@mail.gmail.com> <87lji11leu.fsf@yoom.home.cworth.org> <20091120200300.55ba8736@hikari> Date: Sat, 21 Nov 2009 01:32:34 +0100 Message-ID: <87tywo3efx.fsf@yoom.home.cworth.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [notmuch] Segfault searching for tags X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 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: Sat, 21 Nov 2009 00:32:47 -0000 On Fri, 20 Nov 2009 20:03:00 +0100, Adrian Perez de Castro wrote: > Well, of course you are right, it is an overloaded operator, which > (unfortunately, IMHO) looks like a pointer dereference. That is exactly > one of the things that I find more confusing about C++: it has features > like operator overloading which look cool initially, but that in the end > imply more complexity than needed. I can understand why you decided to > wrap Xapian with a plain C API :) I'm glad you agree. Though I should mention that I earned my summer's salary during an internship once by solving a performance problem that had dodged the engineers on the project, (since they overlooked an overloaded array subscript operator on a std::string class as something that could be expensive---profiling made it obvious, and a temporary copy to a real array with a real subscript fixed the bug). So I can't say that operator overloading never helped me. But I know I left that internship determined not to use it myself. > I can confirm that this patch avoids the segfault in my case, too. Thanks > a lot for the quick fix. Excellent. I'm glad to hear it worked for you. I'm sorry that the bug was there, since this was a regression that's come back once or twice now. The project is overdue for a test suite already... -Carl