unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Adrian Perez de Castro <aperez@igalia.com>
To: notmuch@notmuchmail.org
Subject: Re: Segfault searching for tags
Date: Fri, 20 Nov 2009 20:03:00 +0100	[thread overview]
Message-ID: <20091120200300.55ba8736@hikari> (raw)
In-Reply-To: <87lji11leu.fsf@yoom.home.cworth.org>

[-- Attachment #1: Type: text/plain, Size: 1946 bytes --]

On Fri, 20 Nov 2009 12:32:41 +0100, Carl wrote:

> On Thu, 19 Nov 2009 16:45:43 +0100, Adrian Perez de Castro <aperez@igalia.com> wrote:
> > The thing is that in notmuch_message_get_in_reply_to(), line 288, a NULL
> > instance of Xapian::TermIterator is dereferenced. In my particular case,
> > the culpript is a cache file of Claws-Mail, as seen in the following GDB
> > session:
> 
> Not quite NULL, (nor is it quite dereferencing---this is nasty C++
> overloading), but yeah, the idea is the same. We need to protect all of
> our "calls" to this overloaded operator to not call it when the iterator
> is equal to the value returned by termlist_end ().

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 :)
 
> On Thu, 19 Nov 2009 20:23:15 -0600, Jeffrey Ollie <jeff@ocjtech.us> wrote:
> > I straced some of the crashes, and the last file that was read before
> > the crash was a malformed message.  I've attached one of the messages.
> >  I've been using offlineimap to sync my gmail mailbox to my laptop so
> > that I can use notmuch.  offlineimap isn't the most stable program,
> > but I'm not sure yet if offlineimap is causing the problem or if
> > that's the way the message is in gmail.
> 
> Thanks for the file. I never like to push code that I haven't tested, so
> this was very helpful.
> 
> Below is the patch that I just pushed which seems to do the trick.

I can confirm that this patch avoids the segfault in my case, too. Thanks
a lot for the quick fix.

Best regards,

-- 
Adrian Perez de Castro <aperez@igalia.com>
Igalia - Free Software Engineering

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  parent reply	other threads:[~2009-11-20 19:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-18 18:00 Segfault searching for tags Jeffrey Ollie
2009-11-19 15:45 ` Adrian Perez de Castro
2009-11-20  2:23   ` Jeffrey Ollie
2009-11-20 11:32     ` Carl Worth
2009-11-20 13:10       ` Jeffrey Ollie
2009-11-20 13:20         ` Jan Janak
2009-11-20 17:02           ` Carl Worth
2009-11-20 19:03       ` Adrian Perez de Castro [this message]
2009-11-21  0:32         ` Carl Worth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091120200300.55ba8736@hikari \
    --to=aperez@igalia.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).