unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Kazuo Teramoto <kaz.rag@gmail.com>
To: notmuch@notmuchmail.org
Subject: Segmentation fault at gmime-iconv with python binding
Date: Thu, 29 Dec 2011 22:52:34 -0200	[thread overview]
Message-ID: <20111230005234.GA23592@sophie> (raw)

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

Hi!

When I try to run the attached test.py after adding the attached email
(4EFC743A.3060609_april.org) to notmuch db I got a segmentation fault
(gdb bt attached).

This is what I think a relevant part of it:
~~~~~~~~
(gdb) frame 1
#1  0x00007ffff5f2759c in g_mime_iconv_open (to=0x761ef0 "UTF-8", from=0x83d590 "iso-8859-1") at gmime-iconv.c:261
261		if ((node = (IconvCacheNode *) cache_node_lookup (iconv_cache, key, TRUE))) {
(gdb) list
256		key = g_alloca (strlen (from) + strlen (to) + 2);
257		sprintf (key, "%s:%s", from, to);
258		
259		ICONV_CACHE_LOCK ();
260		
261		if ((node = (IconvCacheNode *) cache_node_lookup (iconv_cache, key, TRUE))) {
262			if (node->used) {
263				if ((cd = iconv_open (to, from)) == (iconv_t) -1)
264					goto exception;
265			} else {
(gdb) print iconv_cache
$1 = (Cache *) 0x0
(gdb) 
~~~~~~~~

iconv_cache is initialized in g_mime_iconv_init() that is called by
g_mime_init().

notmuch CLI show the message correct. I know nothing about gmime or
notmuch code, but can this be the case of the python bindings not
calling g_mime_init() correctly?

Regards,
Kazuo Teramoto

[-- Attachment #2: test.py --]
[-- Type: text/x-python, Size: 202 bytes --]

#!/usr/bin/env python2
import notmuch
db = notmuch.Database(mode=notmuch.Database.MODE.READ_WRITE)
q_new = notmuch.Query(db, 'id:"4EFC743A.3060609@april.org"')
for t in q_new.search_threads():
    pass

[-- Attachment #3: 4EFC743A.3060609_april.org --]
[-- Type: application/vnd.lotus-organizer, Size: 1348 bytes --]

[-- Attachment #4: notmuch_py_gmime.gdb_bt --]
[-- Type: text/plain, Size: 4306 bytes --]

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
Starting program: /usr/bin/python2 test.py
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5f4fd82 in cache_node_lookup (cache=0x0, key=0x7fffffffaab0 "iso-8859-1:UTF-8", use=1) at cache.c:110
110		node = g_hash_table_lookup (cache->node_hash, key);
(gdb) bt
#0  0x00007ffff5f4fd82 in cache_node_lookup (cache=0x0, key=0x7fffffffaab0 "iso-8859-1:UTF-8", use=1) at cache.c:110
#1  0x00007ffff5f2759c in g_mime_iconv_open (to=0x761ef0 "UTF-8", from=0x83d590 "iso-8859-1") at gmime-iconv.c:261
#2  0x00007ffff5f4633f in rfc2047_decode_word (in=0x82f350 "=?ISO-8859-1?Q?Fran=E7ois_Boulogne?=", inlen=36) at gmime-utils.c:1839
#3  0x00007ffff5f46ad1 in g_mime_utils_header_decode_phrase (phrase=0x82f350 "=?ISO-8859-1?Q?Fran=E7ois_Boulogne?=") at gmime-utils.c:2084
#4  0x00007ffff5f4a759 in _internet_address_decode_name (ia=0x83d630, name=0x88fae0) at internet-address.c:1367
#5  0x00007ffff5f4afab in decode_address (in=0x7fffffffad60) at internet-address.c:1659
#6  0x00007ffff5f4b003 in internet_address_list_parse_string (str=0x766530 "\"=?ISO-8859-1?Q?Fran=E7ois_Boulogne?=\" <boulogne.f@gmail.com>") at internet-address.c:1692
#7  0x00007ffff61915d7 in _thread_add_message (thread=0x6d99d0, message=0x6d9330) at lib/thread.cc:236
#8  0x00007ffff6191dd7 in _notmuch_thread_create (ctx=0x7d54e0, notmuch=0x6e01d0, seed_doc_id=213092, match_set=0x83c888, sort=NOTMUCH_SORT_NEWEST_FIRST) at lib/thread.cc:470
#9  0x00007ffff61906b7 in notmuch_threads_get (threads=0x83c870) at lib/query.cc:392
#10 0x00007ffff65a7e34 in ffi_call_unix64 () from /usr/lib/libffi.so.5
#11 0x00007ffff65a7855 in ffi_call () from /usr/lib/libffi.so.5
#12 0x00007ffff67bb1f7 in _ctypes_callproc () from /usr/lib/python2.7/lib-dynload/_ctypes.so
#13 0x00007ffff67b4a86 in ?? () from /usr/lib/python2.7/lib-dynload/_ctypes.so
#14 0x00007ffff7a66683 in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#15 0x00007ffff7afbbda in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#16 0x00007ffff7afe8ef in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#17 0x00007ffff7a8b15c in function_call () from /usr/lib/libpython2.7.so.1.0
#18 0x00007ffff7a66683 in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#19 0x00007ffff7a752bf in instancemethod_call () from /usr/lib/libpython2.7.so.1.0
#20 0x00007ffff7a66683 in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#21 0x00007ffff7abc002 in call_method () from /usr/lib/libpython2.7.so.1.0
#22 0x00007ffff7af8b1f in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#23 0x00007ffff7afe8ef in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#24 0x00007ffff7afea22 in PyEval_EvalCode () from /usr/lib/libpython2.7.so.1.0
#25 0x00007ffff7b18d8c in run_mod () from /usr/lib/libpython2.7.so.1.0
#26 0x00007ffff7b19b90 in PyRun_FileExFlags () from /usr/lib/libpython2.7.so.1.0
#27 0x00007ffff7b1a60f in PyRun_SimpleFileExFlags () from /usr/lib/libpython2.7.so.1.0
#28 0x00007ffff7b2bd25 in Py_Main () from /usr/lib/libpython2.7.so.1.0
#29 0x00007ffff747e38d in __libc_start_main () from /lib/libc.so.6
#30 0x00000000004006a1 in _start ()
(gdb) frame 1
#1  0x00007ffff5f2759c in g_mime_iconv_open (to=0x761ef0 "UTF-8", from=0x83d590 "iso-8859-1") at gmime-iconv.c:261
261		if ((node = (IconvCacheNode *) cache_node_lookup (iconv_cache, key, TRUE))) {
(gdb) list
256		key = g_alloca (strlen (from) + strlen (to) + 2);
257		sprintf (key, "%s:%s", from, to);
258		
259		ICONV_CACHE_LOCK ();
260		
261		if ((node = (IconvCacheNode *) cache_node_lookup (iconv_cache, key, TRUE))) {
262			if (node->used) {
263				if ((cd = iconv_open (to, from)) == (iconv_t) -1)
264					goto exception;
265			} else {
(gdb) print iconv_cache
$1 = (Cache *) 0x0
(gdb) 

             reply	other threads:[~2011-12-30  0:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-30  0:52 Kazuo Teramoto [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-12-30  0:57 Segmentation fault at gmime-iconv with python binding Kazuo Teramoto
2011-12-30 14:58 ` David Bremner
2012-01-02 15:43   ` Sebastian Spaeth
2011-12-29 18:20 Kazuo Teramoto

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=20111230005234.GA23592@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).