From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Dynamic modules: MODULE_HANDLE_SIGNALS etc. Date: Mon, 04 Jan 2016 18:07:10 +0200 Message-ID: <83egdx72hd.fsf@gnu.org> 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> <56896359.4020309@cs.ucla.edu> <568966D4.5080707@dancol.org> <56898C6F.4010303@cs.ucla.edu> <56898EBD.2000000@dancol.org> <5689AA89.4030404@cs.ucla.edu> <5689AD48.4040902@dancol.org> <8337ud8iec.fsf@gnu.org> <568A9280.90803@dancol.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1451923655 5448 80.91.229.3 (4 Jan 2016 16:07:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 4 Jan 2016 16:07:35 +0000 (UTC) Cc: eggert@cs.ucla.edu, Emacs-devel@gnu.org To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 04 17:07:30 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 1aG7fN-0006ln-86 for ged-emacs-devel@m.gmane.org; Mon, 04 Jan 2016 17:07:29 +0100 Original-Received: from localhost ([::1]:45640 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aG7fJ-0003ag-C7 for ged-emacs-devel@m.gmane.org; Mon, 04 Jan 2016 11:07:25 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aG7f6-0003aT-9P for Emacs-devel@gnu.org; Mon, 04 Jan 2016 11:07:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aG7f1-0003kS-MZ for Emacs-devel@gnu.org; Mon, 04 Jan 2016 11:07:12 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35543) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aG7f1-0003kO-Iv; Mon, 04 Jan 2016 11:07:07 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3038 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aG7f0-0001IM-S9; Mon, 04 Jan 2016 11:07:07 -0500 In-reply-to: <568A9280.90803@dancol.org> (message from Daniel Colascione on Mon, 4 Jan 2016 07:40:48 -0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:197607 Archived-At: > Cc: eggert@cs.ucla.edu, Emacs-devel@gnu.org > From: Daniel Colascione > Date: Mon, 4 Jan 2016 07:40:48 -0800 > > >> The quick and dirty fix for Fdo_auto_save is to run > >> Fdo_auto_save in a forked child > > > > Forking a child from a damaged parent is likely to leave us with the > > same problem in the child. Also, if the original session uses up a > > lot of memory, the fork could simply fail. (You later suggested a > > vfork + exec, but that doesn't allow auto-saving from the child, > > AFAIU.) > > The idea is that we can wait a bounded amount of time for the child, > then kill it if it misbehaves. Yes, but then there's no auto-saving, so this trick seems pointless to me. > The reason I suggested vfork is that glibc (the quality of which > continues to disappoint me) doesn't provide an async-signal-safe > fork. With the scheme I proposed, we don't *need* an > async-signal-safe fork, since we can perform the entire emergency > save operation inside the signal handler, without invoking > lisp. We'd just vfork and exec to ask the user what we want to do, > which is an optional process. Why do we need to vfork+exec just to ask a question? We do this today with a very low-level I/O calls, and that code worked since about forever (I remember studying it 25 years ago).