From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14356 invoked by alias); 21 Nov 2013 09:20:29 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 14346 invoked by uid 89); 21 Nov 2013 09:20:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,RDNS_NONE,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-ob0-f175.google.com Received: from Unknown (HELO mail-ob0-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 21 Nov 2013 09:20:28 +0000 Received: by mail-ob0-f175.google.com with SMTP id uz6so3412389obc.6 for ; Thu, 21 Nov 2013 01:20:20 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.60.141.225 with SMTP id rr1mr938817oeb.55.1385025620521; Thu, 21 Nov 2013 01:20:20 -0800 (PST) Received: by 10.182.105.69 with HTTP; Thu, 21 Nov 2013 01:20:20 -0800 (PST) In-Reply-To: References: Date: Thu, 21 Nov 2013 10:23:00 -0000 Message-ID: Subject: Re: C++ exceptions From: vijay nag To: Jonathan Wakely Cc: "gcc-help@gcc.gnu.org" Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2013-11/txt/msg00166.txt.bz2 On Wed, Nov 20, 2013 at 11:28 PM, Jonathan Wakely wrote: > On 20 November 2013 17:43, vijay nag wrote: >> >> Nope Im running a variant of debian linux i686 kernel. Does GCC pick >> libgcc from GCC_EXEC_PREFIX ? I am running the program in complete >> chroot encironment so that libraries donot collide with host machine. >> Are you telling me that Issue is because of wrong version of libgcc ? > > It's not possible to say, because you've still provided almost no > information. How are you building the libraries? What flags are you > using to compile and link? > > Is the exception thrown from one of the libraries? Is the catch in a > library or the main program? > > Have you tried a simple example that just has a single function in a > single shared library that throws an exception? If not, why not? > > Without most of this information we're just guessing randomly what the > problem might be. I tried creating a small binary to demonstrate the problem that I had been facing with my gcc-4.7.2 tool chain and glibc-2.17. The library and binaries were created using exact CFLAGS, CXXFLAGS et al. Strangely, the problem doesn't manifest in my example program :(. On further hacking and debugging libgcc, I found that _Unwind_RaiseException() was always "returning" in failure case with return code _URC_END_OF_STACK. Does it mean that FDE is missing for the function which is suppose to catch the exception ? How do I check if an FDE exists for a particular function or not ? "Wait, are you throwing from a destructor? Those are noexcept by default nowadays, which would cause a call to std::terminate. Specify noexcept(false) on it if you insist." >>> I don't think Im throwing exception from a destructor and by the way Try/Catch is not working even for POD types.