GNU bug report logs - #1435
C-Click on a mode in the mode-line causes crash in MacOS X.

Previous Next

Packages: ns, emacs;

Reported by: Jason Schadel <jasons <at> aweber.com>

Date: Wed, 26 Nov 2008 16:10:03 UTC

Severity: normal

Done: Adrian Robert <adrian.b.robert <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 1435 in the body.
You can then email your comments to 1435 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1435; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Jason Schadel <jasons <at> aweber.com>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Jason Schadel <jasons <at> aweber.com>
To: emacs-pretest-bug <at> gnu.org
Subject: C-Click on a mode in the mode-line causes crash in MacOS X.
Date: Wed, 26 Nov 2008 11:03:43 -0500
When a Control-Click is made on a mode in the mode-line, emacs crashes  
with the error below.

Emacs Version Info
---------- Begin ----------
In GNU Emacs 23.0.60.1 (i386-apple-darwin9.5.0, NS apple-appkit-949.35)
 of 2008-11-26 on Jason-Schadels-MacBook-Pro.local
Windowing system distributor `Apple', version  
97.112.112.108.101.45.97.112.112.107.105.116.45.57.52.57.46.51.53
configured using `configure  '--with-ns' 'CFLAGS=-g''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t
---------- End ----------

Debug Output
---------- Begin ----------
2008-11-26 09:23:10.993 Emacs[53741:813] *** -[EmacsView  
writeSelectionToPasteboard:types:]: unrecognized selector sent to  
instance 0x6c0cb50
2008-11-26 09:23:10.994 Emacs[53741:813] An uncaught exception was  
raised
2008-11-26 09:23:10.994 Emacs[53741:813] *** -[EmacsView  
writeSelectionToPasteboard:types:]: unrecognized selector sent to  
instance 0x6c0cb50
2008-11-26 09:23:10.995 Emacs[53741:813] *** Terminating app due to  
uncaught exception 'NSInvalidArgumentException', reason: '*** - 
[EmacsView writeSelectionToPasteboard:types:]: unrecognized selector  
sent to instance 0x6c0cb50'
2008-11-26 09:23:10.995 Emacs[53741:813] Stack: (
    2445988171,
    2434797115,
    2446017354,
    2446010700,
    2446010898,
    213437042,
    213435210,
    35150243,
    35150157,
    35760590,
    35148029,
    16540974,
    16539500,
    16539341,
    16539181,
    16538726,
    16538435,
    2702344,
    2706698,
    2718407,
    1470803,
    1429763,
    1477375,
    1414943,
    2056321,
    1412871,
    2054797,
    1412752,
    1410163,
    1410684,
    1403269,
    11666
)

Program received signal SIGTRAP, Trace/breakpoint trap.
0x91cacff4 in ___TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION___ ()
---------- End ----------

Full Backtrace
---------- Begin ----------
(gdb) bt full
#0  0x91cacff4 in ___TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION___ ()
No symbol table info available.
#1  0x91200e3b in objc_exception_throw ()
No symbol table info available.
#2  0x91cb434a in -[NSObject doesNotRecognizeSelector:] ()
No symbol table info available.
#3  0x91cb294c in ___forwarding___ ()
No symbol table info available.
#4  0x91cb2a12 in __forwarding_prep_0___ ()
No symbol table info available.
#5  0x0cb8ca72 in CopyCocoaTextSelection ()
No symbol table info available.
#6  0x0cb8c34a in QuickAddExamineContext ()
No symbol table info available.
#7  0x021859a3 in TContextualMenuPlugin::ExamineContext ()
No symbol table info available.
#8  0x0218594d in TContextualMenuPluginList::ExamineContext ()
No symbol table info available.
#9  0x0221a9ce in _ContextualMenuInsertItems ()
No symbol table info available.
#10 0x021850fd in _ContextualMenuInsertItems ()
No symbol table info available.
#11 0x00fc652e in _NSPopUpCarbonMenu3 ()
No symbol table info available.
#12 0x00fc5f6c in _NSPopUpCarbonMenu2 ()
No symbol table info available.
#13 0x00fc5ecd in _NSPopUpCarbonMenu1 ()
No symbol table info available.
#14 0x00fc5e2d in -[NSCarbonMenuImpl  
_popUpContextMenu:withEvent:forView:withFont:] ()
No symbol table info available.
#15 0x00fc5c66 in -[NSMenu  
_popUpContextMenu:withEvent:forView:withFont:] ()
No symbol table info available.
#16 0x00fc5b43 in -[NSMenu _popUpContextMenu:withEvent:forView:] ()
No symbol table info available.
#17 0x00293c08 in -[EmacsMenu runMenuAt:forFrame:keymaps:]  
(self=0xd722650, _cmd=0x2c3f96, p={x = 1018, y = 27}, f=0x48bb850,  
keymaps=1) at nsmenu.m:735
	view = (EmacsView *) 0x6c0cb50
	e = (NSEvent *) 0xf470410
	event = (NSEvent *) 0xf443ef0
	retVal = 2702481
#18 0x00294d0a in ns_popup_menu (position=87910205, menu=87930821) at  
nsmenu.m:1135
	pmenu = (EmacsMenu *) 0xd722650
	f = (struct frame *) 0x48bb850
	p = {
  x = 1018,
  y = 827
}
	window = 256341252
	x = 2432
	y = 3352
	tem = 92274697
	keymap = 73594421
	title = 100792459
	gcpro1 = {
  next = 0x9123ebf4,
  var = 0x0,
  nvars = 125773824
}
	specpdl_count = 2
	specpdl_count2 = 3
	error_name = 0x0
	keymaps = 1
	wv = (widget_value *) 0xd7225c0
	first_wv = (widget_value *) 0xf493b50
#19 0x00297ac7 in Fx_popup_menu (position=87910205, menu=87930821) at  
nsmenu.m:1922
No locals.
#20 0x00167153 in read_char_x_menu_prompt (nmaps=4, maps=0xbfffebd0,  
prev_event=87910205, used_mouse_menu=0xbfffed78) at keyboard.c:8493
	realmaps = (Lisp_Object *) 0xbfffe970
	value = 128190
	nmaps1 = 1
	mapno = 4
	name = 100792459
#21 0x0015d103 in read_char (commandflag=1, nmaps=4, maps=0xbfffebd0,  
prev_event=87910205, used_mouse_menu=0xbfffed78, end_time=0x0) at  
keyboard.c:2854
	c = 92274697
	count = 1510961
	jmpcount = 2
	local_getcjmp = {2491263, 0, 8099, 1426703, -1073746448, 0, 4,  
-1073746992, -1073747064, -1073747504, 102891551, 658, 1428558,  
92274711, 92274719, 71106591, 102891520, 55}
	save_jump = {-1073747192, 1513827, 92274697, 1, 1, 2502472, 92274697,  
92274697, 3478900, 70873573, 0, 1512657, 100440305, 92274697, 3650717,  
100440305, 73594421, 1951602}
	key_already_recorded = 0
	tem = 1473571
	save = -1073747128
	previous_echo_area_message = 92274697
	also_record = 92274697
	reread = 0
	gcpro1 = {
  next = 0x5800009,
  var = 0x10,
  nvars = 1512315
}
	gcpro2 = {
  next = 0x2,
  var = 0x58071a1,
  nvars = -1073747304
}
	polling_stopped_here = 0
	orig_kboard = (struct kboard *) 0x4846610
#22 0x00168aff in read_key_sequence (keybuf=0xbfffefa4, bufsize=30,  
prompt=92274697, dont_downcase_last=0, can_return_switch_frame=1,  
fix_current_buffer=1) at keyboard.c:9344
	interrupted_kboard = (KBOARD *) 0x4846610
	interrupted_frame = (struct frame *) 0x48bb850
	key = 87910205
	used_mouse_menu = 0
	echo_local_start = 0
	last_real_key_start = 2
	keys_local_start = 2
	local_first_binding = 2
	from_string = 235642243
	count = 2
	t = 2
	echo_start = 0
	keys_start = 0
	nmaps = 4
	nmaps_allocated = 4
	defs = (Lisp_Object * volatile) 0xbfffebb0
	submaps = (Lisp_Object * volatile) 0xbfffebd0
	orig_local_map = 3650693
	orig_keymap = 92274697
	localized_local_map = 1
	first_binding = 2
	first_unbound = 31
	mock_input = 2
	fkey = {
  parent = 71245389,
  map = 71245389,
  start = 2,
  end = 2
}
	keytran = {
  parent = 70733693,
  map = 70733693,
  start = 2,
  end = 2
}
	indec = {
  parent = 71245397,
  map = 71245397,
  start = 2,
  end = 2
}
	shift_translated = 0
	delayed_switch_frame = 92274697
	original_uppercase = -1073746408
	original_uppercase_position = -1
	dummyflag = 0
	starting_buffer = (struct buffer *) 0xc1c5d90
	fake_prefixed_keys = 87910197
	gcpro1 = {
  next = 0x622acd9,
  var = 0x5800009,
  nvars = 2
}
#23 0x0015971f in command_loop_1 () at keyboard.c:1621
	cmd = 102935769
	lose = 32
	nonundocount = 0
	keybuf = {92303801, 87910205, 0, 3250635, -1073746096, -1073745976,  
1492944, -1073745796, 1412030, -1073745912, 1412519, 224649653,  
92274745, -1073745882, 100794081, 152, 163, 125796672, 368690, 232,  
14, 0, 76265552, -1073746208, 1411579, -1073745816, 1411941,  
224649637, -1073745882, 70799261}
	i = 1
	prev_modiff = 9026
	prev_buffer = (struct buffer *) 0xc1c5d90
	already_adjusted = 0
#24 0x001f6081 in internal_condition_case (bfun=0x159271  
<command_loop_1>, handlers=92314385, hfun=0x1589ef <cmd_error>) at  
eval.c:1511
	val = 70799261
	c = {
  tag = 92274697,
  val = 92274697,
  next = 0xbffff16c,
  gcpro = 0x0,
  jmp = {-1073806465, 82, 8098, 2056032, 117522432, 2054597, 0, 0,  
-1073745624, -1073745808, 31, 658, 2056198, -1859256297, 31, 31, 0, 55},
  backlist = 0x0,
  handlerlist = 0x0,
  lisp_eval_depth = 0,
  pdlcount = 2,
  poll_suppress_count = 1,
  interrupt_input_blocked = 0,
  byte_stack = 0x0
}
	h = {
  handler = 92314385,
  var = 92274697,
  chosen_clause = 92274745,
  tag = 0xbffff0a8,
  next = 0x0
}
#25 0x00158f07 in command_loop_2 () at keyboard.c:1338
	val = 8368128
#26 0x001f5a8d in internal_catch (tag=92310457, func=0x158ed2  
<command_loop_2>, arg=92274697) at eval.c:1247
	c = {
  tag = 92310457,
  val = 92274697,
  next = 0x0,
  gcpro = 0x0,
  jmp = {-1859320961, 0, 8098, 2054597, -1859280203, 0, 0, 0,  
-1073745432, -1073745584, 92405791, 662, 2054782, 23, 92274719,  
-1073807329, 92405760, 92405815},
  backlist = 0x0,
  handlerlist = 0x0,
  lisp_eval_depth = 0,
  pdlcount = 2,
  poll_suppress_count = 1,
  interrupt_input_blocked = 0,
  byte_stack = 0x0
}
#27 0x00158e90 in command_loop () at keyboard.c:1317
No locals.
#28 0x00158473 in recursive_edit_1 () at keyboard.c:942
	count = 1
	val = 2071153
#29 0x0015867c in Frecursive_edit () at keyboard.c:1004
	count = 0
	buffer = 92274697
#30 0x00156985 in main (argc=1, argv=0xbffff3c0) at emacs.c:1777
	dummy = 0
	stack_bottom_variable = -65 '\277'
	do_initial_setlocale = 1
	skip_args = 0
	rlim = {
  rlim_cur = 8388608,
  rlim_max = 67104768
}
	no_loadup = 0
	junk = 0x0
	dname_arg = 0x0
---------- End ----------




bug reassigned from package `emacs' to `emacs,ns'. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Wed, 26 Nov 2008 17:10:04 GMT) Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>, don <at> donarmstrong.com:
bug#1435; Package emacs,ns. Full text and rfc822 format available.

Acknowledgement sent to Adrian Robert <adrian.b.robert <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>, don <at> donarmstrong.com. Full text and rfc822 format available.

Message #12 received at 1435 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Adrian Robert <adrian.b.robert <at> gmail.com>
To: 1435 <at> debbugs.gnu.org
Cc: Jason Schadel <jasons <at> aweber.com>
Subject: #1435 - C-Click on a mode in the mode-line causes crash in MacOS X. - Emacs bug report logs
Date: Fri, 28 Nov 2008 19:50:08 -0500
I can't reproduce it.  What is the mode, does it need to be a frame  
split into multiple windows and it is a certain one of the modelines?

Also, what is the output at the beginning of your "Debug Output"  
section about writeSelectionToPasteboard from?  Is it from some  
earlier activity?  Can you reproduce the bug in a fresh emacs started  
with -Q?

Thanks.





Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>, don <at> donarmstrong.com:
bug#1435; Package emacs,ns. Full text and rfc822 format available.

Acknowledgement sent to Jason Schadel <jasons <at> aweber.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>, don <at> donarmstrong.com. Full text and rfc822 format available.

Message #17 received at 1435 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Jason Schadel <jasons <at> aweber.com>
To: Adrian Robert <adrian.b.robert <at> gmail.com>
Cc: 1435 <at> debbugs.gnu.org
Subject: Re: #1435 - C-Click on a mode in the mode-line causes crash in MacOS X. - Emacs bug report logs
Date: Mon, 1 Dec 2008 11:05:09 -0500
That was from a fresh emacs started with -Q.  After a little more  
debugging, I noticed that the message buffer displays "mode-line down- 
mouse-3-".   I was assuming that C-Click was producing the same result  
because on a mac that is the same as a right click in the Finder, but  
in emacs it seems that it distinguishes between a right click(mouse-3)  
and a C-Click.

The same exception is raised when I Command-Click or just Click on a  
mode in the mode-line.  The message buffer displays "mode-line down- 
mouse-1-"


On Nov 28, 2008, at 7:50 PM, Adrian Robert wrote:

> I can't reproduce it.  What is the mode, does it need to be a frame  
> split into multiple windows and it is a certain one of the modelines?
>
> Also, what is the output at the beginning of your "Debug Output"  
> section about writeSelectionToPasteboard from?  Is it from some  
> earlier activity?  Can you reproduce the bug in a fresh emacs  
> started with -Q?
>
> Thanks.
>





Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com:
bug#1435; Package emacs,ns. (Fri, 23 Jan 2009 10:40:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Adrian Robert <adrian.b.robert <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com. (Fri, 23 Jan 2009 10:40:04 GMT) Full text and rfc822 format available.

Message #22 received at 1435 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Adrian Robert <adrian.b.robert <at> gmail.com>
To: 1435 <at> debbugs.gnu.org
Cc: Jason Schadel <jasons <at> aweber.com>
Subject: Re: C-Click on a mode in the mode-line causes crash in MacOS X
Date: Fri, 23 Jan 2009 12:32:16 +0200
I still cannot reproduce it.  The only clue I can find is that the  
crash seems to be deep inside OS X's own menu code, when it  
apparently tries to send a selection to -[EmacsView
writeSelectionToPasteboard:types:].  This should only occur if a  
native services menu selection is made, however for Emacs.app we  
override the services menu with our own items, so any selection from  
the actual visible services menu goes through ns-perform-service.

In your case, it seems doing your mouse action is somehow triggering  
a call into the (hidden and overridden) original services menu.  Do  
you know why this might be?  Do you have anything unusual running on  
your Mac, such as something that automatically is active when a  
selection is made or a menu item chosen, or a certain type of mouse- 
click made, or something like that?

Anyway, I have checked in something that might at least avoid the  
crash for now, it simply stubs out the methods in question:

-writeSelectionToPasteboard:types: and -readSelectionFromPasteboard:

Let me know if this stops the crash, and if so, if any behavior that  
is normally expected (in connection with this behind-the-scenes  
service call if you know what it is) is not observed.

thanks,
Adrian





Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com:
bug#1435; Package emacs,ns. (Mon, 02 Feb 2009 16:00:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jason Schadel <jasons <at> aweber.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>, owner <at> emacsbugs.donarmstrong.com. (Mon, 02 Feb 2009 16:00:04 GMT) Full text and rfc822 format available.

Message #27 received at 1435 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Jason Schadel <jasons <at> aweber.com>
To: Adrian Robert <adrian.b.robert <at> gmail.com>
Cc: 1435 <at> debbugs.gnu.org
Subject: Re: C-Click on a mode in the mode-line causes crash in MacOS X
Date: Mon, 2 Feb 2009 10:50:13 -0500
I do have a Kensington Expert Mouse with their ancient Mouseworks  
software installed.  I wouldn't be surprised if that is the problem.

No more crashes with your update.  Here are the results:
<mode-line> <C-mouse-1> is undefined
mode-line down-mouse-3- shows the minor-mode menu
mode-line down-mouse-1- shows the mode menu

-Jason

On Jan 23, 2009, at 5:32 AM, Adrian Robert wrote:

> I still cannot reproduce it.  The only clue I can find is that the  
> crash seems to be deep inside OS X's own menu code, when it  
> apparently tries to send a selection to -[EmacsView
> writeSelectionToPasteboard:types:].  This should only occur if a  
> native services menu selection is made, however for Emacs.app we  
> override the services menu with our own items, so any selection from  
> the actual visible services menu goes through ns-perform-service.
>
> In your case, it seems doing your mouse action is somehow triggering  
> a call into the (hidden and overridden) original services menu.  Do  
> you know why this might be?  Do you have anything unusual running on  
> your Mac, such as something that automatically is active when a  
> selection is made or a menu item chosen, or a certain type of mouse- 
> click made, or something like that?
>
> Anyway, I have checked in something that might at least avoid the  
> crash for now, it simply stubs out the methods in question:
>
> -writeSelectionToPasteboard:types: and -readSelectionFromPasteboard:
>
> Let me know if this stops the crash, and if so, if any behavior that  
> is normally expected (in connection with this behind-the-scenes  
> service call if you know what it is) is not observed.
>
> thanks,
> Adrian
>





bug closed, send any further explanations to Jason Schadel <jasons <at> aweber.com> Request was from Adrian Robert <adrian.b.robert <at> gmail.com> to control <at> emacsbugs.donarmstrong.com. (Mon, 02 Feb 2009 23:45:05 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Tue, 03 Mar 2009 15:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 16 years and 113 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.