From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: Dynamic loading progress Date: Mon, 28 Sep 2015 15:19:09 +0000 Message-ID: References: <87egnel6ac.fsf@lifelogs.com> <87vbgpk1po.fsf@lifelogs.com> <85mw20gmeo.fsf@stephe-leake.org> <878u97nyjn.fsf@lifelogs.com> <86d1yirnqw.fsf@stephe-leake.org> <87si7977rs.fsf@tromey.com> <55DB7C3D.4090106@cs.ucla.edu> <55DE75FD.8020308@cs.ucla.edu> <55F5DD8C.70506@dancol.org> <87fv2hzmw3.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c262bc9be9910520d038f5 X-Trace: ger.gmane.org 1443476639 22725 80.91.229.3 (28 Sep 2015 21:43:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Sep 2015 21:43:59 +0000 (UTC) Cc: Paul Eggert , Emacs development discussions , Stefan Monnier , =?UTF-8?Q?Aur=C3=A9lien_Aptel?= , Tom Tromey , Stephen Leake To: "Stephen J. Turnbull" , Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 28 23:43:58 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZggDF-0006Ps-Pr for ged-emacs-devel@m.gmane.org; Mon, 28 Sep 2015 23:43:58 +0200 Original-Received: from localhost ([::1]:41162 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZggDF-0006dU-9d for ged-emacs-devel@m.gmane.org; Mon, 28 Sep 2015 17:43:57 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59664) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgaD7-0000Ih-W1 for emacs-devel@gnu.org; Mon, 28 Sep 2015 11:19:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZgaD1-00083U-Tz for emacs-devel@gnu.org; Mon, 28 Sep 2015 11:19:25 -0400 Original-Received: from mail-wi0-x233.google.com ([2a00:1450:400c:c05::233]:35642) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgaD1-00082s-D6 for emacs-devel@gnu.org; Mon, 28 Sep 2015 11:19:19 -0400 Original-Received: by wicge5 with SMTP id ge5so109954610wic.0 for ; Mon, 28 Sep 2015 08:19:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-type; bh=Fc6UncJ3FdX0j85VBnXBtozS9FzsPRj9acwM7SUhZkg=; b=tLo1FvrD7nAxw/po6rOfybUsojLtsMzkbDgRKgaxewq7cdPjXYdO9wZjFA0cVS4fba 0ADzENV/IRsvFRYADq2X8r5WNqOrGq4ebhuq8jbFA8f0qmwsM4oQPOaQkKkCxII8hrrg E26Guv2acGxOIUNH0pma2nQxePGzBeYAuVjLFApk1Am7IPtc0hDIh340lG40PvY0mS5v 4p44JzsrMOoej+SAN7NdbVFx3P0c+8AHdipp+qy1iAwKm2rQwHzROOSeVkwRtIkhnqGa /BrbWz57qWU9Xl836XSsHuSwhfIiDB0MKkm+HUGXq6GCTMYosaZGEg2fpFLCevUQubEJ KLBA== X-Received: by 10.180.211.177 with SMTP id nd17mr7564238wic.69.1443453558579; Mon, 28 Sep 2015 08:19:18 -0700 (PDT) In-Reply-To: <87fv2hzmw3.fsf@uwakimon.sk.tsukuba.ac.jp> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::233 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:190442 Archived-At: --001a11c262bc9be9910520d038f5 Content-Type: text/plain; charset=UTF-8 Stephen J. Turnbull schrieb am Mo., 14. Sep. 2015 um 05:43 Uhr: > Daniel Colascione writes: > > On 09/13/2015 01:31 PM, Stefan Monnier wrote: > > > >> It's not possible to skip frames in module code using longjmp, so > > > > > > Why not? > > > > Because most C code isn't expecting to be unwound. Forcing non-local > > flow control on module code is completely unacceptable. > > "Completely unacceptable" is nonsense. Module code needs to be > written the same way any other Emacs code is written, Why? The module interface defines an interface, not an implementation strategy. The observable behavior of Emacs is described in the Emacs manual, and that contains nothing about longjmp (unsurprisingly, given that it's an implementation detail). > using various > unwind-protect constructs. It is not possible to write such constructs in general. Stack frames that don't originate from C programs simply can't be part of a non-local jump. unwind-protect doesn't help at all because it doesn't stop non-local jumps. > > > And I'm sure that there's non-robust code in libraries out there that > will be totally horked on a non-local exit. But AFAICS you have the > same problem there if you link statically or at Emacs initialization > -- that code just shouldn't be linked into Emacs period. > > > Such a decision would massively reduce the usefulness of modules. It would prevent dynamic modules in any language other than C, and even for C modules implementors would need to be careful not to write longjmp-hosting code. This is indeed unacceptable. --001a11c262bc9be9910520d038f5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Stephe= n J. Turnbull <turnbull@sk.= tsukuba.ac.jp> schrieb am Mo., 14. Sep. 2015 um 05:43=C2=A0Uhr:
<= /div>
Daniel Colascione writes:
=C2=A0> On 09/13/2015 01:31 PM, Stefan Monnier wrote:

=C2=A0> >> It's not possible to skip frames in module code usi= ng longjmp, so
=C2=A0> >
=C2=A0> > Why not?
=C2=A0>
=C2=A0> Because most C code isn't expecting to be unwound. Forcing n= on-local
=C2=A0> flow control on module code is completely unacceptable.

"Completely unacceptable" is nonsense.=C2=A0 Module code needs to= be
written the same way any other Emacs code is written,

=
Why? The module interface defines an interface, not an implement= ation strategy. The observable behavior of Emacs is described in the Emacs = manual, and that contains nothing about longjmp (unsurprisingly, given that= it's an implementation detail).
=C2=A0
using various
unwind-protect constructs.

It is not possib= le to write such constructs in general. Stack frames that don't origina= te from C programs simply can't be part of a non-local jump. unwind-pro= tect doesn't help at all because it doesn't stop non-local jumps.
=C2=A0
=C2=A0
=

And I'm sure that there's non-robust code in libraries out there th= at
will be totally horked on a non-local exit.=C2=A0 But AFAICS you have the same problem there if you link statically or at Emacs initialization
-- that code just shouldn't be linked into Emacs period.



Such a decision would massively reduce= the usefulness of modules. It would prevent dynamic modules in any languag= e other than C, and even for C modules implementors would need to be carefu= l not to write longjmp-hosting code. This is indeed unacceptable.=C2=A0
--001a11c262bc9be9910520d038f5--