From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Huw Giddens Newsgroups: gmane.emacs.bugs Subject: bug#14091: 24.3.50; Crash switching buffer on TTY emacsclient session of NS emacs Date: Sun, 31 Mar 2013 22:18:52 +1100 Message-ID: <45114ED2-0BED-4C97-8501-1113D25A09A5@gmail.com> References: <1EE74324-2F3C-4BB1-BA97-26D6D89EEB9A@swipnet.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1364728764 27588 80.91.229.3 (31 Mar 2013 11:19:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 31 Mar 2013 11:19:24 +0000 (UTC) Cc: 14091@debbugs.gnu.org To: Jan =?UTF-8?Q?Dj=C3=A4rv?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Mar 31 13:19:51 2013 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 1UMGIg-0002pp-Jz for geb-bug-gnu-emacs@m.gmane.org; Sun, 31 Mar 2013 13:19:50 +0200 Original-Received: from localhost ([::1]:44614 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMGII-0002vI-59 for geb-bug-gnu-emacs@m.gmane.org; Sun, 31 Mar 2013 07:19:26 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44885) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMGIB-0002m0-11 for bug-gnu-emacs@gnu.org; Sun, 31 Mar 2013 07:19:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UMGI7-0001NK-Nn for bug-gnu-emacs@gnu.org; Sun, 31 Mar 2013 07:19:18 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49631) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMGI7-0001NE-KT for bug-gnu-emacs@gnu.org; Sun, 31 Mar 2013 07:19:15 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UMGKn-000251-OF for bug-gnu-emacs@gnu.org; Sun, 31 Mar 2013 07:22:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Huw Giddens Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 31 Mar 2013 11:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14091 X-GNU-PR-Package: emacs,ns X-GNU-PR-Keywords: Original-Received: via spool by 14091-submit@debbugs.gnu.org id=B14091.13647289107973 (code B ref 14091); Sun, 31 Mar 2013 11:22:01 +0000 Original-Received: (at 14091) by debbugs.gnu.org; 31 Mar 2013 11:21:50 +0000 Original-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 Original-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 Original-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) Original-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) In-Reply-To: <1EE74324-2F3C-4BB1-BA97-26D6D89EEB9A@swipnet.se> X-Mailer: Apple Mail (2.1503) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.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:73033 Archived-At: 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