From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Brown Newsgroups: gmane.emacs.bugs Subject: bug#20996: 25.0.50; Incomplete recovery from stack overflow Date: Mon, 06 Jul 2015 16:41:54 -0400 Message-ID: <559AE812.2080803@cornell.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1436215398 14663 80.91.229.3 (6 Jul 2015 20:43:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 6 Jul 2015 20:43:18 +0000 (UTC) To: 20996@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 06 22:43:11 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1ZCDEM-0003dv-Qp for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 Jul 2015 22:43:11 +0200 Original-Received: from localhost ([::1]:52893 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCDEM-0007Nx-8b for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 Jul 2015 16:43:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45675) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCDEI-0007Nm-J5 for bug-gnu-emacs@gnu.org; Mon, 06 Jul 2015 16:43:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCDEF-0001X9-BZ for bug-gnu-emacs@gnu.org; Mon, 06 Jul 2015 16:43:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41009) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCDEF-0001Ww-87 for bug-gnu-emacs@gnu.org; Mon, 06 Jul 2015 16:43:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZCDEE-0005pm-R1 for bug-gnu-emacs@gnu.org; Mon, 06 Jul 2015 16:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ken Brown Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Jul 2015 20:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 20996 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.143621533522368 (code B ref -1); Mon, 06 Jul 2015 20:43:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Jul 2015 20:42:15 +0000 Original-Received: from localhost ([127.0.0.1]:42455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZCDDS-0005og-AL for submit@debbugs.gnu.org; Mon, 06 Jul 2015 16:42:14 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60195) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZCDDP-0005oT-JO for submit@debbugs.gnu.org; Mon, 06 Jul 2015 16:42:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCDDI-0001Ll-Ub for submit@debbugs.gnu.org; Mon, 06 Jul 2015 16:42:06 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:34110) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCDDI-0001Lf-Rq for submit@debbugs.gnu.org; Mon, 06 Jul 2015 16:42:04 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCDDH-00079V-Di for bug-gnu-emacs@gnu.org; Mon, 06 Jul 2015 16:42:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCDDE-0001Ke-6D for bug-gnu-emacs@gnu.org; Mon, 06 Jul 2015 16:42:03 -0400 Original-Received: from limerock01.mail.cornell.edu ([128.84.13.241]:54941) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCDDE-0001Fj-1E for bug-gnu-emacs@gnu.org; Mon, 06 Jul 2015 16:42:00 -0400 X-CornellRouted: This message has been Routed already. Original-Received: from authusersmtp.mail.cornell.edu (granite4.serverfarm.cornell.edu [10.16.197.9]) by limerock01.mail.cornell.edu (8.14.4/8.14.4_cu) with ESMTP id t66KfsYn021186 for ; Mon, 6 Jul 2015 16:41:55 -0400 Original-Received: from [10.128.129.1] (dhcp-gs-257.eduroam.cornell.edu [10.128.129.1]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id t66KfsOs005566 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Mon, 6 Jul 2015 16:41:54 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:104788 Archived-At: Cygwin has just implemented an alternate stack in its development trunk, and I've been testing it by seeing if emacs can recover from a stack overflow (see handle_sigsegv() in sysdep.c). This isn't working as I expect, and I don't know if it's a Cygwin problem or an emacs problem. (For starters, it would help if someone would try to reproduce it on GNU/Linux.) To reproduce the problem, run 'emacs -Q' and then force a stack overflow as suggested in https://lists.gnu.org/archive/html/emacs-devel/2014-08/msg00481.html, i.e., by evaluating the following: (setq max-specpdl-size 83200000 max-lisp-eval-depth 640000) (defun foo () (foo)) (foo) When I do this, handle_sigsegv is called and I get the message "Re-entering top level after C stack overflow", as expected. But if I then type 'C-x d', I get an immediate crash with the following backtrace: Program received signal SIGSEGV, Segmentation fault. 0x000000010053aff0 in SDATA (string=-2338913020442312704) at ../../master/src/lisp.h:1281 1281 return XSTRING (string)->data; (gdb) bt full #0 0x000000010053aff0 in SDATA (string=-2338913020442312704) at ../../master/src/lisp.h:1281 No locals. #1 0x0000000100628636 in unmark_byte_stack () at ../../master/src/bytecode.c:380 stack = 0x100df8a63 #2 0x00000001005c0bcb in garbage_collect_1 (end=0x82b838) at ../../master/src/alloc.c:5735 nextb = 0x0 stack_top_variable = 0 '\000' i = 585 message_p = false count = 17 start = { tv_sec = 1436214527, tv_nsec = 316292100 } retval = 0 tot_before = 0 total = {25782979923, 25782959104, 8565584, 45696, 8566592, 4300451200, 4305864144, 0, 8566624, 4300451200} #3 0x00000001005c1208 in Fgarbage_collect () at ../../master/src/alloc.c:5937 end = 0x82b838 #4 0x0000000000000000 in ?? () No symbol table info available. Backtrace stopped: previous frame inner to this frame (corrupt stack?) Lisp Backtrace: "Automatic GC" (0x0) "autoload-do-load" (0x82c0c0) "command-execute" (0x82c628) And handle_sigsegv can't do anything about this because garbage collection is in process. So we haven't really made a complete recovery from the stack overflow. In GNU Emacs 25.0.50.15 (x86_64-unknown-cygwin, GTK+ Version 3.14.13) of 2015-07-06 on moufang Repository revision: f3480939ffccf7a72b060b4fc21dd85b55f535f6 Windowing system distributor `The Cygwin/X Project', version 11.0.11701000 Configured using: `configure 'CFLAGS=-g3 -O0'' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message dired format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns cl-loaddefs pcase cl-lib mail-prsvr mail-utils time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)