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:49:22 +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 1324136978 4042 80.91.229.12 (17 Dec 2011 15:49:38 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 17 Dec 2011 15:49: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:49: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 1RbwVu-0006zY-F3 for ged-emacs-devel@m.gmane.org; Sat, 17 Dec 2011 16:49:30 +0100 Original-Received: from localhost ([::1]:51317 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbwVu-0002zZ-0b for ged-emacs-devel@m.gmane.org; Sat, 17 Dec 2011 10:49:30 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:52492) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbwVq-0002zJ-BU for emacs-devel@gnu.org; Sat, 17 Dec 2011 10:49:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RbwVp-0000in-5a for emacs-devel@gnu.org; Sat, 17 Dec 2011 10:49:26 -0500 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:49402) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbwVn-0000ia-M3; Sat, 17 Dec 2011 10:49:23 -0500 Original-Received: by iacb35 with SMTP id b35so5066471iac.0 for ; Sat, 17 Dec 2011 07:49:22 -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=cje8VB8bTIXGTgciixeuM7hkWewDDXbdeMF6XVvwJiQ=; b=tZszYY9jTk9Si0mT5IE3K5mBVd0SLmzkI7hsBQ0MLaQviZMWdmbFROEtLynhIDVZpx IvzA9Qd7GksC7qBvGIoYt2QsUS1EaIO26Ry1HNd5Px0U/kz2vmJBnLONNxg3LLICG31R H/CKClbPOT++7bdgnAzYOODse/czAZgPtAz8c= Original-Received: by 10.50.45.225 with SMTP id q1mr15906301igm.89.1324136962893; Sat, 17 Dec 2011 07:49:22 -0800 (PST) Original-Received: by 10.50.6.165 with HTTP; Sat, 17 Dec 2011 07:49:22 -0800 (PST) In-Reply-To: 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:146772 Archived-At: On Sat, Dec 17, 2011 at 4:39 PM, Carsten Mattner wrote: > 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=3D27744= 162, >> =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 =A00x00285202 in Fx_own_selection_internal (selection_name=3D27744162, > selection_value=3D78814449) at nsselect.m:425 > 425 =A0 =A0 =A0 =A0 ns_handle_selection_request (&ev); > Current language: =A0auto; currently objective-c > (gdb) p selection_name > $1 =3D 27744162 > (gdb) xtype > Undefined command: "xtype". =A0Try "help". > (gdb) xsymbol > Undefined command: "xsymbol". =A0Try "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 =A08 20:32:45 U= TC 2011) > 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. This is with Xcode's lldb: Process 486 stopped * thread #1: tid =3D 0x1f07, 0x9adc5d50 libsystem_c.dylib`strlen + 16, stop reason =3D EXC_BAD_ACCESS (code=3D2, address=3D0x0) frame #0: 0x9adc5d50 libsystem_c.dylib`strlen + 16 (lldb) bt * thread #1: tid =3D 0x1f07, 0x9adc5d50 libsystem_c.dylib`strlen + 16, stop reason =3D EXC_BAD_ACCESS (code=3D2, address=3D0x0) frame #0: 0x9adc5d50 libsystem_c.dylib`strlen + 16 frame #1: 0x001e7601 Emacs`intern + 33 at lread.c:3707 frame #2: 0x00283efb Emacs`ns_string_to_symbol + 459 at nsselect.m:86 frame #3: 0x002847ab Emacs`ns_handle_selection_request + 75 at nsselect.m:247 frame #4: 0x00285202 Emacs`Fx_own_selection_internal + 370 at nsselect.= m:425 frame #5: 0x001b025b Emacs`Ffuncall + 1147 at eval.c:2989 frame #6: 0x0020e3b1 Emacs`exec_byte_code + 3329 at bytecode.c:785 frame #7: 0x001b0e01 Emacs`funcall_lambda + 1185 at eval.c:3217 frame #8: 0x001b04a0 Emacs`Ffuncall + 1728 at eval.c:3035 frame #9: 0x001af8e4 Emacs`call2 + 68 at eval.c:2770 frame #10: 0x000f7a33 Emacs`command_loop_1 + 3779 at keyboard.c:1656 frame #11: 0x001ac5d6 Emacs`internal_condition_case + 294 at eval.c:149= 9 frame #12: 0x000f66cd Emacs`command_loop_2 + 61 at keyboard.c:1159 frame #13: 0x001abebf Emacs`internal_catch + 223 at eval.c:1256 frame #14: 0x000f664b Emacs`command_loop + 203 at keyboard.c:1138 frame #15: 0x000f5b95 Emacs`recursive_edit_1 + 181 at keyboard.c:758 frame #16: 0x000f5d86 Emacs`Frecursive_edit + 326 at keyboard.c:822 frame #17: 0x000f3b6a Emacs`main + 6442 at emacs.c:1709 (lldb) frame 4 invalid command 'frame 4' (lldb) frame Available completions: info select variable (lldb) frame select 4 frame #4: 0x00285202 Emacs`Fx_own_selection_internal + 370 at nsselect.m:42= 5 422 ev.code =3D 0; 423 *(EMACS_INT*)(&(ev.x)) =3D (EMACS_INT)pb; // FIXME: BIG UGLY HA= CK!! 424 *(EMACS_INT*)(&(ev.y)) =3D (EMACS_INT)NSStringPboardType; -> 425 ns_handle_selection_request (&ev); 426 } 427 return selection_value; 428 } (lldb) p selection_name (Lisp_Object) $0 =3D 27744162 (lldb)