Subject: Re: bug#6031: gcc 4.5 breaks optimized builds of emacs

From: Elias Pipping <[email-masked]>
Date: Tue, 27 Apr 2010 00:12:44 +0200

On Mon, Apr 26, 2010 at 5:40 PM, Elias Pipping
<[email-masked]> wrote:
> On Sun, Apr 25, 2010 at 8:32 PM, Chong Yidong <[email-masked]> wrote:
>> Could you do me a favor, and check whether the problem also exists for
>> the latest emacs-23 pretest at ftp://alpha.gnu.org/gnu/emacs/pretest/ ?
>
> It does not. Judging by the bisecting I did, the problem was introduced in
>
>  http://repo.or.cz/w/emacs.git/commit/5a98a2a69b1a15173ce4bfa53307608a7150b407
>
>
> Kind regards,
>
> Elias

A slightly different version of this problem does appear in 23.1.96,
though. A segfault when running in a terminal. This one doesn't occur
right after the start, though. To trigger it, press C-x C-f and press
<tab> four times. Here's what happens then:

Program received signal SIGSEGV, Segmentation fault.
build_frame_matrix_from_leaf_window (matrix=0xca5e30, w=0xa93f90) at
dispnew.c:2824
2824                  SET_CHAR_GLYPH_FROM_GLYPH (*border, right_border_glyph);
(gdb) bt
#0  build_frame_matrix_from_leaf_window (matrix=0xca5e30, w=0xa93f90)
at dispnew.c:2824
#1  build_frame_matrix_from_window_tree (matrix=0xca5e30, w=0xa93f90)
at dispnew.c:2720
#2  0x0000000000409601 in build_frame_matrix_from_window_tree
(matrix=0xca5e30, w=0xf0a800) at dispnew.c:2716
#3  0x000000000040c24d in build_frame_matrix (f=0xa93d10, force_p=0,
inhibit_hairy_id_p=0) at dispnew.c:2700
#4  update_frame (f=0xa93d10, force_p=0, inhibit_hairy_id_p=0) at dispnew.c:3951
#5  0x0000000000423c82 in redisplay_internal
(preserve_echo_area=<value optimized out>) at xdisp.c:11826
#6  0x00000000004769d5 in read_char (commandflag=1, nmaps=2,
maps=0x7fffffffcdf0, prev_event=10938770,
used_mouse_menu=0x7fffffffce74, end_time=0x0) at keyboard.c:2727
#7  0x00000000004790ed in read_key_sequence (keybuf=0x7fffffffcfa0,
bufsize=30, prompt=10938770, dont_downcase_last=0,
can_return_switch_frame=1, fix_current_buffer=1)
    at keyboard.c:9512
#8  0x000000000047aef1 in command_loop_1 () at keyboard.c:1643
#9  0x00000000004d41b4 in internal_condition_case (bfun=0x47ac15
<command_loop_1>, handlers=11006002, hfun=0x470aa2 <cmd_error>) at
eval.c:1490
#10 0x000000000046ff66 in command_loop_2 () at keyboard.c:1360
#11 0x00000000004d4084 in internal_catch (tag=11103042, func=0x46ff4c
<command_loop_2>, arg=10938770) at eval.c:1226
#12 0x0000000000470c02 in command_loop () at keyboard.c:1325
#13 0x0000000000470ce1 in recursive_edit_1 () at keyboard.c:954
#14 0x0000000000498809 in read_minibuf (map=10932022,
initial=13617857, prompt=<value optimized out>, backup_n=<value
optimized out>, expflag=0, histvar=<value optimized out>,
    histpos=0, defalt=15330225, allow_props=0, inherit_input_method=0)
at minibuf.c:740
#15 0x0000000000498c78 in Fcompleting_read (prompt=8075209,
collection=<value optimized out>, predicate=<value optimized out>,
require_match=11074946,
    initial_input=<value optimized out>, hist=11015314, def=15330225,
inherit_input_method=10938770) at minibuf.c:1824
#16 0x00000000004d4d25 in Ffuncall (nargs=<value optimized out>,
args=0x7fffffffd4a8) at eval.c:3055
#17 0x000000000050736f in Fbyte_code (bytestr=<value optimized out>,
vector=<value optimized out>, maxdepth=<value optimized out>) at
bytecode.c:680
#18 0x00000000004d6fbc in funcall_lambda (fun=8282029, nargs=4,
arg_vector=0x7fffffffd778) at eval.c:3211
#19 0x00000000004d4d43 in Ffuncall (nargs=<value optimized out>,
args=0x7fffffffd770) at eval.c:3070
#20 0x000000000050736f in Fbyte_code (bytestr=<value optimized out>,
vector=<value optimized out>, maxdepth=<value optimized out>) at
bytecode.c:680
#21 0x00000000004d6fbc in funcall_lambda (fun=8074637, nargs=2,
arg_vector=0x7fffffffd948) at eval.c:3211
#22 0x00000000004d4d43 in Ffuncall (nargs=<value optimized out>,
args=0x7fffffffd940) at eval.c:3070
#23 0x000000000050736f in Fbyte_code (bytestr=<value optimized out>,
vector=<value optimized out>, maxdepth=<value optimized out>) at
bytecode.c:680
#24 0x00000000004d6948 in Feval (form=<value optimized out>) at eval.c:2352
#25 0x00000000004d1e42 in Fcall_interactively (function=11460274,
record_flag=10938770, keys=10997285) at callint.c:365
#26 0x00000000004d4c42 in Ffuncall (nargs=<value optimized out>,
args=0x7fffffffdcd0) at eval.c:3030
#27 0x00000000004d4ee7 in call3 (fn=<value optimized out>, arg1=<value
optimized out>, arg2=<value optimized out>, arg3=<value optimized
out>) at eval.c:2850
#28 0x000000000047bc01 in command_loop_1 () at keyboard.c:1904
#29 0x00000000004d41b4 in internal_condition_case (bfun=0x47ac15
<command_loop_1>, handlers=11006002, hfun=0x470aa2 <cmd_error>) at
eval.c:1490
#30 0x000000000046ff66 in command_loop_2 () at keyboard.c:1360
#31 0x00000000004d4084 in internal_catch (tag=10998562, func=0x46ff4c
<command_loop_2>, arg=10938770) at eval.c:1226
#32 0x0000000000470c45 in command_loop () at keyboard.c:1339
#33 0x0000000000470ce1 in recursive_edit_1 () at keyboard.c:954
#34 0x0000000000470e2b in Frecursive_edit () at keyboard.c:1016
#35 0x000000000046db57 in main (argc=<value optimized out>,
argv=0x7fffffffe538) at emacs.c:1833
(gdb)

this is with the same CC and CFLAGS as mentioned before (changing
either appears to make the bug go away).

Kind regards,

Elias