Subject: bug#1295: Segfault with `M-- M-r' when `scroll-margin' > 0

From: martin rudalics <[email-masked]>
Date: Wed, 05 Nov 2008 08:22:46 +0100

> If we think that a bug in Lisp code causes a crash,
 > we should think about whether there's a bug in the C code
 > which it is triggering.

It's a bug in C.  With the OP's recipe I get:

Program received signal SIGSEGV, Segmentation fault.
0x01028412 in try_window_reusing_current_matrix (w=0x3784600) at xdisp.c:14471
(gdb) bt
#0  0x01028412 in try_window_reusing_current_matrix (w=0x3784600) at xdisp.c:14471
#1  0x0102c328 in redisplay_window (window=58213892, just_this_one_p=1) at xdisp.c:13764
#2  0x0102dd61 in redisplay_window_1 (window=58213892) at xdisp.c:12249
#3  0x01009d1b in internal_condition_case_1 (bfun=0x102dd34 <redisplay_window_1>, arg=58213892, handlers=43976013, hfun=0x101d96a <redisplay_window_error>) at eval.c:1559
#4  0x0102f775 in redisplay_internal (preserve_echo_area=2732) at xdisp.c:11867
#5  0x0105946f in read_char (commandflag=1, nmaps=2, maps=0x82fb20, prev_event=43993089, used_mouse_menu=0x82fb68, end_time=0x0) at keyboard.c:2649
#6  0x0105c47d in read_key_sequence (keybuf=0x82fcb0, bufsize=30, prompt=43993089, dont_downcase_last=0, can_return_switch_frame=1, fix_current_buffer=1) at keyboard.c:9344
#7  0x0105e342 in command_loop_1 () at keyboard.c:1621
#8  0x01009fae in internal_condition_case (bfun=0x105e190 <command_loop_1>, handlers=44056841, hfun=0x105773c <cmd_error>) at eval.c:1511
#9  0x01051cca in command_loop_2 () at keyboard.c:1338
#10 0x01009ee3 in internal_catch (tag=2732, func=0x1051ca7 <command_loop_2>, arg=43993089) at eval.c:1247
#11 0x01051ad7 in command_loop () at keyboard.c:1317
#12 0x01051b70 in recursive_edit_1 () at keyboard.c:942
#13 0x01051c91 in Frecursive_edit () at keyboard.c:1004
#14 0x01002e46 in main (argc=2, argv=0xa327e0) at emacs.c:1777
(gdb)

martin