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 1F9FF429E29 for ; Sun, 19 Jun 2011 02:44:42 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled 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 OV2SjjPP0+DA for ; Sun, 19 Jun 2011 02:44:41 -0700 (PDT) Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id E5F04431FB6 for ; Sun, 19 Jun 2011 02:44:40 -0700 (PDT) Received: by bwg12 with SMTP id 12so2130199bwg.26 for ; Sun, 19 Jun 2011 02:44:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version:content-type; bh=G7y+2K7xCs8fEs3mXUrJgHzhdhRFByc5mPsr1Zb7rFQ=; b=qMDBjTNOdBM/rfc5tLxsv/+1ATouN4yvGTZOq4qVXafQC1W6XRxoInqvGgWGehWVeh hamTddkxLipyGP0UFAsj8MboZlBhLexHxIksuKcLMXHeMnGOkcZah2tYerBvo6eLx6Sm v47h3pPG0/HuK4x9oR7UbxSzBzIzjYU1XwE8Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type; b=YVsxwpdM7mSL06l2QKNQ8LRQNlA87PU3bk6s8sZEaBBSwggG2Q0J4xUwNVuXuL75vm +3RSWcU9FDSvyNo/b8W5PYvzfeqOwVPPuPZsspzgGZrSMxDwTq9wmmMf4LfLUt5f5FLq 7nIaGHHW/aFmwcWuidg/qG5zRibwz+J1kiVtA= Received: by 10.204.7.17 with SMTP id b17mr2989201bkb.61.1308476679059; Sun, 19 Jun 2011 02:44:39 -0700 (PDT) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id k16sm3466173bks.1.2011.06.19.02.44.36 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 19 Jun 2011 02:44:37 -0700 (PDT) From: Dmitry Kurochkin To: Sebastian Spaeth , Patrick Totzke Subject: Re: [python] segfaults at Message.get_date In-Reply-To: <87hb7n300m.fsf@SSpaeth.de> References: <20110616215439.GA26997@brick> <87boxxq833.fsf@SSpaeth.de> <20110617161024.GA8154@optimusprime> <87hb7n300m.fsf@SSpaeth.de> User-Agent: Notmuch/0.5-237-gf6d8cdb (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Sun, 19 Jun 2011 13:45:07 +0400 Message-ID: <87hb7m5f4s.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: notmuch@notmuchmail.org 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: Sun, 19 Jun 2011 09:44:42 -0000 Hi Sebastian, Patrick. On Sat, 18 Jun 2011 12:30:01 +0200, Sebastian Spaeth wrote: > On Fri, 17 Jun 2011 17:10:24 +0100, Patrick Totzke : > > #0 0x006eb87d in Xapian::Document::Internal::get_value(unsigned int) const () from /usr/lib/sse2/libxapian.so.22 > > #1 0x006eb952 in Xapian::Document::get_value(unsigned int) const () from /usr/lib/sse2/libxapian.so.22 > > #2 0x00523963 in notmuch_message_get_date () from /usr/local/lib/libnotmuch.so.1 > > One question, what type is libnotmuch really returning here? The code: > > > time_t > notmuch_message_get_date (notmuch_message_t *message) > { ... > return Xapian::sortable_unserialise (value); > } > > But Xapian API says that sortable_unserialise() returns floating type "double" > > http://xapian.org/docs/apidoc/html/namespaceXapian.html#326fe2d6b0ee59ac9536f3960e8fd99b > "Convert a string encoded using sortable_serialise back to a floating > point number." > > But time_t is usually a (signed) long and not floating point. Obviously > things have worked just fine so far, but is libnotmuch really returning > the right type here? Sorry, I expose my total lack of basic C++ knowledge > here... > Converting double to time_t does not look good. Notmuch converts between time_t and double both when setting and getting the date. I guess it should work good in most cases at least. Perhaps Carl knows better that it is safe. This is not relevant to the segfault. The failure happens in: value = message->doc.get_value (NOTMUCH_VALUE_TIMESTAMP); before conversion from double to time_t. Sebastian, are you able to reproduce the issue? A python script that triggers the bug, perhaps? I would look at this if I can reproduce the problem. Patrick, can you install debugging symbols for libxapian and get the backtrace again? On Debian you need to install libxapian22-dbg. Regards, Dmitry > Sebastian > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch