From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114523 invoked by alias); 12 May 2017 11:07:07 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 114457 invoked by uid 89); 12 May 2017 11:07:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=eyes, H*Ad:D*at X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 12 May 2017 11:07:05 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7855980C23; Fri, 12 May 2017 11:07:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7855980C23 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jwakely@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 7855980C23 Received: from localhost (unknown [10.33.36.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 003265C541; Fri, 12 May 2017 11:07:06 +0000 (UTC) Date: Fri, 12 May 2017 11:15:00 -0000 From: Jonathan Wakely To: Richard Biener Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org, meisenmann.lba@fh-salzburg.ac.at Subject: Re: [PATCH] Fix PR80721 Message-ID: <20170512110706.GZ5109@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.8.0 (2017-02-23) X-SW-Source: 2017-05/txt/msg01020.txt.bz2 On 12/05/17 12:10 +0200, Richard Biener wrote: > >It was pointed out by Markus that the EH emergency pool is not >kept sorted and fully merged properly for the cases of freeing >an entry before the first free entry and for the cases where >merging with the immediate successor and for the case with >merging with both successor and predecessor is possible. > >The following patch attempts to fix this. > >Bootstrap and regtest running on x86_64-unknown-linux-gnu. > >Ok for trunk? (given low / close to no testing coverage >extra close eyes wanted!) > >Reporter says maybe it can't happen in real-life as it requires >EH deallocation order not be the reverse of allocation order. >I don't know enough here for a quick guess but "in C++ everything >is possible" ;) It's definitely possible. std::exception_ptr p1, p2; try { throw 1; } catch (...) { p1 = std::current_exception(); } try { throw 2; } catch (...) { p2 = std::current_exception(); } Both exceptions are still active, and their lifetimes are now tied to value objects which can be reset, swapped, copied etc. so their lifetime is now arbitrary.