From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
To: Sebastian Spaeth <Sebastian@SSpaeth.de>,
Patrick Totzke <patricktotzke@googlemail.com>
Cc: notmuch@notmuchmail.org
Subject: Re: [python] segfaults at Message.get_date
Date: Sun, 19 Jun 2011 13:45:07 +0400 [thread overview]
Message-ID: <87hb7m5f4s.fsf@gmail.com> (raw)
In-Reply-To: <87hb7n300m.fsf@SSpaeth.de>
Hi Sebastian, Patrick.
On Sat, 18 Jun 2011 12:30:01 +0200, Sebastian Spaeth <Sebastian@SSpaeth.de> 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
next prev parent reply other threads:[~2011-06-19 9:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-16 21:54 [python] segfaults at Message.get_date Patrick Totzke
2011-06-17 6:34 ` Sebastian Spaeth
2011-06-17 16:10 ` Patrick Totzke
2011-06-18 10:30 ` Sebastian Spaeth
2011-06-19 9:45 ` Dmitry Kurochkin [this message]
2011-06-19 14:53 ` Sebastian Spaeth
2011-06-19 23:51 ` Austin Clements
2011-06-20 7:29 ` Sebastian Spaeth
2011-06-20 16:53 ` Austin Clements
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=87hb7m5f4s.fsf@gmail.com \
--to=dmitry.kurochkin@gmail.com \
--cc=Sebastian@SSpaeth.de \
--cc=notmuch@notmuchmail.org \
--cc=patricktotzke@googlemail.com \
/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).