From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12372 invoked by alias); 21 Mar 2014 18:40:52 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 12324 invoked by uid 48); 21 Mar 2014 18:40:48 -0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/60612] Throwing exception, catching and rethrowing (std::exception_ptr) in destructor leads to segfault Date: Fri, 21 Mar 2014 18:40:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.8.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-03/txt/msg02003.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60612 --- Comment #4 from Jonathan Wakely --- When I step through std::rethrow_exception() in gdb it goes from line 215 to line 223, so skips over the call to get_terminate(), so dep->terminateHandler is null and so is dep->unwindHeader.exception_cleanup (gdb) bt #0 std::rethrow_exception (ep=...) at /home/jwakely/src/gcc/gcc/libstdc++-v3/libsupc++/eh_ptr.cc:223 #1 0x0000000000400d39 in A::~A (this=0x7fffffffd9df, __in_chrg=) at ep.cc:19 #2 0x0000000000400c4c in main () at ep.cc:28 (gdb) p *dep $17 = {primaryException = 0x603090, unexpectedHandler = 0x7ffff7d3a7c0 , terminateHandler = 0x0, nextException = 0x0, handlerCount = 0, handlerSwitchValue = 0, actionRecord = 0x0, languageSpecificData = 0x0, catchTemp = 0, adjustedPtr = 0x0, unwindHeader = {exception_class = 0, exception_cleanup = 0x0, private_1 = 0, private_2 = 0}}