--- /dev/null
+Return-Path: <blakej@foo.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id EF9F7431FB6\r
+ for <notmuch@notmuchmail.org>; Wed, 17 Apr 2013 07:05:31 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+ autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id OVx+S4QWD055 for <notmuch@notmuchmail.org>;\r
+ Wed, 17 Apr 2013 07:05:31 -0700 (PDT)\r
+Received: from foo.net (70-36-235-136.dsl.static.sonic.net [70.36.235.136])\r
+ (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 68940431FAF\r
+ for <notmuch@notmuchmail.org>; Wed, 17 Apr 2013 07:05:31 -0700 (PDT)\r
+Received: from foo.net (localhost [127.0.0.1])\r
+ by foo.net (8.14.5+Sun/8.14.5) with ESMTP id r3HE5T2m020042;\r
+ Wed, 17 Apr 2013 07:05:29 -0700 (PDT)\r
+To: Vladimir Marek <Vladimir.Marek@Oracle.COM>\r
+Subject: Re: crash during saving \r
+In-Reply-To: Your message of "Wed, 17 Apr 2013 10:53:54 +0200."\r
+ <20130417085354.GE7807@pub.cz.oracle.com> \r
+Date: Wed, 17 Apr 2013 07:05:29 -0700\r
+Message-ID: <20041.1366207529@foo.net>\r
+From: Blake Jones <blakej@foo.net>\r
+X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2\r
+ (foo.net [127.0.0.1]); Wed, 17 Apr 2013 07:05:30 -0700 (PDT)\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 17 Apr 2013 14:05:32 -0000\r
+\r
+> Right, so the problem really seems to be in throwing/catching\r
+> exception. Function "_notmuch_message_remove_term" is supposed to\r
+> catch the exception and ignore it. Which does not happen in my case.\r
+\r
+Yep, that was exactly what I was seeing.\r
+\r
+> On a side note, I wonder, is catching exception faster than going\r
+> through list of tags to see if given tag exists? Might be interesting\r
+> to compare.\r
+\r
+I tried that as a workaround at first (just to get it working, not\r
+caring about performance). But I realized that libxapian uses\r
+exceptions for a lot of failure modes, and I actually ran into one or\r
+two others, so I decided I needed to just get it working.\r
+\r
+To simplify the problem, you might want to try building a very simple\r
+stub version of the whole thing -- i.e. a C program that makes a call to\r
+a C-interface "liba", which just makes a call into a C++ "libb" library\r
+and tries to catch an exception from it; the "libb" library would just\r
+throw an exception. If that reproduces the problem, that might help you\r
+debug your setup.\r
+\r
+(Again, I eventually settled on using GCC 4.5.2, and didn't have the\r
+intestinal fortitude to get Studio working. Especially once I saw\r
+problems with C++ exception handling. If you can get it working, more\r
+power to you!)\r
+\r
+Blake\r