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: Tue, 22 Dec 2015 19:51:54 +0200 Message-ID: <831taeqslh.fsf@gnu.org> References: <83mvu1x6t3.fsf@gnu.org> <565779CD.80405@cs.ucla.edu> <83io4nuc68.fsf@gnu.org> <83r3iht93x.fsf@gnu.org> <838u4psznr.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> <5678D710.9010406@dancol.org> <5678E8FE.1010502@cs.ucla.edu> <5678EA4E.6080606@dancol.org> <83io3qqx7s.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1450806700 16605 80.91.229.3 (22 Dec 2015 17:51:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 22 Dec 2015 17:51:40 +0000 (UTC) Cc: aurelien.aptel+emacs@gmail.com, tzz@lifelogs.com, dancol@dancol.org, emacs-devel@gnu.org, eggert@cs.ucla.edu To: Philipp Stephani Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 22 18:51:34 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 1aBR5v-0002jB-Ch for ged-emacs-devel@m.gmane.org; Tue, 22 Dec 2015 18:51:31 +0100 Original-Received: from localhost ([::1]:52318 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBR5u-0003V1-R7 for ged-emacs-devel@m.gmane.org; Tue, 22 Dec 2015 12:51:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBR5q-0003Sy-6a for emacs-devel@gnu.org; Tue, 22 Dec 2015 12:51:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aBR5m-0008HD-3J for emacs-devel@gnu.org; Tue, 22 Dec 2015 12:51:26 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34797) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBR5l-0008H9-W9; Tue, 22 Dec 2015 12:51:22 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1610 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aBR5l-0002LW-3y; Tue, 22 Dec 2015 12:51:21 -0500 In-reply-to: (message from Philipp Stephani on Tue, 22 Dec 2015 17:26:14 +0000) 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:196681 Archived-At: > From: Philipp Stephani > Date: Tue, 22 Dec 2015 17:26:14 +0000 > Cc: eggert@cs.ucla.edu, aurelien.aptel+emacs@gmail.com, tzz@lifelogs.com, > emacs-devel@gnu.org > > IIUC this code (terminate_due_to_signal) already auto-saves without calling > Lisp (or module) code, so this should be usable. We just need to make sure that > module code is not run after a stack overflow. Would it be possible to chose > this path if a module function is running? I'm not sure I understand your proposal in enough detail to answer. Are you suggesting to call terminate_due_to_signal where we detect stack overflow, without unwinding the stack by longjmp? If so, that runs a high risk of crashing, due to several reasons (I can explain them if you indeed suggested something similar to that). We must release enough stack space before we call any non-trivial code. That's what longjmp to top level does. If you are suggesting something else, please elaborate.