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 modules: MODULE_HANDLE_SIGNALS etc. Date: Thu, 31 Mar 2016 18:44:42 +0000 Message-ID: References: <83mvu1x6t3.fsf@gnu.org> <565779CD.80405@cs.ucla.edu> <83io4nuc68.fsf@gnu.org> <56D5C627.7000209@cs.ucla.edu> <56D736D2.504@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11401f206014c9052f5ca85b X-Trace: ger.gmane.org 1459449933 16347 80.91.229.3 (31 Mar 2016 18:45:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 31 Mar 2016 18:45:33 +0000 (UTC) Cc: aurelien.aptel+emacs@gmail.com, tzz@lifelogs.com, dancol@dancol.org, emacs-devel@gnu.org To: Paul Eggert , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 31 20:45:17 2016 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 1alhai-0002eI-H4 for ged-emacs-devel@m.gmane.org; Thu, 31 Mar 2016 20:45:12 +0200 Original-Received: from localhost ([::1]:33869 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alhah-0003mr-P0 for ged-emacs-devel@m.gmane.org; Thu, 31 Mar 2016 14:45:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60298) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alhaQ-0003mk-OR for emacs-devel@gnu.org; Thu, 31 Mar 2016 14:44:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1alhaP-0002sd-8o for emacs-devel@gnu.org; Thu, 31 Mar 2016 14:44:54 -0400 Original-Received: from mail-lf0-x22b.google.com ([2a00:1450:4010:c07::22b]:35493) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alhaO-0002sS-Rl; Thu, 31 Mar 2016 14:44:53 -0400 Original-Received: by mail-lf0-x22b.google.com with SMTP id k79so65818776lfb.2; Thu, 31 Mar 2016 11:44:52 -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; bh=N5wlrkq5vpk33QAbtYWz3GrzHfalopCOf+midPz1w8Q=; b=Pbs5wSnU5c/ihNKO89KEaf4udqG1MG2Q6+qyspFiI/gzfaRDQPSfzYuvgMeWy/hmWp DkitT4izJUFt3c7bp8V/qxP9GVGT1aosU9HR+ndBPlaR0JIPlXNqXiQReavHLtAnp+3b 5qv92Z6+LVylUxgkQaIQHIA6bLA8O6QmUbQcKoo1s+XcUJpW2ZfuVlhw7l0aziFsVOM1 L97ZcVsKv5MiPcV518ZqceDdo4vxJB+P6rxox6sLAR/YSCg2AH3VgwO/Qxt5kdK43pjk Po5pF8AyGLEFVwWvbXBHwsr5EuvPvMMjiOpxhwnfj15NaT6yr6UhdbDMt1ZAqQy8TNDm HPzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=N5wlrkq5vpk33QAbtYWz3GrzHfalopCOf+midPz1w8Q=; b=WwKrh8r7LY3ZfbedZGtxWq68g58yzzuqxwwSLKGXxwD2cEbU9+8vXhrIjZV50UAzwp ixEWk4ZzB2ikqzOGjbsVhD6ExegQA0a6SzYmUuYC0daKEBC2MdZOLA4T/oJg4HdgJjaX JJ7GtwAkFK/3TnnCRmlgUoUz4avWxmc/KTKXelQttswJTa/TSGjvlTR3JeJWj+oK2aYl k9r1a19P6OBBVhUj6oAGjITzQ7CJoY82cnWx05bwUkpayWTh2416/euY6zwlDi+wTG7g cKk9xBm5kF2aU6Q2FYzoz0/Rllfl9PA3elPIokHOB86tQvptlHPBHrgnB/rYK7hqfPIb e9Ow== X-Gm-Message-State: AD7BkJIGiQd6Ba/MqvjyG2gu3FawKmAQdiOixygChD4h+v9zCbUuXFuEXxqRXKGcysVl+K7A/TBoYc2p+Artkg== X-Received: by 10.25.151.75 with SMTP id z72mr153356lfd.122.1459449891917; Thu, 31 Mar 2016 11:44:51 -0700 (PDT) In-Reply-To: <56D736D2.504@cs.ucla.edu> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::22b 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:202522 Archived-At: --001a11401f206014c9052f5ca85b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Paul Eggert schrieb am Mi., 2. M=C3=A4rz 2016 um 19:54= Uhr: > On 03/01/2016 01:43 PM, Philipp Stephani wrote: > > > > > > https://lists.gnu.org/archive/html/emacs-devel/2015-12/msg00871.htm= l > > > > > > I think this patch can still be applied as-is, it just simplifies the > > code a bit without changing any behavior. > > OK, thanks, I applied it to master, along with the attached followup > which cleans things up a bit more and removes unnecessary runtime checks. > Thanks. Why did you remove the checks? I think all of them are necessary and lead to undefined behavior if they are violated. > > > > > > > https://lists.gnu.org/archive/html/emacs-devel/2015-12/msg00881.htm= l > > > > https://lists.gnu.org/archive/html/emacs-devel/2015-12/msg00902.htm= l > > > > > > The second one is newer, so the first one should be discarded in favor > > of the second one. Given the decision to allow longjmp on segfault, it > > is no longer correct, but a variant (replacing "non-local exits" with > > "non-local exits due to Lisp `signal' and `throw'") should still be > > correct and useful. > > This one looks more dubious. As I mentioned in the containing thread, > the comments are somewhat distracting where they are. Perhaps they could > be collected together into a comment in emacs-module.c that summarizes > the assumptions it makes. > > The issue with that approach is that if one of the used functions is changed to throw signals, then the change author might not know to update emacs-module.c. In the worst case, for every function that starts throwing signals emacs-module.c would have to be investigated. It's less fragile to document the requirements in the functions themselves. --001a11401f206014c9052f5ca85b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Paul E= ggert <eggert@cs.ucla.edu> = schrieb am Mi., 2. M=C3=A4rz 2016 um 19:54=C2=A0Uhr:
On 03/01/2016 01:43 PM, Philipp Stephani wrote:
>
>
>=C2=A0 =C2=A0 =C2=A0https://= lists.gnu.org/archive/html/emacs-devel/2015-12/msg00871.html
>
>
> I think this patch can still be applied as-is, it just simplifies the<= br> > code a bit without changing any behavior.

OK, thanks, I applied it to master, along with the attached followup
which cleans things up a bit more and removes unnecessary runtime checks.

Thanks. Why did you remove the checks? I= think all of them are necessary and lead to undefined behavior if they are= violated.
=C2=A0

>
>
>=C2=A0 =C2=A0 =C2=A0https://= lists.gnu.org/archive/html/emacs-devel/2015-12/msg00881.html
>
>=C2=A0 =C2=A0 =C2=A0https://= lists.gnu.org/archive/html/emacs-devel/2015-12/msg00902.html
>
>
> The second one is newer, so the first one should be discarded in favor=
> of the second one. Given the decision to allow longjmp on segfault, it=
> is no longer correct, but a variant (replacing "non-local exits&q= uot; with
> "non-local exits due to Lisp `signal' and `throw'") = should still be
> correct and useful.

This one looks more dubious. As I mentioned in the containing thread,
the comments are somewhat distracting where they are. Perhaps they could be collected together into a comment in emacs-module.c that summarizes
the assumptions it makes.


The issue with that approach is that i= f one of the used functions is changed to throw signals, then the change au= thor might not know to update emacs-module.c. In the worst case, for every = function that starts throwing signals emacs-module.c would have to be inves= tigated. It's less fragile to document the requirements in the function= s themselves.
--001a11401f206014c9052f5ca85b--