From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: Dynamic modules: MODULE_HANDLE_SIGNALS etc. Date: Wed, 2 Mar 2016 10:54:10 -0800 Organization: UCLA Computer Science Department Message-ID: <56D736D2.504@cs.ucla.edu> References: <83mvu1x6t3.fsf@gnu.org> <565779CD.80405@cs.ucla.edu> <83io4nuc68.fsf@gnu.org> <56D5C627.7000209@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090509060701080400030008" X-Trace: ger.gmane.org 1456944890 25893 80.91.229.3 (2 Mar 2016 18:54:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 2 Mar 2016 18:54:50 +0000 (UTC) Cc: aurelien.aptel+emacs@gmail.com, tzz@lifelogs.com, dancol@dancol.org, emacs-devel@gnu.org To: Philipp Stephani , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 02 19:54:41 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 1abBuz-0007uj-Df for ged-emacs-devel@m.gmane.org; Wed, 02 Mar 2016 19:54:41 +0100 Original-Received: from localhost ([::1]:58386 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abBuy-0005PE-K7 for ged-emacs-devel@m.gmane.org; Wed, 02 Mar 2016 13:54:40 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36783) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abBuh-0005P5-0R for emacs-devel@gnu.org; Wed, 02 Mar 2016 13:54:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1abBug-0008Du-0A for emacs-devel@gnu.org; Wed, 02 Mar 2016 13:54:22 -0500 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:33504) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abBub-0008C7-W4; Wed, 02 Mar 2016 13:54:18 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id AC51A160E46; Wed, 2 Mar 2016 10:54:16 -0800 (PST) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id ypkUqHExPgsf; Wed, 2 Mar 2016 10:54:11 -0800 (PST) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 4647E160FF5; Wed, 2 Mar 2016 10:54:11 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id M0QDN6gmRXa5; Wed, 2 Mar 2016 10:54:11 -0800 (PST) Original-Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 26E90160E46; Wed, 2 Mar 2016 10:54:11 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 131.179.128.68 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:200871 Archived-At: This is a multi-part message in MIME format. --------------090509060701080400030008 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 03/01/2016 01:43 PM, Philipp Stephani wrote: > > > https://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 > 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. > > > https://lists.gnu.org/archive/html/emacs-devel/2015-12/msg00881.html > > https://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" 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. Also, we really should fix the stack-overflow mess. But that's a bigger topic.... --------------090509060701080400030008 Content-Type: application/x-patch; name="0001-emacs-module.c-simplification-and-tuneup.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="0001-emacs-module.c-simplification-and-tuneup.patch" RnJvbSBhY2YxNDQxZjc1OGUwZGNmMjg5NjVjOGY1OTlhOTliMzI1MmFmNzRlIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBQYXVsIEVnZ2VydCA8ZWdnZXJ0QGNzLnVjbGEuZWR1 PgpEYXRlOiBXZWQsIDIgTWFyIDIwMTYgMTA6NDc6MjcgLTA4MDAKU3ViamVjdDogW1BBVENI XSBlbWFjcy1tb2R1bGUuYyBzaW1wbGlmaWNhdGlvbiBhbmQgdHVuZXVwCk1JTUUtVmVyc2lv bjogMS4wCkNvbnRlbnQtVHlwZTogdGV4dC9wbGFpbjsgY2hhcnNldD1VVEYtOApDb250ZW50 LVRyYW5zZmVyLUVuY29kaW5nOiA4Yml0CgoqIHNyYy9lbWFjcy1tb2R1bGUuYyAoQ0hFQ0tf VVNFUl9QV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