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: Sun, 3 Jan 2016 10:07:21 -0800 Organization: UCLA Computer Science Department Message-ID: <56896359.4020309@cs.ucla.edu> References: <83mvu1x6t3.fsf@gnu.org> <56772054.8010401@cs.ucla.edu> <83zix4scgf.fsf@gnu.org> <5677DBC9.6030307@cs.ucla.edu> <83io3rst2r.fsf@gnu.org> <567841A6.4090408@cs.ucla.edu> <567844B9.2050308@dancol.org> <5678CD07.8080209@cs.ucla.edu> <5678D3AF.7030101@dancol.org> <5678D620.6070000@cs.ucla.edu> <83mvt2qxm1.fsf@gnu.org> <56797CD9.8010706@cs.ucla.edu> <8337uuqsux.fsf@gnu.org> <5679DC83.70405@cs.ucla.edu> <83oadhp2mj.fsf@gnu.org> <567AD556.6020202@cs.ucla.edu> <567AD766.3060608@dancol.org> <567B5DAB.2000900@cs.ucla.edu> <83fuyromig.fsf@gnu.org> <567C25B1.3020101@dancol.org> <56892FD6.8040708@dancol.org> <56894CE7.7090301@cs.ucla.edu> <568950C5.2030306@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1451844472 13892 80.91.229.3 (3 Jan 2016 18:07:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 Jan 2016 18:07:52 +0000 (UTC) To: Daniel Colascione , Eli Zaretskii , Emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 03 19:07: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 1aFn48-00080R-R4 for ged-emacs-devel@m.gmane.org; Sun, 03 Jan 2016 19:07:40 +0100 Original-Received: from localhost ([::1]:42452 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFn48-0004h1-2g for ged-emacs-devel@m.gmane.org; Sun, 03 Jan 2016 13:07:40 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFn3u-0004gW-Qk for Emacs-devel@gnu.org; Sun, 03 Jan 2016 13:07:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aFn3r-0003hQ-K4 for Emacs-devel@gnu.org; Sun, 03 Jan 2016 13:07:26 -0500 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:41608) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFn3r-0003h3-EK; Sun, 03 Jan 2016 13:07:23 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id B4301160817; Sun, 3 Jan 2016 10:07:22 -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 snrnn_o541P8; Sun, 3 Jan 2016 10:07:21 -0800 (PST) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id D9D4B160CC0; Sun, 3 Jan 2016 10:07:21 -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 rBhatV1_Tq6I; Sun, 3 Jan 2016 10:07:21 -0800 (PST) Original-Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id AA292160817; Sun, 3 Jan 2016 10:07:21 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 In-Reply-To: <568950C5.2030306@dancol.org> 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:197478 Archived-At: Daniel Colascione wrote: > we don't respond to *unix* signals by longjmping. Not true. A code path is deliver_interrupt_signal =E2=86=92 deliver_proce= ss_signal =E2=86=92=20 handle_interrupt_signal =E2=86=92 handle_interrupt =E2=86=92 quit_throw_t= o_read_char =E2=86=92=20 sys_longjmp. For what it's worth, Emacs can also lisp-signal from Unix si= gnal=20 handlers if immediate_quit is true. This code has been in Emacs for many = years. > The libsigsegv approach is a problem too: pthread cancellation in > practice is unsupported on some platforms, does not execute C++ > destructors on some platforms even where it's supported, is lightly > tested, and conflicts with other uses of sigsegv. In the case of Emacs, > pthread cancellation is additionally risky because we don't even try to > PTHREAD_CANCEL_DISABLE around critical code sequences. Yes, of course we'd have to do some work to take the libsigsegv approach.= We=20 would need to use pthread cancellation only on platforms where it works, = and we=20 would need to defer cancellation during critical sections. On platforms t= hat=20 lack pthread cancellation or where it doesn't work, we'd be no worse off = than we=20 are now. If we do the longjmp ourselves I assume we can work around the C= ++=20 destructor problem the same way we do now. From what Eli writes, some of this work (I don't know how much) has alre= ady=20 been done for the MS-Windows port. It would be helpful to do something si= milar=20 for GNU/Linux and similar platforms, and to do it right by marking critic= al=20 sections etc. All this would make Emacs more bullet-proof, if someone has= the=20 time to undertake the job.