emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

abort in marker.c


From: Alex Schroeder
Subject: abort in marker.c
Date: Mon, 13 Jan 2003 23:41:55 +0100
User-agent: Gnus/5.090011 (Oort Gnus v0.11) Emacs/21.2.92 (i686-pc-linux-gnu)

In GNU Emacs 21.2.92.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2002-11-22 on confusibombus


Another abort being triggered...  Am I the only one getting these?
Perhaps I should be added to some pretester list in order to get some
impression of how others are doing.  :)

Remember I was having a few SIGSEGV in the redisplay code, and
recompiled using GLYPH_DEBUG.  I also got an abort call due to the
last frame being deleted.  This is something new, I think:

Program received signal SIGSEGV, Segmentation fault.
0x080ef9f4 in marker_byte_position (marker=405209204) at marker.c:812
812       if (i < BUF_BEG_BYTE (buf) || i > BUF_Z_BYTE (buf))
(gdb) l
807       register int i = m->bytepos;
808
809       if (!buf)
810         error ("Marker does not point anywhere");
811
812       if (i < BUF_BEG_BYTE (buf) || i > BUF_Z_BYTE (buf))
813         abort ();
814
815       return i;
816     }
(gdb) bt
#0  0x080ef9f4 in marker_byte_position (marker=405209204) at marker.c:812
#1  0x080e5793 in set_buffer_internal_1 (b=0x827005c) at buffer.c:1679
#2  0x080e5672 in set_buffer_internal (b=0x827005c) at buffer.c:1611
#3  0x080d121a in command_loop_1 () at keyboard.c:1373
#4  0x08122249 in internal_condition_case (bfun=0x80d1090 <command_loop_1>, 
    handlers=405305524, hfun=0x80d0cd4 <cmd_error>) at eval.c:1267
#5  0x080d0f68 in command_loop_2 () at keyboard.c:1245
#6  0x08121ddd in internal_catch (tag=405267108, 
    func=0x80d0f44 <command_loop_2>, arg=405209180) at eval.c:1030
#7  0x080d0f17 in command_loop () at keyboard.c:1224
#8  0x080d0a91 in recursive_edit_1 () at keyboard.c:950
#9  0x080d0bc0 in Frecursive_edit () at keyboard.c:1006
#10 0x080cfaef in main (argc=1, argv=0xbffffcd4, envp=0xbffffcdc)
    at emacs.c:1547
(gdb) p i
$1 = 405209180
(gdb) p buf
$2 = (struct buffer *) 0x18270074
(gdb) p marker
$3 = 405209204
(gdb) p m
$4 = (struct Lisp_Marker *) 0x8270074


Since I got a SIGSEGV, I think I am in "Deep Trouble" according to
etc/DEBUG and thus I should not use pr and the other stuff.  The only
unusual thing I remember doing today having to do with markers is that
I used point-to-register at some point.  I usually never use it.
Emacs crashed as I was changing window configurations, I think.

Let me check that:

(gdb) up 2
#2  0x080e5672 in set_buffer_internal (b=0x827005c) at buffer.c:1611
1611        set_buffer_internal_1 (b);
(gdb) up
#3  0x080d121a in command_loop_1 () at keyboard.c:1373
1373            set_buffer_internal (XBUFFER (XWINDOW 
(selected_window)->buffer));
(gdb) l
1368          if (! FRAME_LIVE_P (XFRAME (selected_frame)))
1369            Fkill_emacs (Qnil);
1370
1371          /* Make sure the current window's buffer is selected.  */
1372          if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
1373            set_buffer_internal (XBUFFER (XWINDOW 
(selected_window)->buffer));
1374
1375          /* Display any malloc warning that just came out.  Use while 
because
1376             displaying one warning can cause another.  */
1377
(gdb) p real_this_command
$5 = 405427052
(gdb) xtype
Lisp_Symbol
0
(gdb) xsymbol
$6 = (struct Lisp_Symbol *) 0x82a536c
0x818c854 "delete-window"

Seems to be correct.

So now one level down -- why is set_buffer_internal_1 being called...

(gdb) down
#2  0x080e5672 in set_buffer_internal (b=0x827005c) at buffer.c:1611
1611        set_buffer_internal_1 (b);
(gdb) p b
$7 = (struct buffer *) 0x8270074
(gdb) xtype
Argument to arithmetic operation not a number or boolean.
(gdb) p b
$8 = (struct buffer *) 0x8270074
(gdb) p current_buffer
$9 = (struct buffer *) 0x827005c

Ok, they seem to be two buffers...  (I am no GDB and C expert -- at
this time I did not know how to print b.)

(gdb) show print pretty
Prettyprinting of structures is on.

Anyway, now let me start checking how big the buffer is supposed to
be, so that we can then check whether the position i (405209180) is in
the range.

(gdb) p b->pt
$10 = 135788160
(gdb) p b->begv
$11 = 405209204
(gdb) p b->zv
$12 = 1210536088

It seems that i is smaller than begv -- and the comment in buffer.h
says: "Char position of beginning of accessible range." -- I guess
that means this position is not "accessible" -- whatever that means.
Just to be sure, let me repeat that with the bytes.

(gdb) p b->pt_byte
$13 = 405209204
(gdb) p b->begv_byte
$14 = 1478949956
(gdb) p b->zv_byte
$15 = 0

Hm.  Now that looks fishy.  Let me check the BUF_Z_BYTE macro again:

#define BUF_Z_BYTE(buf) ((buf)->text->z_byte)

Hm.  That is not the same as BUF_ZV_BYTE, I see now.

#define BUF_ZV_BYTE(buf) ((buf)->zv_byte)

Oh well, let me examine the text, then.

(gdb) p b->text
$16 = (struct buffer_text *) 0x0

Ah...  But what next?

The comment says: "This points to the `struct buffer_text' that used
for this buffer.  In an ordinary buffer, this is the own_text field
above.  In an indirect buffer, this is the own_text field of another
buffer."

Ok, so what is own_text?

(gdb) p b->own_text
$17 = {
  beg = 0x18270074 <Address 0x18270074 out of bounds>, 
  gpt = 405209180, 
  z = 405209180, 
  gpt_byte = 0, 
  z_byte = 135788100, 
  gap_size = 405209228, 
  modiff = 405209204, 
  save_modiff = 1479386692, 
  overlay_modiff = 1210536088, 
  beg_unchanged = 0, 
  end_unchanged = 405209180, 
  unchanged_modified = 405209204, 
  overlay_unchanged_modified = 405209204, 
  intervals = 0x1827005c, 
  markers = 1210536088
}

Somehow this does not look right:  <Address 0x... out of bounds>

This time it pretty printed.  And I think I know why: b is a pointer
to a buffer struct -- not a struct itself.  My C is rusty...

(gdb) p &b
Address requested for identifier "b" which is in register $eax
(gdb) p *b
$18 = {
  size = 135788076, 
  next = 0x18270074, 
  own_text = {
    beg = 0x18270074 <Address 0x18270074 out of bounds>, 
    gpt = 405209180, 
    z = 405209180, 
    gpt_byte = 0, 
    z_byte = 135788100, 
    gap_size = 405209228, 
    modiff = 405209204, 
    save_modiff = 1479386692, 
    overlay_modiff = 1210536088, 
    beg_unchanged = 0, 
    end_unchanged = 405209180, 
    unchanged_modified = 405209204, 
    overlay_unchanged_modified = 405209204, 
    intervals = 0x1827005c, 
    markers = 1210536088
  }, 
  text = 0x0, 
  pt = 135788160, 
  pt_byte = 405209204, 
  begv = 405209204, 
  begv_byte = 1478949956, 
  zv = 1210536088, 
  zv_byte = 0, 
  base_buffer = 0x817f6a0, 
  local_flags = 
"t\0'\030t\0'\030\\\0'\030\230P'H\0\0\0\0\310\366\027\bt\0'\030t\0'\030\264\360,X\230P'H\244\0'\b\340\366\027\bt",
 
  modtime = 1210263032, 
  auto_save_modified = 1478990668, 
  auto_save_failure_time = 25964, 
  last_window_start = 0, 
  clip_changed = 135788288, 
  newline_cache = 0x18270074, 
  width_run_cache = 0x4817b8f8, 
  prevent_redisplay_optimizations_p = 0, 
  undo_list = 1210536088, 
  name = 0, 
  filename = 135788320, 
  directory = 405209204, 
  backed_up = 405209204, 
  save_length = 1478990764, 
  auto_save_file_name = 1210536088, 
  read_only = 0, 
  mark = 135788348, 
  local_var_alist = 405209204, 
  major_mode = 1209696260, 
  mode_name = 405209180, 
  mode_line_format = 1210536088, 
  header_line_format = 0, 
  keymap = 135788384, 
  abbrev_table = 405209204, 
  syntax_table = 405209204, 
  category_table = 405209180, 
  case_fold_search = 1210536088, 
  tab_width = 0, 
  fill_column = 135788412, 
  left_margin = 405209204, 
  auto_fill_function = 405209204, 
  buffer_file_type = 1479053028, 
  downcase_table = 1210536088, 
  upcase_table = 0, 
  case_canon_table = 135788444, 
  case_eqv_table = 405209204, 
  truncate_lines = 405209204, 
  ctl_arrow = 405209180, 
  direction_reversed = 1210536088, 
  selective_display = 0, 
  selective_display_ellipses = 135788476, 
  minor_modes = 688308324, 
  overwrite_mode = 405209204, 
  abbrev_mode = 1480424956, 
  display_table = 1210536088, 
  mark_active = 0, 
  overlays_before = 135788512, 
  overlays_after = 405209204, 
  overlay_center = 405209204, 
  enable_multibyte_characters = 1479340164, 
  buffer_file_coding_system = 1210536088, 
  file_format = 0, 
  cache_long_line_scans = 135788536, 
  width_table = 405209204, 
  pt_marker = 1209514968, 
  begv_marker = 405209180, 
  zv_marker = 1210536088, 
  point_before_scroll = 0, 
  file_truename = 135788568, 
  invisibility_spec = 405209204, 
  last_selected_window = 406840436, 
  display_count = 1480118716, 
  left_margin_width = 1210536088, 
  right_margin_width = 0, 
  indicate_empty_lines = 135788612, 
  display_time = 405209612, 
  scroll_up_aggressively = 405209204, 
  scroll_down_aggressively = 405209180, 
  cursor_type = 1210536088, 
  extra_line_spacing = 0
}

I don't know whether that is useful or not.  If you have a suggestion
for what to try next time, please advise.  :)

Alex.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]