From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: emacs 24 randomly hanging Date: Wed, 22 Feb 2012 18:55:29 +0800 Message-ID: <87aa4byw66.fsf@gnu.org> References: <878vjzz920.fsf@earth.home> <87sji4mpwn.fsf@this.that> <4F43CC35.60407@gmx.at> <8762f0qbam.fsf@this.that> <4F44A6A2.8040701@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1329908156 3856 80.91.229.3 (22 Feb 2012 10:55:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 22 Feb 2012 10:55:56 +0000 (UTC) Cc: martin rudalics , emacs-devel@gnu.org To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 22 11:55:55 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S09rW-0002aK-IE for ged-emacs-devel@m.gmane.org; Wed, 22 Feb 2012 11:55:54 +0100 Original-Received: from localhost ([::1]:55437 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S09rW-0008QZ-58 for ged-emacs-devel@m.gmane.org; Wed, 22 Feb 2012 05:55:54 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:37440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S09rO-0008QP-Fg for emacs-devel@gnu.org; Wed, 22 Feb 2012 05:55:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S09rI-0003Gv-7l for emacs-devel@gnu.org; Wed, 22 Feb 2012 05:55:46 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]:38217) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S09rI-0003Gr-4x for emacs-devel@gnu.org; Wed, 22 Feb 2012 05:55:40 -0500 Original-Received: from [155.69.16.15] (port=58945 helo=furball) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1S09rF-0003Jx-T8; Wed, 22 Feb 2012 05:55:39 -0500 In-Reply-To: (Andreas Schwab's message of "Wed, 22 Feb 2012 10:01:31 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.10 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:148706 Archived-At: --=-=-= Content-Type: text/plain Andreas Schwab writes: > This is just doctoring the symptoms. There is an invariant that *every* > live frame is on Vframe_alist. If that invariant is violated then this > is the bug that must be fixed. That's apparently indeed the problem. I patched next_frame to abort when the target frame isn't on Vframe_list (patch attached), and got the following backtrace with Adam's recipe. The problem is that x-create-frame calls x_set_menu_bar_lines, which calls window-configuration-change-hook. Because that hook is called in the middle of x-create-frame, the (half-initialized) frame isn't on Vframe_list yet. Patch welcome; I don't have time to work on this further right now. 394 kill (getpid (), SIGABRT); (gdb) bt #0 abort () at emacs.c:394 #1 0x00000000004226d7 in next_frame (frame=17277365, minibuf=12761602) at frame.c:944 #2 0x000000000042307e in Fnext_frame (frame=17277365, miniframe=12761602) at frame.c:1101 #3 0x000000000060637a in eval_sub (form=20840342) at eval.c:2347 #4 0x000000000060271b in Fsetq (args=20840470) at eval.c:455 ... #14 0x0000000000603f3c in Fcatch (args=20841622) at eval.c:1237 ... #21 0x0000000000607c8e in Ffuncall (nargs=1, args=0x7fffffff8d08) at eval.c:3057 #22 0x000000000060713a in call0 (fn=21122898) at eval.c:2750 #23 0x000000000048bb27 in run_funs (funs=14101542) at window.c:2872 #24 0x000000000048be39 in run_window_configuration_change_hook (f=0x107a1b0) at window.c:2933 #25 0x00000000005100ab in x_set_menu_bar_lines (f=0x107a1b0, value=0, oldval=12761602) at xfns.c:1269 #26 0x000000000042701f in x_set_frame_parameters (f=0x107a1b0, alist=12761602) at frame.c:2929 #27 0x000000000042a0dd in x_default_parameter (f=0x107a1b0, alist=19012854, prop=12942274, deflt=0, xprop=0x0, xclass=0x0, type=RES_TYPE_NUMBER) at frame.c:3938 #28 0x0000000000513ce8 in Fx_create_frame (parms=19012854) at xfns.c:3327 #29 0x00000000006079cb in Ffuncall (nargs=2, args=0x7fffffff91b0) at eval.c:2996 #30 0x0000000000653cc0 in exec_byte_code (bytestr=9928737, vector=9928773, maxdepth=16, args_template=12761602, nargs=0, args=0x0) at bytecode.c:785 #31 0x00000000006083f2 in funcall_lambda (fun=9928669, nargs=1, arg_vector=0x7fffffff9688) at eval.c:3227 #32 0x0000000000607bda in Ffuncall (nargs=2, args=0x7fffffff9680) at eval.c:3045 ... #56 0x0000000000607113 in apply1 (fn=21078306, arg=14151190) at eval.c:2739 #57 0x0000000000660a34 in read_process_output_call (fun_and_args=14151174) at process.c:5002 #58 0x00000000006047e1 in internal_condition_case_1 ( bfun=0x660a06 , arg=14151174, handlers=12761602, hfun=0x660a36 ) at eval.c:1547 #59 0x000000000066110b in read_process_output (proc=20995733, channel=3123) at process.c:5201 #60 0x00000000006603d3 in wait_reading_process_output (time_limit=30, microsecs=0, read_kbd=-1, do_display=1, wait_for_cell=12761602, wait_proc=0x0, just_wait_proc=0) at process.c:4844 #61 0x000000000041f8da in sit_for (timeout=120, reading=1, do_display=1) at dispnew.c:6063 #62 0x000000000056977c in read_char (commandflag=1, nmaps=2, maps=0x7fffffffd5a0, prev_event=12761602, used_mouse_menu=0x7fffffffd6e8, end_time=0x0) at keyboard.c:2690 #63 0x0000000000577285 in read_key_sequence (keybuf=0x7fffffffd8b0, bufsize=30, prompt=12761602, dont_downcase_last=0, can_return_switch_frame=1, fix_current_buffer=1) at keyboard.c:9302 #64 0x0000000000566f26 in command_loop_1 () at keyboard.c:1448 #65 0x000000000060467a in internal_condition_case ( bfun=0x566b41 , handlers=12813794, hfun=0x566406 ) at eval.c:1509 #66 0x0000000000566830 in command_loop_2 (ignore=12761602) at keyboard.c:1159 #67 0x0000000000604031 in internal_catch (tag=12809586, func=0x56680a , arg=12761602) at eval.c:1266 #68 0x00000000005667e3 in command_loop () at keyboard.c:1138 #69 0x0000000000565f4a in recursive_edit_1 () at keyboard.c:758 #70 0x00000000005660ed in Frecursive_edit () at keyboard.c:822 #71 0x000000000056418e in main (argc=1, argv=0x7fffffffe198) at emacs.c:1715 Lisp Backtrace: "next-frame" (0xffff7c20) "setq" (0xffff7ec8) "while" (0xffff80f8) "let*" (0xffff8378) "catch" (0xffff86c8) "cl-block-wrapper" (0xffff8838) "block" (0xffff89a8) "loop" (0xffff8b18) "walk-frames" (0xffff8d10) "x-create-frame" (0xffff91b8) "x-create-frame-with-faces" (0xffff9688) "make-frame" (0xffff9b68) "make-frame-on-display" (0xffffa078) "server-create-window-system-frame" (0xffffa5e0) --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=frame.c.patch === modified file 'src/frame.c' *** src/frame.c 2012-01-19 07:21:25 +0000 --- src/frame.c 2012-02-22 10:43:37 +0000 *************** *** 935,940 **** --- 935,949 ---- forever. Forestall that. */ CHECK_LIVE_FRAME (frame); + passed = 0; + for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail)) + if (EQ (frame, XCAR (tail))) + passed++; + + if (passed == 0) + abort (); + + passed = 0; while (1) for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail)) { --=-=-=--