all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Emacs abort
@ 2005-02-15 20:42 Martin Fredriksson
  2005-02-17  9:43 ` Kim F. Storm
  2005-02-17 10:35 ` Richard Stallman
  0 siblings, 2 replies; 4+ messages in thread
From: Martin Fredriksson @ 2005-02-15 20:42 UTC (permalink / raw)
  Cc: emacs-devel

I have now verified the abort also in Linux.  The abort happens when 
invoking outline-minor-mode 'show-all' after a previous 'hide-body', 
when part of the buffer is not visible (scrolled).  The abort only 
happens when using keys, not when invoking with 'M-x show-all'.

The steps to trigger this are:

(1) gdb ./emacs
     (gdb) run -q

(2) Open apa.txt, select outline minor mode (M-x outline-minor-mode) 
and go to end of buffer.

(3) Hide body:
     C-c @ C-t

(4) Go up two lines (previous-line x 2)

(5) Show all (must be done using keys):
     C-c @ C-a

ABORT

In GNU Emacs 22.0.50.1 (i686-pc-linux-gnu, X toolkit)
  of 2005-02-15 on tilin
Distributor `The XFree86 Project, Inc', version 11.0.40300000

Some gdb output below:

Breakpoint 1 at 0x80d953e: file emacs.c, line 454.
Breakpoint 2 at 0x80bcb04: file xterm.c, line 7794.
(gdb) run -q
Starting program: /users/mogf/work/emacs/src/emacs -q

Breakpoint 1, abort () at emacs.c:454
454       kill (getpid (), SIGABRT);
(gdb) bt
#0  abort () at emacs.c:454
#1  0x08072264 in find_first_unchanged_at_end_row (w=0x9b4e548, 
delta=0xbfff8a28, delta_bytes=0xbfff8a2c)
     at xdisp.c:13128
#2  0x08072816 in try_window_id (w=0x84e06e0) at xdisp.c:13559
#3  0x080701e5 in redisplay_window (window=139331300, 
just_this_one_p=1) at xdisp.c:12104
#4  0x0806d24d in redisplay_window_1 (window=139331300) at xdisp.c:10826
#5  0x08135310 in internal_condition_case_1 (bfun=0x806d220 
<redisplay_window_1>, arg=139331300,
     handlers=137296213, hfun=0x806d1d0 <redisplay_window_error>) at 
eval.c:1426
#6  0x0806c736 in redisplay_internal (preserve_echo_area=0) at 
xdisp.c:10448
#7  0x0806b531 in redisplay () at xdisp.c:9609
#8  0x080df1a1 in read_char (commandflag=1, nmaps=3, maps=0xbfff9860, 
prev_event=137269265,
     used_mouse_menu=0xbfff9898) at keyboard.c:2540
#9  0x080e5252 in read_key_sequence (keybuf=0xbfff99d0, bufsize=30, 
prompt=137269265, dont_downcase_last=0,
     can_return_switch_frame=1, fix_current_buffer=1) at keyboard.c:8799
#10 0x080dc230 in command_loop_1 () at keyboard.c:1534
#11 0x08135216 in internal_condition_case (bfun=0x80dc0b8 
<command_loop_1>, handlers=137330257,
     hfun=0x80dbc34 <cmd_error>) at eval.c:1385
#12 0x080dbf3e in command_loop_2 () at keyboard.c:1315
#13 0x08134da9 in internal_catch (tag=2048, func=0x80dbf20 
<command_loop_2>, arg=137269265) at eval.c:1144
#14 0x080dbef5 in command_loop () at keyboard.c:1294
#15 0x080db9ec in recursive_edit_1 () at keyboard.c:987
#16 0x080dbb0c in Frecursive_edit () at keyboard.c:1048
#17 0x080da2f7 in main (argc=2, argv=0xbfff9fe4) at emacs.c:1763
(gdb) up 1
#1  0x08072264 in find_first_unchanged_at_end_row (w=0x9b4e548, 
delta=0xbfff8a28, delta_bytes=0xbfff8a2c)
     at xdisp.c:13128
13128       abort ();
(gdb) p row_found
$1 = (struct glyph_row *) 0x0
(gdb) p *row_found
Cannot access memory at address 0x0
(gdb) p row
$2 = (struct glyph_row *) 0x9b4e668
(gdb) p *row_found
Cannot access memory at address 0x0
(gdb) p *row
$3 = {
   glyphs = {0x9a8ff38, 0x9a8ff38, 0x9a91ff8, 0x9a91ff8},
   used = {0, 14, 0},
   x = 0,
   y = 26,
   pixel_width = 84,
   ascent = 11,
   height = 13,
   phys_ascent = 11,
   phys_height = 13,
   visible_height = 13,
   extra_line_spacing = 0,
   hash = 265403400,
   start = {
     pos = {
       charpos = 153,
       bytepos = 153
     },
     overlay_string_index = -1,
     string_pos = {
       charpos = -1,
       bytepos = -1
     },
     dpvec_index = -1
   },
   end = {
     pos = {
       charpos = 244,
       bytepos = 244
     },
     overlay_string_index = -1,
     string_pos = {
       charpos = -1,
       bytepos = -1
     },
     dpvec_index = -1
   },
   left_user_fringe_bitmap = 0,
   right_user_fringe_bitmap = 0,
---Type <return> to continue, or q <return> to quit---
   left_fringe_bitmap = 0,
   right_fringe_bitmap = 0,
   left_user_fringe_face_id = 0,
   right_user_fringe_face_id = 0,
   left_fringe_face_id = 0,
   right_fringe_face_id = 0,
   redraw_fringe_bitmaps_p = 0,
   enabled_p = 0,
   truncated_on_left_p = 0,
   truncated_on_right_p = 0,
   overlay_arrow_p = 0,
   continued_p = 0,
   displays_text_p = 1,
   ends_at_zv_p = 0,
   fill_line_p = 0,
   indicate_empty_line_p = 0,
   contains_overlapping_glyphs_p = 0,
   full_width_p = 0,
   mode_line_p = 0,
   overlapped_p = 0,
   ends_in_middle_of_char_p = 0,
   starts_in_middle_of_char_p = 0,
   overlapping_p = 0,
   mouse_face_p = 0,
   ends_in_newline_from_string_p = 0,
   exact_window_width_line_p = 0,
   cursor_in_fringe_p = 0,
   ends_in_ellipsis_p = 0,
   indicate_bob_p = 0,
   indicate_top_line_p = 0,
   indicate_eob_p = 0,
   indicate_bottom_line_p = 0,
   continuation_lines_width = 0
}
(gdb) p *delta
$4 = 0
(gdb) p *delta_bytes
$5 = 0
(gdb) p *w
$6 = {
   size = 162330480,
   vec_next = 0x9acf770,
   frame = 162338864,
   mini_p = 162338864,
   next = 983040,
   prev = 0,
   hchild = 0,
   vchild = 0,
   parent = 90,
   left_col = 11,
   top_line = 13,
   total_lines = 11,
   total_cols = 13,
   buffer = 13,
   start = 0,
   pointm = 97500210,
   force_start = 1,
   optional_new_start = 1,
   hscroll = -1,
   min_hscroll = -1,
   use_time = -1,
   sequence_number = -1,
   temslot = 27,
   last_modified = 27,
   last_overlay_modified = -1,
   last_point = -1,
   last_had_star = -1,
   vertical_scroll_bar = -1,
   left_margin_cols = 0,
   right_margin_cols = 0,
   left_fringe_width = 0,
   right_fringe_width = 0,
   fringes_outside_margins = 0,
   scroll_bar_width = 138412032,
   vertical_scroll_bar_type = 0,
   last_mark_x = 0,
   last_mark_y = 162338872,
   window_end_pos = 162338872,
---Type <return> to continue, or q <return> to quit---
   window_end_vpos = 162347256,
   window_end_valid = 162347256,
   update_mode_line = 983040,
   start_at_line_beg = 0,
   display_table = 0,
   dedicated = 13,
   base_line_number = 90,
   base_line_pos = 11,
   region_showing = 13,
   column_number_displayed = 11,
   redisplay_end_trigger = 13,
   too_small_ok = 13,
   orig_total_lines = 0,
   orig_top_line = 97565746,
   current_matrix = 0x1b,
   desired_matrix = 0x1b,
   nrows_scale_factor = -1,
   ncols_scale_factor = -1,
   last_cursor = {
     x = -1,
     y = -1,
     hpos = 153,
     vpos = 153
   },
   cursor = {
     x = -1,
     y = -1,
     hpos = -1,
     vpos = -1
   },
   phys_cursor = {
     x = 0,
     y = 0,
     hpos = 0,
     vpos = 0
   },
   phys_cursor_type = 0,
   phys_cursor_width = 138412032,
   phys_cursor_ascent = 0,
---Type <return> to continue, or q <return> to quit---
   phys_cursor_height = 0,
   overlay_arrow_bitmap = 162070328,
   phys_cursor_on_p = 0,
   cursor_off_p = 0,
   last_cursor_off_p = 0,
   must_be_updated_p = 1,
   pseudo_window_p = 1,
   vscroll = 162078712,
   window_end_bytepos = 162078712,
   frozen_window_start_p = 0,
   height_fixed_p = 0
}
(gdb)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Emacs abort
  2005-02-15 20:42 Emacs abort Martin Fredriksson
@ 2005-02-17  9:43 ` Kim F. Storm
  2005-02-18  6:23   ` Martin Fredriksson
  2005-02-17 10:35 ` Richard Stallman
  1 sibling, 1 reply; 4+ messages in thread
From: Kim F. Storm @ 2005-02-17  9:43 UTC (permalink / raw)
  Cc: emacs-devel

Martin Fredriksson <m@rfc.se> writes:

> I have now verified the abort also in Linux.  The abort happens when
> invoking outline-minor-mode 'show-all' after a previous 'hide-body',
> when part of the buffer is not visible (scrolled).  The abort only
> happens when using keys, not when invoking with 'M-x show-all'.
>
> The steps to trigger this are:
>
> (1) gdb ./emacs
>      (gdb) run -q
>
> (2) Open apa.txt, select outline minor mode (M-x outline-minor-mode)
>     and go to end of buffer.
>
> (3) Hide body:
>      C-c @ C-t
>
> (4) Go up two lines (previous-line x 2)
>
> (5) Show all (must be done using keys):
>      C-c @ C-a
>


I still cannot make it fail even on GNU/Linux.

Does it fail if you start emacs -Q ?



Does the following patch fix the problem, or does it cause other
problems?

Index: xdisp.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/xdisp.c,v
retrieving revision 1.981
diff -c -r1.981 xdisp.c
*** xdisp.c	16 Feb 2005 23:45:03 -0000	1.981
--- xdisp.c	17 Feb 2005 09:40:56 -0000
***************
*** 13136,13142 ****
        for (; row > first_text_row; --row)
  	{
  	  if (!row->enabled_p || !MATRIX_ROW_DISPLAYS_TEXT_P (row))
! 	    abort ();
  
  	  if (MATRIX_ROW_START_CHARPOS (row) >= last_unchanged_pos_old)
  	    row_found = row;
--- 13140,13146 ----
        for (; row > first_text_row; --row)
  	{
  	  if (!row->enabled_p || !MATRIX_ROW_DISPLAYS_TEXT_P (row))
! 	    break;  /* abort (); */
  
  	  if (MATRIX_ROW_START_CHARPOS (row) >= last_unchanged_pos_old)
  	    row_found = row;

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Emacs abort
  2005-02-15 20:42 Emacs abort Martin Fredriksson
  2005-02-17  9:43 ` Kim F. Storm
@ 2005-02-17 10:35 ` Richard Stallman
  1 sibling, 0 replies; 4+ messages in thread
From: Richard Stallman @ 2005-02-17 10:35 UTC (permalink / raw)
  Cc: emacs-devel, storm

    I have now verified the abort also in Linux.

Please don't call our system "Linux".  The name we gave it is GNU.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Emacs abort
  2005-02-17  9:43 ` Kim F. Storm
@ 2005-02-18  6:23   ` Martin Fredriksson
  0 siblings, 0 replies; 4+ messages in thread
From: Martin Fredriksson @ 2005-02-18  6:23 UTC (permalink / raw)
  Cc: emacs-devel

On 17 feb 2005, at 10.43, Kim F. Storm wrote:

> Martin Fredriksson <m@rfc.se> writes:
>
>> I have now verified the abort also in Linux.  The abort happens when
>> invoking outline-minor-mode 'show-all' after a previous 'hide-body',
>> when part of the buffer is not visible (scrolled).  The abort only
>> happens when using keys, not when invoking with 'M-x show-all'.
>>
>> The steps to trigger this are:
>>
>> (1) gdb ./emacs
>>      (gdb) run -q
>>
>> (2) Open apa.txt, select outline minor mode (M-x outline-minor-mode)
>>     and go to end of buffer.
>>
>> (3) Hide body:
>>      C-c @ C-t
>>
>> (4) Go up two lines (previous-line x 2)
>>
>> (5) Show all (must be done using keys):
>>      C-c @ C-a
>>
>
>
> I still cannot make it fail even on GNU/Linux.

I can repeat it on several different platforms, so I guess it's my 
description which is faulty.

After step (2), the text in the buffer should have scrolled up and only 
the last 20 lines are visible and cursor is in the middle (vertically).

After step (3), text is still scrolled, but now most of it is hidden.  
My window now shows only two lines with the cursor on line 3.  
Following lines are visible ([C] = the cursor):

    ...
    *Section 3...
    [C]

Step (4) makes text scroll down so that all three lines (the three 
"section headings") are visible (the cursor is located at first 
position of line 2).

    * Section 1...
    * Section 2...
    *Section 3...

Now, invoking show-all using keys "C-c @ C-a" result in the abort().

> Does it fail if you start emacs -Q ?

Yes.

> Does the following patch fix the problem, or does it cause other
> problems?
>
>   	  if (!row->enabled_p || !MATRIX_ROW_DISPLAYS_TEXT_P (row))
> ! 	    break;  /* abort (); */

It seems to work (haven't seen any other problems).  I did try using 
'continue' myself but it felt wrong to just replace an "assert" like 
that?

Could it be that row->enabled_p is 0 due to 'hide-body' and that this 
"assert" is plain wrong?  In that case, perhaps 'continue' would be 
better?

I gladly do more tests if that can help?  In that case: do you have any 
suggestions as to what needs to be tested?

/m

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-02-18  6:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-15 20:42 Emacs abort Martin Fredriksson
2005-02-17  9:43 ` Kim F. Storm
2005-02-18  6:23   ` Martin Fredriksson
2005-02-17 10:35 ` Richard Stallman

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.