From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Sergey Vlasov Newsgroups: gmane.emacs.bugs Subject: infinite loop in scroll-up Date: Fri, 21 Mar 2003 19:48:57 +0300 Sender: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <20030321194857.5853101f.vsu@altlinux.ru> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1048265915 30378 80.91.224.249 (21 Mar 2003 16:58:35 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 21 Mar 2003 16:58:35 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 21 17:58:29 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18wPqe-0007tC-00 for ; Fri, 21 Mar 2003 17:58:28 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18wPqB-0000Wy-00 for gnu-bug-gnu-emacs@m.gmane.org; Fri, 21 Mar 2003 11:57:59 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18wPpk-0000Dr-00 for bug-gnu-emacs@gnu.org; Fri, 21 Mar 2003 11:57:32 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18wPoU-0007jR-00 for bug-gnu-emacs@gnu.org; Fri, 21 Mar 2003 11:56:17 -0500 Original-Received: from mivlgu.ru ([81.18.140.87] helo=mail.mivlgu.ru) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18wPha-0004er-00 for bug-gnu-emacs@gnu.org; Fri, 21 Mar 2003 11:49:07 -0500 Original-Received: by mail.mivlgu.ru (Postfix, from userid 112) id 9A0D082738; Fri, 21 Mar 2003 19:49:01 +0300 (MSK) Original-Received: from vcserver.mivlgu.local (vcserver.mivlgu.local [192.168.1.251]) by mail.mivlgu.ru (Postfix) with SMTP id 4E1668272C; Fri, 21 Mar 2003 19:48:58 +0300 (MSK) Original-To: bug-gnu-emacs@gnu.org X-Mailer: Sylpheed version 0.8.11 (GTK+ 1.2.10; i586-alt-linux-gnu) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:4643 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:4643 In GNU Emacs 21.3.1 (i686-pc-linux-gnu, X toolkit) of 2003-03-20 on center4.mivlgu.local configured using `configure --prefix=/home/vsu/opt/emacs --with-x --without-toolkit-scroll-bars' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: ru_RU.KOI8-R value of $LC_CTYPE: ru_RU.KOI8-R value of $LC_MESSAGES: ru_RU.KOI8-R value of $LC_MONETARY: ru_RU.KOI8-R value of $LC_NUMERIC: ru_RU.KOI8-R value of $LC_TIME: ru_RU.KOI8-R value of $LANG: ru_RU.KOI8-R locale-coding-system: cyrillic-koi8 default-enable-multibyte-characters: t I have tried to use the following configuration in my ~/.emacs: (setq scroll-conservatively 1000) (setq scroll-margin 1) (temp-buffer-resize-mode 1) (mwheel-install) In some cases when I try to use the mouse wheel Emacs gets stuck eating all CPU; C-g does not work; killing the Emacs process with SIGFPE breaks the loop. I have reduced the problem to the following test case (freshly started 'emacs -q --no-site-file', no X resources): M-x set-variable RET scroll-conservatively RET 1000 RET M-x set-variable RET scroll-margin RET 1 RET M-x temp-buffer-resize-mode RET C-h f mwheel-install RET (this produces a buffer with 4 lines of text, last line does not end with '\n) C-x o (switches to the *Help* buffer) M-: (scroll-up 3) RET (the number is 1 less than the buffer height) At this point Emacs does not respond even to C-g. Examination using gdb reveals that it is stuck in the loop in src/window.c:window_scroll_pixel_based(): 0x0807c935 in window_scroll_pixel_based (window=13, n=3, whole=0, noerror=0) at window.c:4127 4127 move_it_by_lines (&it, 1, 1); (gdb) l 4122 { 4123 /* We moved the window start towards ZV, so PT may be now 4124 in the scroll margin at the top. */ 4125 move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); 4126 while (it.current_y < this_scroll_margin) 4127 move_it_by_lines (&it, 1, 1); 4128 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); 4129 } 4130 else if (n < 0) 4131 { (More detailed gdb output is at the end of message.) The same behavior can be reproduced by adding one character at the end of the initial *scratch* buffer (there will be 5 lines of text (one of them empty), the last line not ending with '\n'), splitting the window (C-x 2) and resizing the window to 5 lines (so that the whole text will just fit), then doing (scroll-up 4). In fact, splitting is not absolutely necessary - the same infinite loop happens when the frame is resized vertically so that the text will just fit. Recent input: M-x s e t - v a r s c r o l l - c o n s 1 0 0 0 M-x s e t - v a r s c r o l l - m a r 1 M-x t e m p - b C-h f m w h e e l - i n C-x o M-: ( s c r o l l - u p SPC 3 ) M-x r e p o r t Recent messages: Loading tooltip...done For information about the GNU Project and its goals, type C-h C-p. Temp-Buffer-Resize mode enabled Loading view...done Type C-x 1 to remove help window. C-M-v to scroll the help. eval: Loading debug...done Entering debugger... [2 times] Loading emacsbug...done ==================== begin gdb output ==================== 0x0807c935 in window_scroll_pixel_based (window=13, n=3, whole=0, noerror=0) at window.c:4127 4127 move_it_by_lines (&it, 1, 1); (gdb) l 4122 { 4123 /* We moved the window start towards ZV, so PT may be now 4124 in the scroll margin at the top. */ 4125 move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); 4126 while (it.current_y < this_scroll_margin) 4127 move_it_by_lines (&it, 1, 1); 4128 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); 4129 } 4130 else if (n < 0) 4131 { (gdb) info locals it = { window = 1213260232, w = 0x850e1c8, f = 0x8495428, method = 0x8061ea0 , stop_charpos = 150, end_charpos = 150, s = 0x0, string_nchars = 0, region_beg_charpos = -1, region_end_charpos = -1, redisplay_end_trigger_charpos = 0, multibyte_p = 1, header_line_p = 0, string_from_display_prop_p = 0, dp = 0x8492e80, dpvec = 0x0, dpend = 0x0, dpvec_char_len = 0, saved_face_id = 0, ctl_chars = {0 }, current = { pos = { charpos = 150, bytepos = 150 }, overlay_string_index = -1, string_pos = { charpos = -1, bytepos = -1 }, dpvec_index = -1 }, overlay_strings = {0, 0, 0}, n_overlay_strings = 0, string = 405269724, stack = {{ stop_charpos = 0, face_id = 0, ---Type to continue, or q to quit--- string = 0, pos = { pos = { charpos = 0, bytepos = 0 }, overlay_string_index = 0, string_pos = { charpos = 0, bytepos = 0 }, dpvec_index = 0 }, end_charpos = 0, string_nchars = 0, area = LEFT_MARGIN_AREA, multibyte_p = 0, string_from_display_prop_p = 0, display_ellipsis_p = 0, space_width = 0, voffset = 0, font_height = 0 }, { stop_charpos = 0, face_id = 0, string = 0, pos = { pos = { charpos = 0, bytepos = 0 }, overlay_string_index = 0, string_pos = { charpos = 0, bytepos = 0 }, dpvec_index = 0 }, end_charpos = 0, ---Type to continue, or q to quit--- string_nchars = 0, area = LEFT_MARGIN_AREA, multibyte_p = 0, string_from_display_prop_p = 0, display_ellipsis_p = 0, space_width = 0, voffset = 0, font_height = 0 }}, sp = 0, selective_display_ellipsis_p = 1, ctl_arrow_p = 1, selective = 0, what = IT_EOB, face_id = 0, face_box_p = 0, start_of_box_run_p = 0, end_of_box_run_p = 0, overlay_strings_at_end_processed_p = 1, glyph_not_available_p = 0, starts_in_middle_of_char_p = 0, face_before_selective_p = 0, base_face_id = 0, c = 46, len = 1, cmp_id = 0, cmp_len = 0, char_to_display = 46, image_id = 0, space_width = 405269724, voffset = 0, font_height = 405269724, object = 1211261376, position = { charpos = 150, bytepos = 150 }, truncate_lines_p = 0, tab_width = 8, ---Type to continue, or q to quit--- truncation_pixel_width = 0, continuation_pixel_width = 0, first_visible_x = 0, last_visible_x = 560, last_visible_y = 52, extra_line_spacing = 0, glyph_row = 0x85ba0f8, area = TEXT_AREA, nglyphs = 1, pixel_width = 7, ascent = 10, descent = 3, max_ascent = 10, max_descent = 3, phys_ascent = 1, phys_descent = 0, max_phys_ascent = 10, max_phys_descent = 3, current_x = 189, continuation_lines_width = 0, current_y = 0, vpos = 0, hpos = 27 } w = (struct window *) 0x850e1c8 start = { charpos = 674853048, bytepos = 1 } tem = 1 this_scroll_margin = 13 preserve_y = 13 vscrolled = 0 ==================== end gdb output ==================== -- Sergey Vlasov