From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ken Raeburn Newsgroups: gmane.emacs.devel Subject: Re: Conservative GC isn't safe Date: Mon, 28 Nov 2016 14:09:44 -0500 Message-ID: <781CA5B8-3DEA-43C8-B9C3-AC4AAEA21950@raeburn.org> References: <66485157-00cd-4704-a421-cbfe84299cae@cs.ucla.edu> <805F5A19-BFAF-4CA4-AAD6-497C6D554830@raeburn.org> <6e5c928f-8130-08a6-d72d-1b64cc022846@cs.ucla.edu> <1CB11DFF-E6C2-4A1B-BE7E-8877DC38DB0A@raeburn.org> <83inr7zjjf.fsf@gnu.org> <83bmwzzet5.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1480360211 21465 195.159.176.226 (28 Nov 2016 19:10:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 28 Nov 2016 19:10:11 +0000 (UTC) Cc: eggert@cs.ucla.edu, Stefan Monnier , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 28 20:10:03 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cBRJS-00040s-G5 for ged-emacs-devel@m.gmane.org; Mon, 28 Nov 2016 20:10:02 +0100 Original-Received: from localhost ([::1]:60647 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBRJW-0001lU-6E for ged-emacs-devel@m.gmane.org; Mon, 28 Nov 2016 14:10:06 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBRJI-0001jP-87 for emacs-devel@gnu.org; Mon, 28 Nov 2016 14:09:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBRJE-0001eg-HZ for emacs-devel@gnu.org; Mon, 28 Nov 2016 14:09:52 -0500 Original-Received: from mail-qk0-x22f.google.com ([2607:f8b0:400d:c09::22f]:35795) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cBRJE-0001eF-Ae for emacs-devel@gnu.org; Mon, 28 Nov 2016 14:09:48 -0500 Original-Received: by mail-qk0-x22f.google.com with SMTP id n204so150490086qke.2 for ; Mon, 28 Nov 2016 11:09:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raeburn-org.20150623.gappssmtp.com; s=20150623; h=subject:mime-version:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=gQCT11AR3f3nMVZQfq8FWCgAHkUTrP86DEtA3YHFWzE=; b=xKNeCo9QWtgun1+hxj7wSAfQgdkI41RMFzXQMpRW9fPNj0nECl4iEne2WqxXTh0zES nvLB5pI7AK3SRicZpJzaUoT6GHcypA75qYgFUCRhj3GPX40NHYbSE7gWgfM7gvckH2l+ tP0b3GvE+eE0jI4Dd89VmKnZrQNVGGJsOj1aJtW1xUodeqPNliij3gagJidr5SsZxkdR +NEFDMrW+K3qTc3eHFqdbL2tvhHpvrX1xcZxPQd+E88oux3amqzY5c6JgebBYab8dafj ffkoRuyzQy7DzcW2z/5aGcLIu9cYElxJIdTYlUQZFbQlySEhXnIBxsUuWu9197dnKGzR Tz8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=gQCT11AR3f3nMVZQfq8FWCgAHkUTrP86DEtA3YHFWzE=; b=B605Cb3YTsQRuzSnOTN3ebdUJ/q5aO3u00Y34d+dPBjxuS7pSYBN8tIUFJ1fhbaK99 DXvz5eB2/Hm3hT2mdeAf6Rs5N6LrggS6fu+scsCpBqOSkUAD0LxMy6RbO08Bve6CndhD 7X7Rza6Pf3Ojzew/grxjVD8mMYjm5p7fXzyUJZF+C0WU6o7dP12VcvUDFX4kFxgzh6aB qEc9YboQCwouM2PI/GswDv5okFefKBTtEaeZobpVmXq9sFVV7sPpx3JqNm/3Nwu4+hHk BlMLQxG8ZQwY5PXQgxFIcnyor5teOJTWomXAtzWBnzNpLiMCEfLcYcFNb7iAoN9Uo7nM xoBQ== X-Gm-Message-State: AKaTC00q6fdQ76Nyc/pE3MKL5t/7Vp/Bz6tPPdqQ2+8U7RdpK3f7NfyUMUNhfKQfakMAQg== X-Received: by 10.55.203.22 with SMTP id d22mr22762408qkj.240.1480360187235; Mon, 28 Nov 2016 11:09:47 -0800 (PST) Original-Received: from [192.168.23.52] (c-50-138-183-136.hsd1.ma.comcast.net. [50.138.183.136]) by smtp.gmail.com with ESMTPSA id x123sm28882123qkx.46.2016.11.28.11.09.45 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Nov 2016 11:09:45 -0800 (PST) In-Reply-To: <83bmwzzet5.fsf@gnu.org> X-Mailer: Apple Mail (2.3124) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c09::22f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:209671 Archived-At: > On Nov 28, 2016, at 12:37, Eli Zaretskii wrote: >=20 >> From: Stefan Monnier >> Cc: Ken Raeburn , eggert@cs.ucla.edu, = emacs-devel@gnu.org >> Date: Mon, 28 Nov 2016 11:15:28 -0500 >>=20 >>>> res =3D Fvector (ito - ifrom, aref_addr (string, ifrom)); >>> But 'string' still references the contents array of the vector, so = GC >>> will mark it when it comes to 'string'. >>=20 >> But after computing "aref_addr (string, ifrom)", it may very well be >> that `string` is dead and the compiler may then decide not to write >> it into the stack. >=20 > It will still be there in the caller. Not if Fsubstring (or whatever function) is applied directly to the = return value from some other call. As Bj=C3=B6rn described, the caller = may not keep it around at all, just shift it from register to register, = and the callee can scribble over those registers. Even if there=E2=80=99s= an automatic variable assigned the value, if it=E2=80=99s not used = later, the compiler may optimize it away; I=E2=80=99ve lost track of how = many times GDB has indicated to me that it recognizes a variable name = but at the current point in the code it=E2=80=99s been optimized out so = GDB can=E2=80=99t show it to me.=