unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Kazuo Teramoto <kaz.rag@gmail.com>
To: notmuch@notmuchmail.org
Subject: notmuch seg. fault on _thread_add_message
Date: Sun, 4 Dec 2011 15:35:39 -0200	[thread overview]
Message-ID: <20111204173539.GA4411@sophie> (raw)

Hi!

Following an alot bug report [1] I created a small python script that
causes a segmentation fault in notmuch:
========================================================================
#!/usr/bin/env python2
import notmuch
db = notmuch.Database(mode=notmuch.Database.MODE.READ_WRITE)
q_new = notmuch.Query(db, 'tag:inbox')
for t in q_new.search_threads():
    pass
========================================================================

With gdb I get the following
========================================================================
GNU gdb (GDB) 7.3.1
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/python2...(no debugging symbols found)...done.
(gdb) run /tmp/test_notmuch.py 
Starting program: /usr/bin/python2 /tmp/test_notmuch.py
[Thread debugging using libthread_db enabled]

(process:16579): GLib-GObject-CRITICAL **: gtype.c:2715: You forgot to call g_type_init()

(process:16579): GLib-GObject-CRITICAL **: g_object_newv: assertion `G_TYPE_IS_OBJECT (object_type)' failed

(process:16579): GLib-GObject-CRITICAL **: gtype.c:2715: You forgot to call g_type_init()

(process:16579): GLib-GObject-CRITICAL **: gtype.c:2715: You forgot to call g_type_init()

(process:16579): GLib-GObject-CRITICAL **: g_object_newv: assertion `G_TYPE_IS_OBJECT (object_type)' failed

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff4deb86e in decode_addrspec (in=0x7fffffffac80) at internet-address.c:1459
1459		((InternetAddressMailbox *) mailbox)->addr = addr->str;
(gdb) bt
#0  0x00007ffff4deb86e in decode_addrspec (in=0x7fffffffac80) at internet-address.c:1459
#1  0x00007ffff4debb1d in decode_address (in=0x7fffffffacf0) at internet-address.c:1558
#2  0x00007ffff4debe83 in internet_address_list_parse_string (str=0x7b1bc0 "Jani Nikula <jani@nikula.org>") at internet-address.c:1692
#3  0x00007ffff503257b in _thread_add_message (thread=0x7d87f0, message=0x6d9480) at lib/thread.cc:236
#4  0x00007ffff5032d7b in _notmuch_thread_create (ctx=0x7cadd0, notmuch=0x615590, seed_doc_id=6515, match_set=0xe65528, sort=NOTMUCH_SORT_NEWEST_FIRST) at lib/thread.cc:470
#5  0x00007ffff503165b in notmuch_threads_get (threads=0xe65510) at lib/query.cc:392
#6  0x00007ffff6636e34 in ffi_call_unix64 () from /usr/lib/libffi.so.5
#7  0x00007ffff6636855 in ffi_call () from /usr/lib/libffi.so.5
#8  0x00007ffff684a1f7 in _ctypes_callproc () from /usr/lib/python2.7/lib-dynload/_ctypes.so
#9  0x00007ffff6843a86 in ?? () from /usr/lib/python2.7/lib-dynload/_ctypes.so
#10 0x00007ffff7a67683 in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#11 0x00007ffff7afcbda in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#12 0x00007ffff7aff8ef in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#13 0x00007ffff7a8c15c in function_call () from /usr/lib/libpython2.7.so.1.0
#14 0x00007ffff7a67683 in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#15 0x00007ffff7a762bf in instancemethod_call () from /usr/lib/libpython2.7.so.1.0
#16 0x00007ffff7a67683 in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#17 0x00007ffff7abd002 in call_method () from /usr/lib/libpython2.7.so.1.0
#18 0x00007ffff7af9b1f in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#19 0x00007ffff7aff8ef in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#20 0x00007ffff7affa22 in PyEval_EvalCode () from /usr/lib/libpython2.7.so.1.0
#21 0x00007ffff7b19d8c in run_mod () from /usr/lib/libpython2.7.so.1.0
#22 0x00007ffff7b1ab90 in PyRun_FileExFlags () from /usr/lib/libpython2.7.so.1.0
#23 0x00007ffff7b1b60f in PyRun_SimpleFileExFlags () from /usr/lib/libpython2.7.so.1.0
#24 0x00007ffff7b2cd25 in Py_Main () from /usr/lib/libpython2.7.so.1.0
#25 0x00007ffff749b14d in __libc_start_main () from /lib/libc.so.6
#26 0x00000000004006a1 in _start ()
(gdb) list
1454			g_string_free (addr, TRUE);
1455			return NULL;
1456		}
1457		
1458		mailbox = g_object_newv (INTERNET_ADDRESS_TYPE_MAILBOX, 0, NULL);
1459		((InternetAddressMailbox *) mailbox)->addr = addr->str;
1460		g_string_free (addr, FALSE);
1461		
1462		return mailbox;
1463	}
(gdb) info locals
mailbox = 0x0
start = 0x7b1bcd "jani@nikula.org>"
inptr = 0x7b1bdc ">"
word = 0x7b1bcd "jani@nikula.org>"
got_local = 1
addr = 0x8f8d20
len = 4
(gdb) frame 3
#3  0x00007ffff503257b in _thread_add_message (thread=0x7d87f0, message=0x6d9480) at lib/thread.cc:236
236		list = internet_address_list_parse_string (from);
(gdb) l
231				 xstrdup (notmuch_message_get_message_id (message)),
232				 message);
233	
234	    from = notmuch_message_get_header (message, "from");
235	    if (from)
236		list = internet_address_list_parse_string (from);
237	
238	    if (list) {
239		address = internet_address_list_get_address (list, 0);
240		if (address) {
(gdb) info locals
list = 0x0
from = 0x7b1bc0 "Jani Nikula <jani@nikula.org>"
tags = 0x7b2850
tag = 0x7fffffffad60 "\300\033{"
address = 0x7b2850
author = 0x7fffffffafa8 ""
clean_author = 0x6d9480 "\220Ua"
(gdb) 
========================================================================

Is the NULL on mailbox ok? This code is from gmime. I'm using gmime
2.4.28 and notmuch from git (0.10+58~g1c81e8f).

Regards,
Kazuo.

[1]: https://github.com/pazz/alot/issues/142

-- 
“The journey is more important than the destination—that’s
part of life, if you only live for getting to the end, you’re
almost always disappointed.”

Donald E. Knuth

             reply	other threads:[~2011-12-04 17:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-04 17:35 Kazuo Teramoto [this message]
2011-12-04 18:14 ` notmuch seg. fault on _thread_add_message David Bremner
2011-12-04 18:29   ` Austin Clements
2011-12-04 19:35     ` [PATCH] lib: call g_type_init from notmuch_database_open David Bremner
2011-12-05  1:54       ` [PATCH] test: add tests for python bindings David Bremner
2011-12-05 22:11         ` David Bremner
2011-12-05 20:55       ` [PATCH] lib: call g_type_init from notmuch_database_open bjoernb
2011-12-06  3:53       ` Proposed bug fix release 0.10.2 David Bremner
2011-12-06 11:16       ` [PATCH] lib: call g_type_init from notmuch_database_open Sebastian Spaeth

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=20111204173539.GA4411@sophie \
    --to=kaz.rag@gmail.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).