Subject: Re: bug#21428: 24.5; Crash of emacs on OS X, installed via homebrew cask

From: Rainer M Krug <[email-masked]>
Date: Wed, 30 Sep 2015 11:49:10 +0200

Rainer M Krug <[email-masked]> writes:

> Eli Zaretskii <[email-masked]> writes:
>
>>> From: Rainer M Krug <[email-masked]>
>>> Cc: [email-masked],  [email-masked]
>>> Date: Tue, 29 Sep 2015 12:17:33 +0200
>>> 
>>> > OK, for now just add GET_FROM_IMAGE to the assertion, like this:
>>> >
>>> >   eassert (it->method == GET_FROM_BUFFER
>>> > 	   || it->method == GET_FROM_DISPLAY_VECTOR
>>> > 	   || it->method == GET_FROM_STRING
>>> > 	   || it->method == GET_FROM_IMAGE);
>>> >
>>> > recompile,
>>> 
>>> Done
>>> 
>>> > and see if this gets you past the crashes in
>>> > push_prefix_prop when those inhibit-* variables are set to t.
>>> 
>>> OK
>>> 
>>> > If it does, then let's see if running with those inhibit-* variables
>>> > set to t can trigger the crashes due to invalid face ID in
>>> > get_glyph_face_and_encoding.
>>> 
>>> I assume you mean here to set them to NILL?
>>
>> No, I mean continue running with them set to t, and see if the crashes
>> in get_glyph_face_and_encoding are prevented by disabling these
>> redisplay optimizations.
>
> OK - got it. So continue the initial plan.

They are all set to t and I got the following crash:

Let me know if you need any further info - I will leave the session
open.

Rainer

,----
| xdisp.c:24350: Emacs fatal error: assertion failed: face != NULL
| 
| Breakpoint 1, terminate_due_to_signal (sig=6, backtrace_limit=2147483647) at emacs.c:370
| 370	  signal (sig, SIG_DFL);
| (gdb) bt
| #0  terminate_due_to_signal (sig=6, backtrace_limit=2147483647) at emacs.c:370
| #1  0x0000000100229d6b in die (msg=0x1003bbad3 "face != NULL", file=0x1003b70d0 "xdisp.c", line=24350) at alloc.c:6951
| #2  0x0000000100065467 in get_glyph_face_and_encoding (f=0x104811630, glyph=0x11ca93400, char2b=0x7fff5fbfb660) at xdisp.c:24350
| #3  0x00000001000b860d in fill_glyph_string (s=0x7fff5fbfb6c0, face_id=48, start=0, end=42, overlaps=0) at xdisp.c:24575
| #4  0x000000010006fb19 in draw_glyphs (w=0x11226a6b8, x=8, row=0x11fa6e100, area=TEXT_AREA, start=0, end=42, hl=DRAW_NORMAL_TEXT, overlaps=0) at xdisp.c:25242
| #5  0x000000010006f441 in x_write_glyphs (w=0x11226a6b8, updated_row=0x11fa6e100, start=0x11ca93400, updated_area=TEXT_AREA, len=42) at xdisp.c:27273
| #6  0x000000010001248a in update_text_area (w=0x11226a6b8, updated_row=0x11fa6e100, vpos=1) at dispnew.c:3611
| #7  0x00000001000100a4 in update_window_line (w=0x11226a6b8, vpos=1, mouse_face_overwritten_p=0x7fff5fbfbdd2) at dispnew.c:3854
| #8  0x0000000100007ca4 in update_window (w=0x11226a6b8, force_p=true) at dispnew.c:3477
| #9  0x000000010000681f in update_window_tree (w=0x11226a6b8, force_p=true) at dispnew.c:3219
| #10 0x00000001000067cd in update_window_tree (w=0x11ca87fa8, force_p=true) at dispnew.c:3217
| #11 0x00000001000064db in update_frame (f=0x104811630, force_p=true, inhibit_hairy_id_p=false) at dispnew.c:3108
| #12 0x0000000100052bc5 in redisplay_internal () at xdisp.c:13826
| #13 0x00000001000546f9 in redisplay () at xdisp.c:13067
| #14 0x00000001001889b9 in read_char (commandflag=1, map=4754523971, prev_event=0, used_mouse_menu=0x7fff5fbfefc7, end_time=0x0) at keyboard.c:2465
| #15 0x0000000100183919 in read_key_sequence (keybuf=0x7fff5fbff300, bufsize=30, prompt=0, dont_downcase_last=false, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=false) at keyboard.c:9030
| #16 0x0000000100182216 in command_loop_1 () at keyboard.c:1348
| #17 0x0000000100264d86 in internal_condition_case (bfun=0x100181c20 <command_loop_1>, handlers=17616, hfun=0x10019d490 <cmd_error>) at eval.c:1309
| #18 0x000000010019d38c in command_loop_2 (ignore=0) at keyboard.c:1088
| #19 0x0000000100263e4e in internal_catch (tag=42768, func=0x10019d360 <command_loop_2>, arg=0) at eval.c:1073
| #20 0x0000000100180f60 in command_loop () at keyboard.c:1067
| #21 0x0000000100180da2 in recursive_edit_1 () at keyboard.c:673
| #22 0x0000000100181193 in Frecursive_edit () at keyboard.c:744
| #23 0x000000010017ed3a in main (argc=1, argv=0x7fff5fbff908) at emacs.c:1643
| 
| Lisp Backtrace:
| "redisplay_internal (C function)" (0x0)
| (gdb) tb full
| Function "full" not defined.
| Make breakpoint pending on future shared library load? (y or [n]) bt full
| Please answer y or [n].
| Make breakpoint pending on future shared library load? (y or [n]) n
| (gdb) bt full
| #0  terminate_due_to_signal (sig=6, backtrace_limit=2147483647) at emacs.c:370
| No locals.
| #1  0x0000000100229d6b in die (msg=0x1003bbad3 "face != NULL", file=0x1003b70d0 "xdisp.c", line=24350) at alloc.c:6951
| No locals.
| #2  0x0000000100065467 in get_glyph_face_and_encoding (f=0x104811630, glyph=0x11ca93400, char2b=0x7fff5fbfb660) at xdisp.c:24350
| 	face = (struct face *) 0x0
| 	code = 0
| #3  0x00000001000b860d in fill_glyph_string (s=0x7fff5fbfb6c0, face_id=48, start=0, end=42, overlaps=0) at xdisp.c:24575
| 	glyph = (struct glyph *) 0x11ca93400
| 	last = (struct glyph *) 0x11ca93be0
| 	voffset = 0
| 	glyph_not_available_p = false
| #4  0x000000010006fb19 in draw_glyphs (w=0x11226a6b8, x=8, row=0x11fa6e100, area=TEXT_AREA, start=0, end=42, hl=DRAW_NORMAL_TEXT, overlaps=0) at xdisp.c:25242
| 	face_id = 48
| 	char2b = (XChar2b *) 0x7fff5fbfb660
| 	first_glyph = (struct glyph *) 0x11ca93400
| 	head = (struct glyph_string *) 0x7fff5fbfb6c0
| 	tail = (struct glyph_string *) 0x7fff5fbfb6c0
| 	s = (struct glyph_string *) 0x7fff5fbfb6c0
| 	clip_head = (struct glyph_string *) 0x0
| 	clip_tail = (struct glyph_string *) 0x0
| 	i = 0
| 	j = 1531018
| 	x_reached = 1
| 	last_x = 1257
| 	area_left = 8
| 	f = (struct frame *) 0x104811630
| 	sa_avail = 16300
| 	sa_count = 5
| 	sa_must_free = false
| #5  0x000000010006f441 in x_write_glyphs (w=0x11226a6b8, updated_row=0x11fa6e100, start=0x11ca93400, updated_area=TEXT_AREA, len=42) at xdisp.c:27273
| 	x = 16777216
| 	hpos = 0
| 	chpos = 35
| #6  0x000000010001248a in update_text_area (w=0x11226a6b8, updated_row=0x11fa6e100, vpos=1) at dispnew.c:3611
| 	current_row = (struct glyph_row *) 0x11ca42500
| 	desired_row = (struct glyph_row *) 0x11fa6e100
| 	rif = (struct redisplay_interface *) 0x1007df0a8
| 	changed_p = false
| #7  0x00000001000100a4 in update_window_line (w=0x11226a6b8, vpos=1, mouse_face_overwritten_p=0x7fff5fbfbdd2) at dispnew.c:3854
| 	current_row = (struct glyph_row *) 0x11ca42500
| 	desired_row = (struct glyph_row *) 0x11fa6e100
| 	rif = (struct redisplay_interface *) 0x1007df0a8
| 	changed_p = false
| #8  0x0000000100007ca4 in update_window (w=0x11226a6b8, force_p=true) at dispnew.c:3477
| 	vpos = 1
| 	i = 78
| 	end = (struct glyph_row *) 0x11fa76e00
| 	mode_line_row = (struct glyph_row *) 0x11fa76e00
| 	header_line_row = (struct glyph_row *) 0x11fa6e000
| 	changed_p = false
| 	mouse_face_overwritten_p = false
| 	row = (struct glyph_row *) 0x11fa6e100
| 	yb = 1402
| 	n_updated = 0
| 	desired_matrix = (struct glyph_matrix *) 0x1143f3830
| 	paused_p = false
| 	preempt_count = 17
| 	rif = (struct redisplay_interface *) 0x1007df0a8
| #9  0x000000010000681f in update_window_tree (w=0x11226a6b8, force_p=true) at dispnew.c:3219
| 	paused_p = false
| #10 0x00000001000067cd in update_window_tree (w=0x11ca87fa8, force_p=true) at dispnew.c:3217
| 	paused_p = false
| #11 0x00000001000064db in update_frame (f=0x104811630, force_p=true, inhibit_hairy_id_p=false) at dispnew.c:3108
| 	paused_p = 255
| 	root_window = (struct window *) 0x11ca87fa8
| #12 0x0000000100052bc5 in redisplay_internal () at xdisp.c:13826
| 	gcscrollbars = true
| 	f = (struct frame *) 0x104811630
| 	w = (struct window *) 0x11226a6b8
| 	sw = (struct window *) 0x11226a6b8
| 	fr = (struct frame *) 0x104811630
| 	pending = false
| 	must_finish = true
| 	match_p = true
| 	tlbufpos = {
|   charpos = 43,
|   bytepos = 43
| }
| 	tlendpos = {
|   charpos = 13586,
|   bytepos = 13586
| }
| 	number_of_visible_frames = 1
| 	count = 2
| 	sf = (struct frame *) 0x104811630
| 	polling_stopped_here = true
| 	tail = 4412463651
| 	frame = 4370535989
| 	consider_all_windows_p = true
| 	update_miniwindow_p = true
| #13 0x00000001000546f9 in redisplay () at xdisp.c:13067
| No locals.
| #14 0x00000001001889b9 in read_char (commandflag=1, map=4754523971, prev_event=0, used_mouse_menu=0x7fff5fbfefc7, end_time=0x0) at keyboard.c:2465
| 	echo_current = false
| 	c = 0
| 	jmpcount = 140734799801376
| 	local_getcjmp = 0x7fff5fbfebb0
| 	save_jump = 0x7fff5fbfeb10
| 	tem = 2
| 	save = 0
| 	previous_echo_area_message = 0
| 	also_record = 0
| 	reread = false
| 	recorded = false
| 	polling_stopped_here = false
| 	orig_kboard = (struct kboard *) 0x10120d1a0
| #15 0x0000000100183919 in read_key_sequence (keybuf=0x7fff5fbff300, bufsize=30, prompt=0, dont_downcase_last=false, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=false) at keyboard.c:9030
| 	interrupted_kboard = (KBOARD *) 0x10120d1a0
| 	interrupted_frame = (struct frame *) 0x104811630
| 	key = 0
| 	used_mouse_menu = false
| 	echo_local_start = 0
| 	last_real_key_start = 0
| 	keys_local_start = 0
| 	new_binding = 4303307192
| 	count = 2
| 	t = 0
| 	echo_start = 0
| 	keys_start = 0
| 	current_binding = 4754523971
| 	first_event = 0
| 	first_unbound = 31
| 	mock_input = 0
| 	fkey = {
|   parent = 4412433507,
|   map = 4412433507,
|   start = 0,
|   end = 0
| }
| 	keytran = {
|   parent = 4336943683,
|   map = 4336943683,
|   start = 0,
|   end = 0
| }
| 	indec = {
|   parent = 4412433651,
|   map = 4412433651,
|   start = 0,
|   end = 0
| }
| 	shift_translated = false
| 	delayed_switch_frame = 0
| 	original_uppercase = 0
| 	original_uppercase_position = -1
| 	dummyflag = false
| 	starting_buffer = (struct buffer *) 0x1119a7dd0
| 	fake_prefixed_keys = 0
| #16 0x0000000100182216 in command_loop_1 () at keyboard.c:1348
| 	cmd = 18099272
| 	keybuf = 0x7fff5fbff300
| 	i = 2
| 	prev_modiff = 14849
| 	prev_buffer = (struct buffer *) 0x1119a7dd0
| 	already_adjusted = false
| #17 0x0000000100264d86 in internal_condition_case (bfun=0x100181c20 <command_loop_1>, handlers=17616, hfun=0x10019d490 <cmd_error>) at eval.c:1309
| 	val = 4303324808
| 	c = (struct handler *) 0x101043ab0
| #18 0x000000010019d38c in command_loop_2 (ignore=0) at keyboard.c:1088
| 	val = 2
| #19 0x0000000100263e4e in internal_catch (tag=42768, func=0x10019d360 <command_loop_2>, arg=0) at eval.c:1073
| 	val = 0
| 	c = (struct handler *) 0x1010439c0
| #20 0x0000000100180f60 in command_loop () at keyboard.c:1067
| No locals.
| #21 0x0000000100180da2 in recursive_edit_1 () at keyboard.c:673
| 	count = 1
| 	val = 0
| #22 0x0000000100181193 in Frecursive_edit () at keyboard.c:744
| 	count = 0
| 	buffer = 0
| #23 0x000000010017ed3a in main (argc=1, argv=0x7fff5fbff908) at emacs.c:1643
| 	dummy = 140734799806464
| 	stack_bottom_variable = 0 '\0'
| 	do_initial_setlocale = true
| 	dumping = false
| 	skip_args = 0
| 	rlim = {
|   rlim_cur = 8720000,
|   rlim_max = 67104768
| }
| 	no_loadup = false
| 	junk = 0x0
| 	dname_arg = 0x0
| 	dname_arg2 = 0x7fff5fbff880 "\001"
| 	ch_to_dir = 0x0
| 	original_pwd = 0x0
| 
| Lisp Backtrace:
| "redisplay_internal (C function)" (0x0)
| (gdb)
`----

>
>>
>> IOW, if the assertion violation in push_prefix_prop is no longer in
>> the way, let's go back to our plan of trying to figure out which
>> redisplay optimizations cause the crashes in
>> get_glyph_face_and_encoding: first run with all optimizations
>> disabled, and if that avoids the crashes in
>> get_glyph_face_and_encoding, re-enable the optimizations one by one to
>> see which one reintroduces the crashes.
>
> OK - will do so.
>
>>
>> The assertion violations in push_prefix_prop are a separate issue,
>> unrelated to the original problem we are trying to solve.  It just
>> distracted us for a while, because you were unable to run without
>> hitting them.
>
> Ah - was wondering already a bit about the different non-similar
> messages.
>
> Thanks for your patience,
>
> Rainer
>
>>
>> Thanks.

-- 
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982