From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Carsten Mattner Newsgroups: gmane.emacs.devel Subject: Re: C-g crash in C-x C-f (OSX Lion) Date: Sat, 17 Dec 2011 16:39:24 +0100 Message-ID: References: <4EEB48B2.9090602@swipnet.se> <83liqc1tac.fsf@gnu.org> <83fwgk1atk.fsf@gnu.org> <838vmb1tu6.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1324136378 32689 80.91.229.12 (17 Dec 2011 15:39:38 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 17 Dec 2011 15:39:38 +0000 (UTC) Cc: Emacs developers To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 17 16:39:32 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RbwMF-0003S1-KJ for ged-emacs-devel@m.gmane.org; Sat, 17 Dec 2011 16:39:31 +0100 Original-Received: from localhost ([::1]:55888 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbwMF-0001zE-5b for ged-emacs-devel@m.gmane.org; Sat, 17 Dec 2011 10:39:31 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:42448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbwMB-0001yy-UI for emacs-devel@gnu.org; Sat, 17 Dec 2011 10:39:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RbwMB-0007hI-0Z for emacs-devel@gnu.org; Sat, 17 Dec 2011 10:39:27 -0500 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:47530) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbwM9-0007gw-GM; Sat, 17 Dec 2011 10:39:25 -0500 Original-Received: by iacb35 with SMTP id b35so5055645iac.0 for ; Sat, 17 Dec 2011 07:39:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=9dNZO76vkg0E4s2cknXTV1YHaFNYuBKSemQ2tEP4X54=; b=rE8bOnBgJJQ2Fshd14j8JGjlBLUk3I0ADfjzX7FiFmNrKM26KBPeD1fN0e/w/57+zO MuKLj07Nw3O644yx3tPbAFG41kc7Ar/wPwLC4Yz3Fb8RDeogPGYwyRg19Lyqg+zDDJ4Y l/TN/bisqhi8WlOEds3z9NykTHCAQj+pOgpfA= Original-Received: by 10.50.94.170 with SMTP id dd10mr15647177igb.41.1324136364189; Sat, 17 Dec 2011 07:39:24 -0800 (PST) Original-Received: by 10.50.6.165 with HTTP; Sat, 17 Dec 2011 07:39:24 -0800 (PST) In-Reply-To: <838vmb1tu6.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.169 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:146771 Archived-At: On Sat, Dec 17, 2011 at 9:32 AM, Eli Zaretskii wrote: >> From: Andreas Schwab >> Cc: Carsten Mattner , =A0emacs-devel@gnu.= org >> Date: Fri, 16 Dec 2011 22:24:26 +0100 >> >> Eli Zaretskii writes: >> >> > How come the x coordinate of an event could be passed to >> > ns_string_to_symbol as a string, no matter how it is type-cast?? >> >> Because Fx_own_selection_internal put it there. >> >> (Get your barf bag ready!) > > Thanks for the heads-up, I needed that bag. > > So the question now is why that string comes out as NULL. =A0This > happens in this code in x-own-selection-internal: > > =A0pb =3D[NSPasteboard pasteboardWithName: symbol_to_nsstring (selection_= name)]; > > and the value of pb gets later put into the event's x member: > > =A0/* XXX An evil hack, but a necessary one I fear XXX */ > =A0{ > =A0 =A0struct input_event ev; > =A0 =A0ev.kind =3D SELECTION_REQUEST_EVENT; > =A0 =A0ev.modifiers =3D 0; > =A0 =A0ev.code =3D 0; > =A0 =A0*(EMACS_INT*)(&(ev.x)) =3D (EMACS_INT)pb; // FIXME: BIG UGLY HACK!= ! > =A0 =A0*(EMACS_INT*)(&(ev.y)) =3D (EMACS_INT)NSStringPboardType; > =A0 =A0ns_handle_selection_request (&ev); > =A0} > > Now, this part of the backtrace: > > =A0#4 =A00x00285202 in Fx_own_selection_internal (selection_name=3D277441= 62, > =A0selection_value=3D39954401) at nsselect.m:425 > =A0 =A0 =A0 =A0 =A0ev =3D { > =A0 =A0 =A0 =A0 =A0 =A0kind =3D SELECTION_REQUEST_EVENT, > =A0 =A0 =A0 =A0 =A0 =A0code =3D 0, > =A0 =A0 =A0 =A0 =A0 =A0part =3D 1771886, > =A0 =A0 =A0 =A0 =A0 =A0modifiers =3D 0, > =A0 =A0 =A0 =A0 =A0 =A0x =3D 0, > =A0 =A0 =A0 =A0 =A0 =A0y =3D -1396380776, > =A0 =A0 =A0 =A0 =A0 =A0timestamp =3D 1, > =A0 =A0 =A0 =A0 =A0 =A0padding =3D {0x4, 0x1a6ba22}, > =A0 =A0 =A0 =A0 =A0 =A0frame_or_window =3D 27783754, > =A0 =A0 =A0 =A0 =A0 =A0arg =3D 27703842 > =A0 =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0 =A0pb =3D (id) 0x0 > > indicates that pb comes out as NULL and gets put into ev.x as zero. > So the question is: what is selection_name, whose value is 27744162, > and which caused symbol_to_nsstring to return NULL? > > Carsten, if you still have the crashed session, please go to the stack > frame showing the call to Fx_own_selection_internal (in the above > case, this is frame #4), by typing "frame N" at the GDB prompt (where > N is the number of the frame), and then type these commands: > > =A0(gdb) p selection_name > =A0(gdb) xtype > > I expect the last command to say "Lisp_Symbol", in which case please > type > > =A0(gdb) xsymbol > > to show what symbol is that. > > If the crashed session is no longer available, make it crash as soon > as possible and then do the above. New session same #4 for that call (gdb) frame 4 #4 0x00285202 in Fx_own_selection_internal (selection_name=3D27744162, selection_value=3D78814449) at nsselect.m:425 425 ns_handle_selection_request (&ev); Current language: auto; currently objective-c (gdb) p selection_name $1 =3D 27744162 (gdb) xtype Undefined command: "xtype". Try "help". (gdb) xsymbol Undefined command: "xsymbol". Try "help". (gdb) Could gdb be too old for xsymbol/xtype commands? Are those aliases? GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Mon Aug 8 20:32:45 UTC 2= 011) Copyright 2004 Free Software Foundation, Inc. Apple prefers lldb and I have that ready and also could build lldb from svn trunk if there's a reason to do so.