From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 29 21:55:39 2013 Received: (at submit) by debbugs.gnu.org; 30 Mar 2013 01:55:39 +0000 Received: from localhost ([127.0.0.1]:51767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1ULl18-0004Rk-OW for submit@debbugs.gnu.org; Fri, 29 Mar 2013 21:55:39 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58959) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1ULkzF-0004OO-E8 for submit@debbugs.gnu.org; Fri, 29 Mar 2013 21:53:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULkwc-0007vn-Km for submit@debbugs.gnu.org; Fri, 29 Mar 2013 21:51:02 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:37010) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULkwc-0007vh-FR for submit@debbugs.gnu.org; Fri, 29 Mar 2013 21:50:58 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULkwY-0001vs-9Q for bug-gnu-emacs@gnu.org; Fri, 29 Mar 2013 21:50:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULkwU-0007s8-Gc for bug-gnu-emacs@gnu.org; Fri, 29 Mar 2013 21:50:54 -0400 Received: from mail-pd0-f180.google.com ([209.85.192.180]:41849) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULkwU-0007qu-39 for bug-gnu-emacs@gnu.org; Fri, 29 Mar 2013 21:50:50 -0400 Received: by mail-pd0-f180.google.com with SMTP id g10so464424pdj.39 for ; Fri, 29 Mar 2013 18:50:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:content-type:content-transfer-encoding:subject :message-id:date:to:mime-version:x-mailer; bh=5HtkPk0mxk96j2OqZGIsrO555V8VEyIIbeN8a+RqGA0=; b=UsTWGyDN3WQ6GpDKfvLmgVWU2Oy8Yf5v49DpuWt6UYSnmK69tALP/NHowUEIB5g4w/ zXtgvnfVOKCywtxLGWz7f/UZgtAjWmLi8AXDZSCv2beNoGvCqS0ClzrS09zbGbgmCwZt Na8fSGRiWPV+i69c2vOa8APgtz8S9ej8f8s7kT20thNG+/fZmugnsWTzYiUEFoyZ7bJx cchulAQKj9GeC1uwGDiepEaSUOWz4fN7Vp5fOS/L0I9NsG2zSZ949Lqsj1Vwn4fT5uxh HgrSl2rRvTZegLSkdWXDQ4fxy3hgd1V4MGvarh9hKuvAEazu4N8Wv7DHWA9nbAW0E+BK 2bLg== X-Received: by 10.68.160.162 with SMTP id xl2mr6540697pbb.29.1364608248049; Fri, 29 Mar 2013 18:50:48 -0700 (PDT) Received: from [192.168.0.13] ([101.164.10.56]) by mx.google.com with ESMTPS id 1sm4675662pbg.18.2013.03.29.18.50.44 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 29 Mar 2013 18:50:45 -0700 (PDT) From: Huw Giddens Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: 24.3.50; Crash switching buffer on TTY emacsclient session of NS emacs Message-Id: <7E427FBA-8A49-4319-A930-829EAC5E0383@gmail.com> Date: Sat, 30 Mar 2013 12:50:41 +1100 To: bug-gnu-emacs@gnu.org Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) X-Mailer: Apple Mail (2.1503) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 29 Mar 2013 21:55:37 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) Emacs crashes sometimes under the following circumstances: * Ensure Emacs not currently running. * Position mouse cursor so that the new Emacs frame will appear under = the cursor. * Start NS emacs session: ./nextstep/Emacs.app/Contents/MacOS/Emacs * Move the cursor out of the new, selected Emacs frame, and click in a new terminal emulator window. * Run "./nextstep/Emacs.app/Contents/MacOS/bin/emacsclient -t" * In the new TTY frame that has opened, C-x b RET; in my case, this should have switched to an existing scala-mode2 buffer, open via desktop mode. Emacs crashes after hitting enter. =46rom my digging through the backtrace, the problem appears to be that we call ns_mouse_position because of a mouse event from the NS frame, inside ns_mouse_position we in some cases ignore the frame passed in (*fp) and instead try and find it ourselves. In this particular case, both last_mouse_frame and dpyinfo->x_focus_frame are false, leading us to call remember_mouse_glpyh on the value of SELECTED_FRAME() which is the TTY frame. We then access the wrong union member and bad things happen. There's a comment on line 1857 of nsterm.m asking if the f->output_data.ns check is still needed, I wonder if this was meant to be instead FRAME_NS_P(f). It strikes me as odd that we receive a mouse event on the NS frame in response to keyboard input on the TTY frame, but I don't understand at all what's actually meant to be happening there. I also think it's odd that the position passed to remember_mouse_glyph is derived from *fp which, as we see here, is not necessarily the same as f. In GNU Emacs 24.3.50.1 (x86_64-apple-darwin12.3.0, NS = apple-appkit-1187.37) of 2013-03-30 on brigitte.local Windowing system distributor `Apple', version 10.3.1187 Configured using: `configure --with-ns CFLAGS=3D'-O0 -g3'' Important settings: value of $LANG: en_AU.UTF-8 locale-coding-system: utf-8-unix default enable-multibyte-characters: t bt full: (gdb) bt full #0 0x00007fff83c47d46 in __kill () No symbol table info available. #1 0x0000000100126675 in terminate_due_to_signal (sig=3D6, = backtrace_limit=3D40) at emacs.c:343 No locals. #2 0x0000000100156883 in emacs_abort () at sysdep.c:2148 No locals. #3 0x00000001002d4145 in ns_term_shutdown (sig=3D11) at nsterm.m:4298 No locals. #4 0x0000000100126975 in shut_down_emacs (sig=3D11, stuff=3D4328534074)= at emacs.c:1932 format =3D "Fatal error %d: " #5 0x0000000100126633 in terminate_due_to_signal (sig=3D11, = backtrace_limit=3D40) at emacs.c:327 No locals. #6 0x0000000100159e28 in handle_fatal_signal (sig=3D11) at = sysdep.c:1649 No locals. #7 0x0000000100159dfa in deliver_thread_signal (sig=3D11, = handler=3D0x100159e10 ) at sysdep.c:1625 old_errno =3D 0 #8 0x000000010015895a in deliver_fatal_thread_signal (sig=3D11) at = sysdep.c:1661 No locals. #9 No symbol table info available. #10 0x0000000100030478 in remember_mouse_glyph (f=3D0x1088de648, = gx=3D809, gy=3D176, rect=3D0x100704388) at xdisp.c:2200 window =3D 4328534074 w =3D (struct window *) 0x7fff8dcef700 end_row =3D (struct glyph_row *) 0x10070ba60 part =3D ON_TEXT area =3D 7391720 width =3D 32767 height =3D -1915816192 r =3D (struct glyph_row *) 0x7fff5fbfe2c0 gr =3D (struct glyph_row *) 0x10070c9e0 x =3D 1 y =3D 17432576 #11 0x00000001002e6771 in ns_mouse_position (fp=3D0x7fff5fbfe430, = insist=3D0, bar_window=3D0x7fff5fbfe428, part=3D0x7fff5fbfe424, = x=3D0x7fff5fbfe418, y=3D0x7fff5fbfe410, time=3D0x7fff5fbfe408) at = nsterm.m:1863 frame =3D 4438026317 tail =3D 4328534074 dpyinfo =3D (struct ns_display_info *) 0x101516e30 view =3D (id) 0x1010a0000 position =3D { x =3D 809.796875, y =3D 176.37109375 } f =3D (struct frame *) 0x1088de648 #12 0x0000000100136770 in kbd_buffer_get_event (kbp=3D0x7fff5fbfe758, = used_mouse_menu=3D0x7fff5fbfef97, end_time=3D0x0) at keyboard.c:4071 bar_window =3D 4296229691 y =3D 0 f =3D (FRAME_PTR) 0x10886e848 part =3D 32767 x =3D 4328534074 t =3D 4296246278 obj =3D 4296233035 #13 0x000000010013266e in read_char (commandflag=3D1, map=3D4337471510, = prev_event=3D4328534074, used_mouse_menu=3D0x7fff5fbfef97, end_time=3D0x0)= at keyboard.c:2766 kb =3D (KBOARD *) 0x10102e4f0 jmpcount =3D 2 save =3D 4320135864 previous_echo_area_message =3D 4328534074 reread =3D false polling_stopped_here =3D true local_getcjmp =3D {7391360, 1, 1606412688, 32767, 1606411504, = 32767, 7391720, 1, 0, 0, 7387744, 1, 7391712, 1, 1251699, 1, 90392416, = 1, 8099, 895, 1606412624, 32767, 1944571, 1, 1606412784, 32767, 7261384, = 1, 22395584, 1, 22381824, 1, 7261384, 1, 22872213, 2, 42505184} gcpro1 =3D { next =3D 0x100b0e0f0, var =3D 0x3f8419c326f10003, nvars =3D 4306574852 } c =3D 4328534074 save_jump =3D {0 } tem =3D -4 also_record =3D 4328534074 gcpro2 =3D { next =3D 0x3, var =3D 0x30, nvars =3D 92464938 } orig_kboard =3D (struct kboard *) 0x10102e4f0 #14 0x0000000100144070 in read_decoded_char (commandflag=3D1, = map=3D4337471510, prev_event=3D4328534074, = used_mouse_menu=3D0x7fff5fbfef97) at keyboard.c:8721 nextevt =3D 4328534074 frame =3D (struct frame *) 0x10014f328 terminal =3D (struct terminal *) 0x7fff5fbfea80 events =3D {140734799801944, 2, 3, 1, 4328534074, 4439623734, = 1157, 12884901887, 4308540880, 4328534074, 4337471494, 4337471510, = 4337471494, 4328581834, 140734799801024, 4296293065} n =3D 0 #15 0x000000010012c672 in read_key_sequence (keybuf=3D0x7fff5fbff1e0, = bufsize=3D30, prompt=3D4328534074, dont_downcase_last=3Dfalse, = can_return_switch_frame=3Dtrue, fix_current_buffer=3Dtrue) at = keyboard.c:9052 interrupted_kboard =3D (KBOARD *) 0x10102e4f0 interrupted_frame =3D (struct frame *) 0x1088de648 key =3D 4296925356 used_mouse_menu =3D false echo_local_start =3D 0 last_real_key_start =3D 0 keys_local_start =3D 0 new_binding =3D 4296928544 echo_start =3D 0 indec =3D { parent =3D 4434918006, map =3D 4434918006, start =3D 0, end =3D 0 } original_uppercase =3D 4370468762 fake_prefixed_keys =3D 4328534074 gcpro1 =3D { next =3D 0xffffffff00000002, var =3D 0xffffffff00000002, nvars =3D 4302238248 } first_unbound =3D 31 mock_input =3D 0 fkey =3D { parent =3D 4434917990, map =3D 4434917990, start =3D 0, end =3D 0 } keytran =3D { parent =3D 4328555942, map =3D 4328555942, start =3D 0, end =3D 0 } count =3D 2 current_binding =3D 4337471510 first_event =3D 4328534074 starting_buffer =3D (struct buffer *) 0x1015d0090 t =3D 0 keys_start =3D 0 shift_translated =3D false delayed_switch_frame =3D 4328534074 original_uppercase_position =3D -1 dummyflag =3D false #16 0x000000010012b056 in command_loop_1 () at keyboard.c:1458 keybuf =3D {96, 392, 140734799803024, 4297066612, 4328534074, = 4328534074, 4328534074, 4370469738, 140734799803024, 4370469738, = 4328534074, 0, 0, -2506436368, 2, 4328534074, 4328662698, 4370598262, = 4299180853, 4328534074, 4370598262, 2, 140734799803088, 4297086197, 2, = 4328534074, 4370469738, 2, 4328534074, 4370598742} i =3D 2 prev_modiff =3D 10 cmd =3D 4387432234 prev_buffer =3D (struct buffer *) 0x101800ab8 already_adjusted =3D false #17 0x0000000100203ddb in internal_condition_case (bfun=3D0x10012ab50 = , handlers=3D4328600218, hfun=3D0x100148b50 ) = at eval.c:1193 val =3D 4370598262 c =3D { tag =3D 4328534074, val =3D 4328534074, next =3D 0x7fff5fbff480, gcpro =3D 0x0, jmp =3D {7391720, 1, 1606415440, 32767, 1606415088, 32767, 0, 0, 0, = 0, 7391696, 1, 7391360, 1, 2112860, 1, 7391720, 1, 8099, 895, = 1606415456, 32767, -1933481746, 32767, 1606415520, 32767, 33993224, 1, = 0, 0, 0, 0, 7387736, 1, 7383292, 1, 1606415520}, backlist =3D 0x0, handlerlist =3D 0x0, lisp_eval_depth =3D 0, pdlcount =3D 2, poll_suppress_count =3D 0, interrupt_input_blocked =3D 0, byte_stack =3D 0x0 } h =3D { handler =3D 4328600218, var =3D 4328534074, chosen_clause =3D 140735554873435, tag =3D 0x7fff5fbff320, next =3D 0x0 } #18 0x0000000100148a49 in command_loop_2 (ignore=3D4328534074) at = keyboard.c:1173 val =3D 4370598262 #19 0x00000001002036b7 in internal_catch (tag=3D4328596362, = func=3D0x100148a20 , arg=3D4328534074) at eval.c:964 c =3D { tag =3D 4328596362, val =3D 4328534074, next =3D 0x0, gcpro =3D 0x0, jmp =3D {7391720, 1, 1606415776, 32767, 1606415488, 32767, 0, 0, 0, = 0, 7391696, 1, 7391360, 1, 2111138, 1, 352, 0, 8099, -64641, 2, -1, 2, = 0, 6886448, 1, 33566778, 1, 1606415712, 32767, 6886448, 1, 25168568, 1, = -2097152, -1, 2}, backlist =3D 0x0, handlerlist =3D 0x0, lisp_eval_depth =3D 0, pdlcount =3D 2, poll_suppress_count =3D 0, interrupt_input_blocked =3D 0, byte_stack =3D 0x0 } #20 0x0000000100129f5b in command_loop () at keyboard.c:1152 No locals. #21 0x0000000100129e1a in recursive_edit_1 () at keyboard.c:785 count =3D 1 val =3D 4328534074 #22 0x000000010012a146 in Frecursive_edit () at keyboard.c:849 count =3D 0 buffer =3D 4328534074 #23 0x0000000100127f20 in main (argc=3D1, argv=3D0x7fff5fbff930) at = emacs.c:1531 stack_bottom_variable =3D 0 '\0' do_initial_setlocale =3D true no_loadup =3D false dummy =3D 0 dumping =3D false junk =3D 0x0 skip_args =3D 0 rlim =3D { rlim_cur =3D 8720000, rlim_max =3D 67104768 } dname_arg =3D 0x0 dname_arg2 =3D = "0=EF=BF=BD_=EF=BF=BD=7F\000\000\001\000\000\000\000\000\000\000\000=EF=BF= =BD_=EF=BF=BD=7F\000\000=EF=BF=BD=EF=BF=BD=EF=BF=BDj=EF=BF=BD=7F\000\000\0= 30=EF=BF=BD_=EF=BF=BD=7F\000\000\030=EF=BF=BD_=EF=BF=BD=7F\000\000\000\000= \000\000\001\000\000\000\r\000\000\000\f\000\000\000@=EF=BF=BD=EF=BF=BDj=EF= =BF=BD=7F\000\000\000=EF=BF=BD=EF=BF=BD\n\000\000\000" ch_to_dir =3D 0x7fff5fbff940 "=EF=BF=BD=EF=BF=BD_=EF=BF=BD=7F" (gdb) From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 30 12:31:36 2013 Received: (at control) by debbugs.gnu.org; 30 Mar 2013 16:31:36 +0000 Received: from localhost ([127.0.0.1]:52920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1ULygn-0004PM-Ud for submit@debbugs.gnu.org; Sat, 30 Mar 2013 12:31:35 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:51128) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1ULygl-0004PF-Ok for control@debbugs.gnu.org; Sat, 30 Mar 2013 12:31:32 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1ULye9-00072v-Bv for control@debbugs.gnu.org; Sat, 30 Mar 2013 12:28:49 -0400 Date: Sat, 30 Mar 2013 12:28:49 -0400 Message-Id: Subject: control message for bug 14092 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -5.5 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.5 (-----) merge 14091 14092 From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 31 06:04:58 2013 Received: (at 14091) by debbugs.gnu.org; 31 Mar 2013 10:04:58 +0000 Received: from localhost ([127.0.0.1]:53701 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UMF8E-0008R7-4D for submit@debbugs.gnu.org; Sun, 31 Mar 2013 06:04:58 -0400 Received: from mail-la0-f52.google.com ([209.85.215.52]:38167) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UMF8A-0008Qx-Ry for 14091@debbugs.gnu.org; Sun, 31 Mar 2013 06:04:56 -0400 Received: by mail-la0-f52.google.com with SMTP id fs12so1428819lab.25 for <14091@debbugs.gnu.org>; Sun, 31 Mar 2013 03:02:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:content-type:content-transfer-encoding :subject:date:message-id:cc:to:mime-version:x-mailer; bh=x636TwgFNGwlpdPyoiPFU917Pd5k7OP7aWTFf2M9vxA=; b=ogysjQipgNZXdHnk7DthW3L97Axl1hXgkR9BjTc1ag91qcdS8P6WnW1plAHpsv2RMC KK7RyOlv+1jjnmymYFTyGAVYt4/1lhLmLed3CyTWzh8SFI0EBORabDIklxwEWsfx4qL1 VoQlYdjO50sVqKnBXCYYTxZZyK607WsyM1JqjaLu+3ZgeB4yqlqMH4AbvaHYDoUQWc/I XKWJzYL6LbrqES91UjryHMY2fVuWBLjvjH8TcVHICtrU1J/oCeoVCNG/v1LTEnD/gaoT 3AbN5sD1lDQ5AeE/9egpev93EJ1iY7K9FdvVE+zwjA2GsC90FdPEjR26MK6U99ruWqGg pAVg== X-Received: by 10.152.111.67 with SMTP id ig3mr3881925lab.41.1364724127194; Sun, 31 Mar 2013 03:02:07 -0700 (PDT) Received: from [172.20.199.13] (h-46-59-42-18.na.cust.bahnhof.se. [46.59.42.18]) by mx.google.com with ESMTPS id z1sm3762397lbk.2.2013.03.31.03.02.05 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 31 Mar 2013 03:02:06 -0700 (PDT) From: =?iso-8859-1?Q?Jan_Dj=E4rv?= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: Re: 24.3.50; Crash switching buffer on TTY emacsclient session of NS emacs Date: Sun, 31 Mar 2013 12:02:04 +0200 Message-Id: <1EE74324-2F3C-4BB1-BA97-26D6D89EEB9A@swipnet.se> To: Huw Giddens Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) X-Mailer: Apple Mail (2.1503) X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 14091 Cc: 14091@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Hello. > Emacs crashes sometimes under the following circumstances: >=20 > * Ensure Emacs not currently running. > * Position mouse cursor so that the new Emacs frame will appear under = the cursor. > * Start NS emacs session: ./nextstep/Emacs.app/Contents/MacOS/Emacs > * Move the cursor out of the new, selected Emacs frame, and click in a > new terminal emulator window. > * Run "./nextstep/Emacs.app/Contents/MacOS/bin/emacsclient -t" > * In the new TTY frame that has opened, C-x b RET; in my case, this > should have switched to an existing scala-mode2 buffer, open via > desktop mode. Emacs crashes after hitting enter. I can not reproduce it. The recepie depends on many things in your = environment, for starters, you obviously have server-start in .emacs (or = some other startup file). Can you reproduce this starting with Emacs = -Q? >=20 > =46rom my digging through the backtrace, the problem appears to be = that > we call ns_mouse_position because of a mouse event from the NS frame, > inside ns_mouse_position we in some cases ignore the frame passed in > (*fp) and instead try and find it ourselves. In this particular case, > both last_mouse_frame and dpyinfo->x_focus_frame are false, leading us > to call remember_mouse_glpyh on the value of SELECTED_FRAME() which is > the TTY frame. We then access the wrong union member and bad things > happen. >=20 > There's a comment on line 1857 of nsterm.m asking if the > f->output_data.ns check is still needed, I wonder if this was meant to > be instead FRAME_NS_P(f). It strikes me as odd that we receive a mouse > event on the NS frame in response to keyboard input on the TTY frame, > but I don't understand at all what's actually meant to be happening > there. I also think it's odd that the position passed to > remember_mouse_glyph is derived from *fp which, as we see here, is not > necessarily the same as f. Another frame may have grabbed the mouse, but the event comes to *fp. = We report the position for that other frame, and set *fp to it. The f->output_data.ns is wrong though, I will change that. Jan D. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 31 07:21:50 2013 Received: (at 14091) by debbugs.gnu.org; 31 Mar 2013 11:21:50 +0000 Received: from localhost ([127.0.0.1]:53740 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UMGKb-00024V-WA for submit@debbugs.gnu.org; Sun, 31 Mar 2013 07:21:50 -0400 Received: from mail-da0-f53.google.com ([209.85.210.53]:62048) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UMGKY-00024I-Jf for 14091@debbugs.gnu.org; Sun, 31 Mar 2013 07:21:47 -0400 Received: by mail-da0-f53.google.com with SMTP id n34so718107dal.40 for <14091@debbugs.gnu.org>; Sun, 31 Mar 2013 04:18:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:content-type:mime-version:subject:from:in-reply-to:date :cc:content-transfer-encoding:message-id:references:to:x-mailer; bh=h6k/VM5441bDh3rOW6ZjVOK9zL6yiPhdebV+ooBV/GI=; b=jaDlnePFDPK+4BR12hsK8GRQdVXme7KVYD83AbInk7EbO0dX+a5+1B+lJI9IJocrpa iofSnhzbQU4wKzBvpy8bJdm1XldIm3ED11j3xMhu297h2QFPH16NLtI+O4CB4+zdypJ3 O9xiFNeR2mOV+hOJm8gsMfeolSPP56uoJ+0lbY5r2v5Gt1NDI0CgBcYiwhKWAi67RHV4 HbfSsKuWnkp6kiKxQY+9gSJ1MGg9lwRlYRx9JZJC0Z/irSvt9assYjKafRYT/608f32O NoZnilac6n0G4A+wFMR1jkaLD8eS1p352t2s6wboBR+VVHFrrTpoBMpSi27Kc85tD19+ RwUw== X-Received: by 10.66.87.234 with SMTP id bb10mr13687708pab.203.1364728739061; Sun, 31 Mar 2013 04:18:59 -0700 (PDT) Received: from [192.168.0.13] ([101.164.10.56]) by mx.google.com with ESMTPS id tm1sm9756403pbc.11.2013.03.31.04.18.54 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 31 Mar 2013 04:18:56 -0700 (PDT) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: 24.3.50; Crash switching buffer on TTY emacsclient session of NS emacs From: Huw Giddens In-Reply-To: <1EE74324-2F3C-4BB1-BA97-26D6D89EEB9A@swipnet.se> Date: Sun, 31 Mar 2013 22:18:52 +1100 Content-Transfer-Encoding: quoted-printable Message-Id: <45114ED2-0BED-4C97-8501-1113D25A09A5@gmail.com> References: <1EE74324-2F3C-4BB1-BA97-26D6D89EEB9A@swipnet.se> To: =?iso-8859-1?Q?Jan_Dj=E4rv?= X-Mailer: Apple Mail (2.1503) X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 14091 Cc: 14091@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Hi Jan, Thanks for having a look at this. I haven't succeeded in reproducing it = in either a clean environment or a minimal one with just server, = desktop, and a few other things. Even with my full environment I can = only reproduce it maybe one time every thirty or so. I still have a core = from the crash the stacktrace in the report is from, along with the = sandbox and binaries used to build it. I can give that to you if you'd = like, but it does weigh in north of 200 megs compressed and probably = depends on my copies of libxml2/gnutls. On 31/03/2013, at 9:02 PM, Jan Dj=E4rv wrote: > Hello. >=20 >> Emacs crashes sometimes under the following circumstances: >>=20 >> * Ensure Emacs not currently running. >> * Position mouse cursor so that the new Emacs frame will appear under = the cursor. >> * Start NS emacs session: ./nextstep/Emacs.app/Contents/MacOS/Emacs >> * Move the cursor out of the new, selected Emacs frame, and click in = a >> new terminal emulator window. >> * Run "./nextstep/Emacs.app/Contents/MacOS/bin/emacsclient -t" >> * In the new TTY frame that has opened, C-x b RET; in my case, this >> should have switched to an existing scala-mode2 buffer, open via >> desktop mode. Emacs crashes after hitting enter. >=20 > I can not reproduce it. The recepie depends on many things in your = environment, for starters, you obviously have server-start in .emacs (or = some other startup file). Can you reproduce this starting with Emacs = -Q? >=20 >>=20 >> =46rom my digging through the backtrace, the problem appears to be = that >> we call ns_mouse_position because of a mouse event from the NS frame, >> inside ns_mouse_position we in some cases ignore the frame passed in >> (*fp) and instead try and find it ourselves. In this particular case, >> both last_mouse_frame and dpyinfo->x_focus_frame are false, leading = us >> to call remember_mouse_glpyh on the value of SELECTED_FRAME() which = is >> the TTY frame. We then access the wrong union member and bad things >> happen. >>=20 >> There's a comment on line 1857 of nsterm.m asking if the >> f->output_data.ns check is still needed, I wonder if this was meant = to >> be instead FRAME_NS_P(f). It strikes me as odd that we receive a = mouse >> event on the NS frame in response to keyboard input on the TTY frame, >> but I don't understand at all what's actually meant to be happening >> there. I also think it's odd that the position passed to >> remember_mouse_glyph is derived from *fp which, as we see here, is = not >> necessarily the same as f. >=20 > Another frame may have grabbed the mouse, but the event comes to *fp. = We report the position for that other frame, and set *fp to it. >=20 > The f->output_data.ns is wrong though, I will change that. >=20 > Jan D. >=20 From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 01 06:09:42 2013 Received: (at 14091) by debbugs.gnu.org; 1 Apr 2013 10:09:43 +0000 Received: from localhost ([127.0.0.1]:55511 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UMbgM-0006cc-8q for submit@debbugs.gnu.org; Mon, 01 Apr 2013 06:09:42 -0400 Received: from mailout.melmac.se ([62.20.26.67]:38710) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UMbgJ-0006cT-8U for 14091@debbugs.gnu.org; Mon, 01 Apr 2013 06:09:40 -0400 Received: from mail01.melmac.se (mail01.melmac.se [62.20.26.80]) by mailout.melmac.se (Postfix) with ESMTP id 7B69E9851 for <14091@debbugs.gnu.org>; Mon, 1 Apr 2013 12:06:43 +0200 (CEST) Received: (qmail 23070 invoked by uid 89); 1 Apr 2013 10:06:24 -0000 Received: from h-46-59-42-18.na.cust.bahnhof.se (HELO coolsville.localdomain) (boel.djarv@bdtv.se@46.59.42.18) by mail01.melmac.se with ESMTPA; 1 Apr 2013 10:06:24 -0000 Received: from anon-164-68.vpn.ipredator.se (anon-164-68.vpn.ipredator.se [93.182.164.68]) by coolsville.localdomain (Postfix) with ESMTPSA id CA82D7FA058; Mon, 1 Apr 2013 12:06:40 +0200 (CEST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: 24.3.50; Crash switching buffer on TTY emacsclient session of NS emacs From: =?iso-8859-1?Q?Jan_Dj=E4rv?= In-Reply-To: <45114ED2-0BED-4C97-8501-1113D25A09A5@gmail.com> Date: Mon, 1 Apr 2013 12:06:37 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <1B37402B-158F-48F9-9349-6D4DD85BA996@swipnet.se> References: <1EE74324-2F3C-4BB1-BA97-26D6D89EEB9A@swipnet.se> <45114ED2-0BED-4C97-8501-1113D25A09A5@gmail.com> To: Huw Giddens X-Mailer: Apple Mail (2.1503) X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 14091 Cc: 14091@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) Hello. 31 mar 2013 kl. 13:18 skrev Huw Giddens : > Hi Jan, >=20 > Thanks for having a look at this. I haven't succeeded in reproducing = it in either a clean environment or a minimal one with just server, = desktop, and a few other things. Even with my full environment I can = only reproduce it maybe one time every thirty or so. I still have a core = from the crash the stacktrace in the report is from, along with the = sandbox and binaries used to build it. I can give that to you if you'd = like, but it does weigh in north of 200 megs compressed and probably = depends on my copies of libxml2/gnutls. >=20 I'm confident that FRAME_NS_P fixes the crashes. But why a command in a = terminal frame generates an event in a GUI frame is a mystery, that = probably can't be deduced by looking at a core in gdb. Jan D. > On 31/03/2013, at 9:02 PM, Jan Dj=E4rv wrote: >=20 >> Hello. >>=20 >>> Emacs crashes sometimes under the following circumstances: >>>=20 >>> * Ensure Emacs not currently running. >>> * Position mouse cursor so that the new Emacs frame will appear = under the cursor. >>> * Start NS emacs session: ./nextstep/Emacs.app/Contents/MacOS/Emacs >>> * Move the cursor out of the new, selected Emacs frame, and click in = a >>> new terminal emulator window. >>> * Run "./nextstep/Emacs.app/Contents/MacOS/bin/emacsclient -t" >>> * In the new TTY frame that has opened, C-x b RET; in my case, this >>> should have switched to an existing scala-mode2 buffer, open via >>> desktop mode. Emacs crashes after hitting enter. >>=20 >> I can not reproduce it. The recepie depends on many things in your = environment, for starters, you obviously have server-start in .emacs (or = some other startup file). Can you reproduce this starting with Emacs = -Q? >>=20 >>>=20 >>> =46rom my digging through the backtrace, the problem appears to be = that >>> we call ns_mouse_position because of a mouse event from the NS = frame, >>> inside ns_mouse_position we in some cases ignore the frame passed in >>> (*fp) and instead try and find it ourselves. In this particular = case, >>> both last_mouse_frame and dpyinfo->x_focus_frame are false, leading = us >>> to call remember_mouse_glpyh on the value of SELECTED_FRAME() which = is >>> the TTY frame. We then access the wrong union member and bad things >>> happen. >>>=20 >>> There's a comment on line 1857 of nsterm.m asking if the >>> f->output_data.ns check is still needed, I wonder if this was meant = to >>> be instead FRAME_NS_P(f). It strikes me as odd that we receive a = mouse >>> event on the NS frame in response to keyboard input on the TTY = frame, >>> but I don't understand at all what's actually meant to be happening >>> there. I also think it's odd that the position passed to >>> remember_mouse_glyph is derived from *fp which, as we see here, is = not >>> necessarily the same as f. >>=20 >> Another frame may have grabbed the mouse, but the event comes to *fp. = We report the position for that other frame, and set *fp to it. >>=20 >> The f->output_data.ns is wrong though, I will change that. >>=20 >> Jan D. >>=20 From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 12 02:08:19 2014 Received: (at control) by debbugs.gnu.org; 12 Aug 2014 06:08:19 +0000 Received: from localhost ([127.0.0.1]:39949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XH5Fq-0000ts-To for submit@debbugs.gnu.org; Tue, 12 Aug 2014 02:08:19 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:34445 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XH5Fo-0000tj-As for control@debbugs.gnu.org; Tue, 12 Aug 2014 02:08:17 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1XH5Fo-00085Q-1b for control@debbugs.gnu.org; Tue, 12 Aug 2014 02:08:16 -0400 Date: Tue, 12 Aug 2014 02:08:16 -0400 Message-Id: Subject: control message for bug 14091 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -5.7 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.7 (-----) close 14091 24.4 From unknown Sat Sep 06 04:31:33 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 09 Sep 2014 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator