220 31240 <CA+wfc18uQYCsx7cRrg5VhkQYCU8RXFys3DV9j=7Xuww2nOtePA@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Oliver Kowalke <oliver.kowalke@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: P0534: call/cc, type safety and exceptions
Date: Wed, 1 Mar 2017 12:30:32 +0100
Lines: 69
Approved: news@gmane.org
Message-ID: <CA+wfc18uQYCsx7cRrg5VhkQYCU8RXFys3DV9j=7Xuww2nOtePA@mail.gmail.com>
References: <fc546ea4-a355-4a60-a7e7-97927993471d@isocpp.org>
 <3a57e294-7254-4358-828d-c9f7757f5295@isocpp.org> <9deccbda-26ca-4ad8-a579-1feb674676a6@isocpp.org>
 <CA+wfc19hFNcyjVn=oiFn+rf=zUYYyxjmZ-Zp-wDiK2n61DqeaA@mail.gmail.com> <69ee11fb-5cd0-4e1e-8c61-2792fe062003@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=001a114c6fce2d20b30549a9a56f
X-Trace: blaine.gmane.org 1488367864 20924 195.159.176.226 (1 Mar 2017 11:31:04 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 1 Mar 2017 11:31:04 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCLZHP5J7MHRB3PB3LCQKGQETDLFMPA@isocpp.org Wed Mar 01 12:30:55 2017
Return-path: <std-proposals+bncBCLZHP5J7MHRB3PB3LCQKGQETDLFMPA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pf0-f200.google.com ([209.85.192.200])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCLZHP5J7MHRB3PB3LCQKGQETDLFMPA@isocpp.org>)
	id 1cj2T2-0003mV-QF
	for gclcip-std-proposals@m.gmane.org; Wed, 01 Mar 2017 12:30:49 +0100
Original-Received: by mail-pf0-f200.google.com with SMTP id 6sf45772504pfd.6
        for <gclcip-std-proposals@m.gmane.org>; Wed, 01 Mar 2017 03:30:55 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:in-reply-to:references:from:date:message-id:subject:to
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=2dom29Elja+yghOWSLohjwlt8PvlSuzrbqcxLjHts1U=;
        b=jvWlPggixNAuKFJuL2pYJTrVEouvDXSgFTkbd2+dm3N2fl6jo2JFBLsf1k5Kthw5Ul
         mFTgJimbJF7Dd+tPcdvsrf7FQjnXfn+jVhxvuoe44VOTYaGGMlqtVjuziGUx06WGXsTg
         U3DrB/7V/cugo6XqrLYsqNEpzB7raGA29vYUgW+RGngaIIv8MlUOiLsO5044AI+bVsyG
         XFyEgZCemnCyuJ4pKaaN3yTL2wvD/8Em3LJp4kVSU130CoQfHziHA66A1mZ+G2GSKHdu
         c6o+SsPJAbYEIIXboaC5hqSh4I6whJM9VD1I7b6OxVhzwBXxOqgfbVYHRUCt/ibBpAmV
         z8vg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:in-reply-to:references:from:date
         :message-id:subject:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=2dom29Elja+yghOWSLohjwlt8PvlSuzrbqcxLjHts1U=;
        b=Ad0yghFt1Sy1gyZsTUnew0iklGmrjeyrfiZlfGmGHaM0SSAs79L1AMXK1wLshsAg8n
         QwG46el65Oa7AP85QvER47mBylUlBi5dhzcqzKMwHxxKIejXIOFe7VBI6NPLygOdYM1h
         UA6yUowj0LqxZfaOxary6b13wR1ROBa+YooHSxYEXDU0C1b1S1OkDbRl2cmniP2B1RwL
         ZvfKGc5io6GjAck0lCncBALlyHt76ALQHNF0JTtkECVt2bPnC2e2dQV3s8bPAMJVzpbr
         9Mu22kZveodTN4ZBsKOYbxBWxL3SRkAQK+pIJRBYANDLxH7hDWQQsbHLacxX4mpoGZUC
         gEzw==
X-Gm-Message-State: AMke39npG7Zo4fm/XLO5t40wGTgWZUilwy0skGcs33JnpW7manr53pia8CPA8u9sdE7ufg==
X-Received: by 10.99.189.17 with SMTP id a17mr2631582pgf.53.1488367854407;
        Wed, 01 Mar 2017 03:30:54 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.68.202 with SMTP id p10ls440907otg.18.gmail; Wed, 01 Mar
 2017 03:30:53 -0800 (PST)
X-Received: by 10.129.137.7 with SMTP id z7mr367033ywf.122.1488367853640;
        Wed, 01 Mar 2017 03:30:53 -0800 (PST)
Original-Received: from mail-yw0-x22a.google.com (mail-yw0-x22a.google.com. [2607:f8b0:4002:c05::22a])
        by mx.google.com with ESMTPS id p65si519425ywb.29.2017.03.01.03.30.53
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 01 Mar 2017 03:30:53 -0800 (PST)
Received-SPF: pass (google.com: domain of oliver.kowalke@gmail.com designates 2607:f8b0:4002:c05::22a as permitted sender) client-ip=2607:f8b0:4002:c05::22a;
Original-Received: by mail-yw0-x22a.google.com with SMTP id p77so28983554ywg.1
        for <std-proposals@isocpp.org>; Wed, 01 Mar 2017 03:30:53 -0800 (PST)
X-Received: by 10.129.57.70 with SMTP id g67mr3036484ywa.119.1488367853049;
 Wed, 01 Mar 2017 03:30:53 -0800 (PST)
Original-Received: by 10.129.173.21 with HTTP; Wed, 1 Mar 2017 03:30:32 -0800 (PST)
In-Reply-To: <69ee11fb-5cd0-4e1e-8c61-2792fe062003@isocpp.org>
X-Original-Sender: oliver.kowalke@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of
 oliver.kowalke@gmail.com designates 2607:f8b0:4002:c05::22a as permitted
 sender) smtp.mailfrom=oliver.kowalke@gmail.com;       dmarc=pass (p=NONE
 sp=NONE dis=NONE) header.from=gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:31240
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/31240>

--001a114c6fce2d20b30549a9a56f
Content-Type: text/plain; charset=UTF-8

you can't use recovery after calling std::invloke() because during the
execution of f the context associated with f.ctx/recovery might have been
resumed (so recovery points somewhere in the stackframe) or the context was
terminated before the exception is thrown out of f.

suppose A calls callccc(f) -> that creates B : t.fctx/recovery points  to
the stack of A
B resumes C (created somewhere/before A calls callcc() ...)
C resumes A
A terminates
after A has terminated B is resumed (because A has specified B as the
context that has to be resumed after A's termination)
B resumes and throws an exception
exception is catched in run()
returning recovery ends up in UB because the stack space recovery points to
is invalidated/deleted or was reused and overwritten ....

-- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CA%2Bwfc18uQYCsx7cRrg5VhkQYCU8RXFys3DV9j%3D7Xuww2nOtePA%40mail.gmail.com.

--001a114c6fce2d20b30549a9a56f
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div><div><div><div><div><div><div>you can&#39;t use =
recovery after calling std::<span tabindex=3D"-1" id=3D":2je.1" style=3D"" =
class=3D"">invloke</span>() because during the execution of f the context a=
ssociated with f.<span tabindex=3D"-1" id=3D":2je.2" style=3D"" class=3D"">=
ctx</span>/recovery might have been resumed (so recovery points somewhere i=
n the <span tabindex=3D"-1" id=3D":2je.3" style=3D"" class=3D"">stackframe<=
/span>) or the context was terminated before the exception is thrown out of=
 f.<br><br></div>suppose A calls <span tabindex=3D"-1" id=3D":2je.4" style=
=3D"" class=3D"">callccc</span>(f) -&gt; that creates B : t.<span tabindex=
=3D"-1" id=3D":2je.5" style=3D"" class=3D"">fctx</span>/recovery points=C2=
=A0 to the stack of A<br></div>B resumes C (created somewhere/before A call=
s <span tabindex=3D"-1" id=3D":2je.6" style=3D"" class=3D"">callcc</span>()=
 ...)<br></div>C resumes A<br></div>A terminates<br></div>after A has termi=
nated B is resumed (because A has specified B as the context that has to be=
 resumed after A&#39;s termination)<br></div>B resumes and throws an except=
ion<br></div>exception is <span tabindex=3D"-1" id=3D":2je.7" style=3D"" cl=
ass=3D"">catched</span> in run()<br></div>returning recovery ends up in <sp=
an tabindex=3D"-1" id=3D":2je.8" style=3D"" class=3D"">UB</span> because th=
e stack space recovery points to is invalidated/deleted or was reused and o=
verwritten ....<br></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CA%2Bwfc18uQYCsx7cRrg5VhkQYCU8RXFys3D=
V9j%3D7Xuww2nOtePA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CA%2Bwfc18uQY=
Csx7cRrg5VhkQYCU8RXFys3DV9j%3D7Xuww2nOtePA%40mail.gmail.com</a>.<br />

--001a114c6fce2d20b30549a9a56f--

.
