From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 25EB8429E25 for ; Sun, 4 Dec 2011 11:35:22 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.3 X-Spam-Level: X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_MED=-2.3] 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 ajvcClmxK1JT for ; Sun, 4 Dec 2011 11:35:21 -0800 (PST) Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 7B2E9429E21 for ; Sun, 4 Dec 2011 11:35:21 -0800 (PST) Received: from zancas.localnet (fctnnbsc36w-156034079193.pppoe-dynamic.High-Speed.nb.bellaliant.net [156.34.79.193]) (authenticated bits=0) by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id pB4JZHrr025303 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Sun, 4 Dec 2011 15:35:17 -0400 Received: from bremner by zancas.localnet with local (Exim 4.77) (envelope-from ) id 1RXHqG-0002Hz-OC; Sun, 04 Dec 2011 15:35:16 -0400 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH] lib: call g_type_init from notmuch_database_open Date: Sun, 4 Dec 2011 15:35:14 -0400 Message-Id: <1323027314-8764-1-git-send-email-david@tethera.net> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <20111204182948.GU16194@mit.edu> References: <20111204182948.GU16194@mit.edu> Cc: David Bremner 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, 04 Dec 2011 19:35:22 -0000 From: David Bremner We want to make sure g_type_init is called before any GObject functionality is used. --- This seems to fix the segfault for me. Any other comments/experiences? lib/database.cc | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/lib/database.cc b/lib/database.cc index e4ef14e..98f101e 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -26,6 +26,7 @@ #include #include /* g_free, GPtrArray, GHashTable */ +#include /* g_type_init */ using namespace std; @@ -600,6 +601,9 @@ notmuch_database_open (const char *path, goto DONE; } + /* Initialize the GLib type system and threads */ + g_type_init (); + notmuch = talloc (NULL, notmuch_database_t); notmuch->exception_reported = FALSE; notmuch->path = talloc_strdup (notmuch, path); -- 1.7.7.3