Segmentation fault at gmime-iconv with python binding

Subject: Segmentation fault at gmime-iconv with python binding

Date: Thu, 29 Dec 2011 22:57:27 -0200

To: notmuch@notmuchmail.org

Cc:

From: Kazuo Teramoto


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
4EFC743A.3060609_april.org (application/vnd.lotus-organizer)notmuch_py_gmime.gdb_bt (application/octet-stream)

Thread: