From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: C-g crash in C-x C-f (OSX Lion) Date: Sat, 17 Dec 2011 10:32:49 +0200 Message-ID: <838vmb1tu6.fsf@gnu.org> References: <4EEB48B2.9090602@swipnet.se> <83liqc1tac.fsf@gnu.org> <83fwgk1atk.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1324110776 12314 80.91.229.12 (17 Dec 2011 08:32:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 17 Dec 2011 08:32:56 +0000 (UTC) Cc: carstenmattner@googlemail.com, emacs-devel@gnu.org To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 17 09:32:52 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 1RbphM-0006JJ-4t for ged-emacs-devel@m.gmane.org; Sat, 17 Dec 2011 09:32:52 +0100 Original-Received: from localhost ([::1]:38348 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbphL-0007cX-MK for ged-emacs-devel@m.gmane.org; Sat, 17 Dec 2011 03:32:51 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:52477) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbphJ-0007cO-6Q for emacs-devel@gnu.org; Sat, 17 Dec 2011 03:32:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RbphH-0006d0-Ku for emacs-devel@gnu.org; Sat, 17 Dec 2011 03:32:49 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:51416) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbphH-0006ct-CM for emacs-devel@gnu.org; Sat, 17 Dec 2011 03:32:47 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0LWC00600AADNN00@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Sat, 17 Dec 2011 10:32:45 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.127.39.203]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LWC006SSAEK0RC0@a-mtaout20.012.net.il>; Sat, 17 Dec 2011 10:32:45 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.166 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:146764 Archived-At: > From: Andreas Schwab > Cc: Carsten Mattner , emacs-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. This happens in this code in x-own-selection-internal: pb =[NSPasteboard pasteboardWithName: symbol_to_nsstring (selection_name)]; and the value of pb gets later put into the event's x member: /* XXX An evil hack, but a necessary one I fear XXX */ { struct input_event ev; ev.kind = SELECTION_REQUEST_EVENT; ev.modifiers = 0; ev.code = 0; *(EMACS_INT*)(&(ev.x)) = (EMACS_INT)pb; // FIXME: BIG UGLY HACK!! *(EMACS_INT*)(&(ev.y)) = (EMACS_INT)NSStringPboardType; ns_handle_selection_request (&ev); } Now, this part of the backtrace: #4 0x00285202 in Fx_own_selection_internal (selection_name=27744162, selection_value=39954401) at nsselect.m:425 ev = { kind = SELECTION_REQUEST_EVENT, code = 0, part = 1771886, modifiers = 0, x = 0, y = -1396380776, timestamp = 1, padding = {0x4, 0x1a6ba22}, frame_or_window = 27783754, arg = 27703842 } pb = (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: (gdb) p selection_name (gdb) xtype I expect the last command to say "Lisp_Symbol", in which case please type (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.