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 6C0D1431FD0 for ; Mon, 25 Jul 2011 16:39:14 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 bWaU7-NhdKOG for ; Mon, 25 Jul 2011 16:39:13 -0700 (PDT) Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.216.174]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 89B8B431FB6 for ; Mon, 25 Jul 2011 16:39:13 -0700 (PDT) Received: by qyk29 with SMTP id 29so1344358qyk.5 for ; Mon, 25 Jul 2011 16:39:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:x-mailer:in-reply-to:references; bh=ZI0UrmyViIlvuiC+9YeBIhm0Wl482jGqE2t9n90wP3U=; b=xxEn2PSH+U8c2OlqGhPbdR/yoESNWp4fH1lxvvquZhbGXRVRoshCPF0Xk0jvMjcJMa mnnbLiKyAcKrf/1qDVdumZppSab34tOzf44BRoDxDqBTLzydkHJLcYuIDT4ScR0Jqj9I 4iMePbFf7lJ2Qjo8eJiOqQ+4yOlMcvrtoG17k= Received: by 10.229.221.65 with SMTP id ib1mr3494080qcb.258.1311637152697; Mon, 25 Jul 2011 16:39:12 -0700 (PDT) Received: from localhost.localdomain (vpl025.wlan.library.upenn.edu [130.91.140.26]) by mx.google.com with ESMTPS id k5sm2038118qct.45.2011.07.25.16.39.10 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Jul 2011 16:39:11 -0700 (PDT) From: Aaron Ecay To: notmuch@notmuchmail.org Subject: [PATCH] Add missing call to g_type_init() Date: Mon, 25 Jul 2011 19:38:58 -0400 Message-Id: <1311637138-13963-1-git-send-email-aaronecay@gmail.com> X-Mailer: git-send-email 1.7.6 In-Reply-To: <87bowiccax.fsf@servo.factory.finestructure.net> References: <87bowiccax.fsf@servo.factory.finestructure.net> 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: Mon, 25 Jul 2011 23:39:14 -0000 The Glib docs state "Prior to any use of the type system, g_type_init() has to be called".[1] To not do so can lead to segfaults. The g_type system is currently used by various "filters" that operate on uuencoded text, message headers, etc. [1] http://developer.gnome.org/gobject/2.28/gobject-Type-Information.html#g-type-init --- I have added a link to the Glib docs to the commit message, and a description of where the type code is used. There isn't an easy way to test for this bug, I think -- not including the init call is wrong by the API docs, but only sometimes yields a crash. notmuch.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/notmuch.c b/notmuch.c index 3973e35..f9d6629 100644 --- a/notmuch.c +++ b/notmuch.c @@ -579,6 +579,7 @@ main (int argc, char *argv[]) local = talloc_new (NULL); g_mime_init (0); + g_type_init (); if (argc == 1) return notmuch (local); -- 1.7.6