From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nelson Elhage Newsgroups: gmane.emacs.bugs Subject: bug#4078: 23.1; Forcibly breaking 'emacsclient -c' X connections can crash emacs. Date: Fri, 7 Aug 2009 18:50:14 -0400 (EDT) Message-ID: <200908072250.n77MoEEM007300@outgoing.mit.edu> Reply-To: Nelson Elhage , 4078@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1249706871 13175 80.91.229.12 (8 Aug 2009 04:47:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Aug 2009 04:47:51 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Aug 08 06:47:43 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MZdqH-0004HZ-Oi for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Aug 2009 06:47:43 +0200 Original-Received: from localhost ([127.0.0.1]:53928 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MZdqH-0001jc-4T for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Aug 2009 00:47:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MZYWX-0005hp-FE for bug-gnu-emacs@gnu.org; Fri, 07 Aug 2009 19:06:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MZYWR-0005e9-Cq for bug-gnu-emacs@gnu.org; Fri, 07 Aug 2009 19:06:57 -0400 Original-Received: from [199.232.76.173] (port=36830 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MZYWQ-0005dm-VJ for bug-gnu-emacs@gnu.org; Fri, 07 Aug 2009 19:06:51 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:34260) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MZYWQ-0000Wk-80 for bug-gnu-emacs@gnu.org; Fri, 07 Aug 2009 19:06:50 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n77N6mHd012755; Fri, 7 Aug 2009 16:06:48 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n77Mt4fp010999; Fri, 7 Aug 2009 15:55:04 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Nelson Elhage Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 07 Aug 2009 22:55:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 4078 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.124968542310894 (code B ref -1); Fri, 07 Aug 2009 22:55:04 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 7 Aug 2009 22:50:23 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n77MoLSG010891 for ; Fri, 7 Aug 2009 15:50:23 -0700 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MZYGT-0006S6-8I for bug-gnu-emacs@gnu.org; Fri, 07 Aug 2009 18:50:21 -0400 Original-Received: from [199.232.76.173] (port=58241 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MZYGS-0006RZ-0Z for bug-gnu-emacs@gnu.org; Fri, 07 Aug 2009 18:50:20 -0400 Original-Received: from biscayne-one-station.mit.edu ([18.7.7.80]:49190) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MZYGQ-0006Yj-Te for bug-gnu-emacs@gnu.org; Fri, 07 Aug 2009 18:50:19 -0400 Original-Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by biscayne-one-station.mit.edu (8.13.6/8.9.2) with ESMTP id n77MoFap015191 for ; Fri, 7 Aug 2009 18:50:15 -0400 (EDT) Original-Received: from localhost (dhcp-18-111-28-78.dyn.mit.edu [18.111.28.78]) (authenticated bits=0) (User authenticated as nelhage@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id n77MoEEM007300 for ; Fri, 7 Aug 2009 18:50:14 -0400 (EDT) X-Scanned-By: MIMEDefang 2.42 X-detected-operating-system: by monty-python.gnu.org: Solaris 9 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Fri, 07 Aug 2009 19:06:57 -0400 X-Mailman-Approved-At: Sat, 08 Aug 2009 00:47:19 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:29977 Archived-At: Steps to reproduce: (1) Run 'emacs --daemon' or 'emacs -nw' (2) M-x server-start (3) Run 'emacsclient -c' (4) Run 'xkill' and click on the Emacs X window (5) Run 'emacsclient -c' again Expected behavior: Another emacs X window pops up. Observed behavior: * A window pops up, but remains blank and non-responsive. * The 'emacs -nw' window outputs an infinite stream of (process:11200): GLib-WARNING (recursed) **: g_main_context_prepare() called recursively from within a source's check() or prepare() member At this point, 'emacsclient -t' still works properly, and killing the new '-c' session seems to usually stop the GLib spew. I captured a backtrace of emacs, interrupted while it was spewing that warning endlessly. I appear to have caught it while logging the error, so hopefully the stack is relevant. This is 100% reproducible for me, so I can happily provide other stack traces if they would be useful. ---------- CUT HERE ---------- #0 0xb7f32430 in __kernel_vsyscall () No symbol table info available. #1 0xb776d053 in __write_nocancel () from /lib/tls/i686/cmov/libpthread.so.0 No symbol table info available. #2 0xb77bc306 in write_string (fd=2, string=0x8de0360 "\n(emacs:19202): GLib-WARNING **: g_main_context_check() called recursively from within a source's check() or prepare() member.\n") at /build/buildd/glib2.0-2.20.1/glib/gmessages.c:130 No locals. #3 0xb77bc78c in IA__g_log_default_handler (log_domain=0xb77ecf06 "GLib", log_level=, message=0x8fbd018 "g_main_context_check() called recursively from within a source's check() or prepare() member.", unused_data=0x0) at /build/buildd/glib2.0-2.20.1/glib/gmessages.c:959 level_prefix = "WARNING **\000\004\000\000\000(\ufffd\204\ufffd\ufffdW}\ufffd$\ufffd\204\ufffd\004*\177\ufffd\ufffd\ufffd\204\ufffd&\ufffd{\ufffd\030\ufffd\ufffd\b\ufffd\227\ufffd\b" string = (gchar *) 0x8de0360 "\n(emacs:19202): GLib-WARNING **: g_main_context_check() called recursively from within a source's check() or prepare() member.\n" gstring = (GString *) 0x8e1d5d0 fd = 2 #4 0xb77bcb3f in IA__g_logv (log_domain=0xb77ecf06 "GLib", log_level=G_LOG_LEVEL_WARNING, format=0xb77f2a04 "g_main_context_check() called recursively from within a source's check() or prepare() member.", args1=0xbf84e2dc "\ufffd\ufffd\202\ufffd\u0422Q\b`\ufffd[\b\030\ufffd\204\ufffd2E{\ufffd\234\ufffd\204\ufffd4\ufffd\204\ufffdo\ufffd9\ufffdTC{\ufffd\002") at /build/buildd/glib2.0-2.20.1/glib/gmessages.c:483 depth = 1 domain = data = (gpointer) 0x0 log_func = (GLogFunc) 0xb77bc480 domain_fatal_mask = 5 test_level = G_LOG_LEVEL_WARNING was_recursion = 0 i = #5 0xb77bcee6 in IA__g_log (log_domain=0xb77ecf06 "GLib", log_level=G_LOG_LEVEL_WARNING, format=0xb77f2a04 "g_main_context_check() called recursively from within a source's check() or prepare() member.") at /build/buildd/glib2.0-2.20.1/glib/gmessages.c:526 No locals. #6 0xb77b561e in IA__g_main_context_check (context=0x851a2d0, max_priority=-1216652197, fds=0x8f62c00, n_fds=0) at /build/buildd/glib2.0-2.20.1/glib/gmain.c:2264 source = pollrec = n_ready = i = #7 0xb77b5fdd in g_main_context_iterate (context=0x851a2d0, block=0, dispatch=0, self=0x84f92e8) at /build/buildd/glib2.0-2.20.1/glib/gmain.c:2445 max_priority = -1216652197 timeout = 0 some_ready = nfds = 0 allocated_nfds = fds = (GPollFD *) 0x8f62c00 __PRETTY_FUNCTION__ = "g_main_context_iterate" #8 0xb77b6361 in IA__g_main_context_pending (context=0x851a2d0) at /build/buildd/glib2.0-2.20.1/glib/gmain.c:2476 retval = #9 0xb7c936a1 in IA__gtk_events_pending () at /build/buildd/gtk+2.0-2.16.1/gtk/gtkmain.c:1283 result = #10 0x080e1b25 in XTread_socket (terminal=0x85ba560, expected=1, hold_quit=0xbf84e6f4) at xterm.c:7263 count = 0 #11 0x08124a0e in read_avail_input (expected=1) at keyboard.c:7093 nr = hold_quit = { kind = NO_EVENT, code = 0, part = scroll_bar_above_handle, modifiers = 0, x = 0, y = 0, timestamp = 0, padding = {0x0, 0x0}, frame_or_window = 0, arg = 0 } next = (struct terminal *) 0x85aaa60 nread = 0 err = 0 t = (struct terminal *) 0x85ba560 #12 0x08124b1a in handle_async_input () at keyboard.c:7335 nread = 126 #13 0x08124ce4 in process_pending_signals () at keyboard.c:7351 No locals. #14 0x081c56ad in wait_reading_process_output (time_limit=30, microsecs=0, read_kbd=-1, do_display=1, wait_for_cell=137932057, wait_proc=0x0, just_wait_proc=0) at process.c:4566 timeout_reduced_for_timers = 0 channel = 6 nfds = 1 Available = { fds_bits = {256, 0 } } Connecting = { fds_bits = {0 } } check_connect = 0 check_delay = 0 no_avail = 6 xerrno = 4 proc = 0 timeout = { tv_sec = 27, tv_usec = 359730 } end_time = { tv_sec = 1249684951, tv_usec = 389145 } wait_channel = -1 got_some_input = 1 #15 0x08057908 in sit_for (timeout=240, reading=1, do_display=1) at dispnew.c:6644 sec = 30 usec = 0 #16 0x08127477 in read_char (commandflag=1, nmaps=2, maps=0xbf84eda0, prev_event=137932057, used_mouse_menu=0xbf84ee50, end_time=0x0) at keyboard.c:2950 tem0 = delay_level = 30 buffer_size = c = 137932057 local_getcjmp = {{ __jmpbuf = {2, 138810852, 1, -1081807528, -837355840, -485490769}, __mask_was_saved = 0, __saved_mask = { __val = {1, 3756253275, 4294967295, 3213159564, 138845896, 3213159784, 135802329, 137961409, 8, 138845900, 0, 0, 0, 0, 0, 0, 0, 0, 139142245, 138270520, 138943313, 3213159656, 135762616, 138943313, 137932057, 137932057, 0, 0, 0, 0, 138943313, 138943313} } }} save_jump = {{ __jmpbuf = {2, 138810852, 1, -1081807528, -837355840, -485490769}, __mask_was_saved = 0, __saved_mask = { __val = {1, 3756253275, 4294967295, 3213159564, 138845896, 3213159784, 135802329, 137961409, 8, 138845900, 3213159312, 3213159316, 3, 137887744, 3756253275, 137932057, 141166576, 138852921, 139142245, 138270520, 138943313, 3213159656, 135762616, 138943313, 137932057, 137932057, 0, 8192, 0, 0, 138943313, 138943313} } }} key_already_recorded = 0 tem = 0 save = previous_echo_area_message = 137932057 also_record = 137932057 reread = 0 polling_stopped_here = orig_kboard = (struct kboard *) 0x85699d8 #17 0x08128a32 in read_key_sequence (keybuf=0xbf84ef04, bufsize=30, prompt=137932057, dont_downcase_last=0, can_return_switch_frame=1, fix_current_buffer=1) at keyboard.c:9460 interrupted_kboard = (KBOARD *) 0x85699d8 key = 137957916 used_mouse_menu = 0 echo_local_start = 0 last_real_key_start = 0 keys_local_start = 0 local_first_binding = 0 from_string = 137932057 count = 2 t = 0 echo_start = 0 keys_start = 0 nmaps = 2 nmaps_allocated = 2 defs = (Lisp_Object * volatile) 0xbf84ed80 submaps = (Lisp_Object * volatile) 0xbf84eda0 orig_local_map = 140836941 orig_keymap = 137932057 localized_local_map = 0 first_binding = 0 first_unbound = 31 mock_input = 0 fkey = { parent = 138253677, map = 138253677, start = 0, end = 0 } keytran = { parent = 137925501, map = 137925501, start = 0, end = 0 } indec = { parent = 138253685, map = 138253685, start = 0, end = 0 } shift_translated = 0 delayed_switch_frame = 137932057 original_uppercase = 32 original_uppercase_position = -1 starting_buffer = (struct buffer *) 0x8391218 fake_prefixed_keys = 137932057 #18 0x0812a693 in command_loop_1 () at keyboard.c:1642 cmd = lose = 138474920 nonundocount = 0 keybuf = {137932105, -1081807034, 137932057, 0, 137932057, -1081806968, 135413816, 140940237, -1081807034, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1081807004, -1081807168, 0, -65536, 137932057, 138888001, -538714021, 0, 138474920, 138474904, -538714021} i = 138474920 prev_modiff = 0 prev_buffer = (struct buffer *) 0x0 already_adjusted = 0 #19 0x08188870 in internal_condition_case (bfun=0x812a4b0 , handlers=137975193, hfun=0x8123f50 ) at eval.c:1512 val = c = { tag = 137932057, val = 137932057, next = 0xbf84f0b0, gcpro = 0x0, jmp = {{ __jmpbuf = {0, 138474920, 138474904, -1081806728, -836790592, -154085969}, __mask_was_saved = 0, __saved_mask = { __val = {3086286836, 3070294640, 30, 3213160180, 3086205101, 140035264, 3213160092, 3074280011, 3075268596, 3075273024, 3086270536, 3213160128, 3074295222, 276967387, 3076992320, 8655230, 59, 3213160784, 3213160492, 3213160784, 3213160632, 135485316, 2, 3213160644, 3213160492, 0, 0, 0, 0, 0, 0, 0} } }}, backlist = 0x0, handlerlist = 0x0, lisp_eval_depth = 0, pdlcount = 2, poll_suppress_count = 1, interrupt_input_blocked = 0, byte_stack = 0x0 } h = { handler = 137975193, var = 137932057, chosen_clause = 137932105, tag = 0xbf84ef9c, next = 0x0 } #20 0x081234a5 in command_loop_2 () at keyboard.c:1359 val = 126 #21 0x0818894a in internal_catch (tag=137971217, func=0x8123480 , arg=137932057) at eval.c:1248 c = { tag = 137971217, val = 137932057, next = 0x0, gcpro = 0x0, jmp = {{ __jmpbuf = {0, 138474920, 138474904, -1081806472, -836634944, -153956945}, __mask_was_saved = 0, __saved_mask = { __val = {0, 0, 0, 0, 0, 3075273192, 3075152686, 3075159464, 3075146958, 3075146778, 0, 0, 0, 3075273080, 177, 22, 0, 1, 139572448, 0, 138172384, 138170690, 137957912, 3213160808, 135764507, 138172385, 138170690, 137932057, 137957912, 137932081, 138170688, 0} } }}, backlist = 0x0, handlerlist = 0x0, lisp_eval_depth = 0, pdlcount = 2, poll_suppress_count = 1, interrupt_input_blocked = 0, byte_stack = 0x0 } #22 0x08123d9f in command_loop () at keyboard.c:1338 No locals. #23 0x0812415b in recursive_edit_1 () at keyboard.c:953 val = #24 0x081242a4 in Frecursive_edit () at keyboard.c:1015 buffer = 137932057 #25 0x08119ee7 in main (argc=3, argv=0xbf84f584) at emacs.c:1852 dummy = 140221632 stack_bottom_variable = 8 '\b' do_initial_setlocale = 1 skip_args = 1 rlim = { rlim_cur = 8388608, rlim_max = 18446744073709551615 } no_loadup = 0 junk = 0x0 dname_arg = 0x0 ---------- END CUT ---------- In GNU Emacs 23.1.1 (i686-pc-linux-gnu, GTK+ Version 2.16.1) of 2009-07-30 on phanatique Windowing system distributor `The X.Org Foundation', version 11.0.10600000 Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default-enable-multibyte-characters: t Major mode: Python Minor modes in effect: diff-auto-refine-mode: t iswitchb-mode: t shell-dirtrack-mode: t display-battery-mode: t display-time-mode: t window-number-mode: t tooltip-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t Recent input: M-v C-c 3 M-v C-l C-n C-n C-e C-p C-p C-p C-p C-p C-p C-p C-c 1 C-s r e a d P l a n C-s C-n C-s r e a d I n i t P l a n C-s C-g C-c 2 C-c 3 C-a C-e C-c ` C-g C-g C-c 1 M-v C-l C-v C-c 3 C-v C-l C-/ M-v C-v C-v C-v C-v C-l C-n C-n C-n C-c 1 M-< C-s U p d a t e C-n C-c 2 C-x b m a M-< C-s U I p d a t e C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-n C-x 0 C-x + M-x r e p o r SPC b e m b C-g M-x s e r v e r SPC s t k i l l C-g M-p M-x M-p Recent messages: Quit Mark set [2 times] Mark saved where search started [3 times] Quit [3 times] Undo! Mark set Mark saved where search started Mark set Mark saved where search started Quit Quit