about photos bookshelf portfolio blog home
Begin main content

Tracking my cygwin emacs debugging

Emacs 22.50.1 (cvs) seems to crash randomly under cygwin.

I am going to keep a track of my research here. First backtraces fingers the garbage collector which would explain why it is somewhat random. I am keeping track of the stacktraces and other useful verbose stuff in the previous blog entry (cygwin emacs cvs stack traces) I have had the same backtrace a number of times now.

The exit is caused by hitting the default clause of a case LispCons in alloc.c which I am now printing to stderr. I know nothing about cygwin api's, but here goes nothing!

Update: my c is rustier than an outback dunny! case is the match point of the switch construct (I was thinking the other way around) so my stderr print was silly! Of course since the breakpoint hits before the process exits I was able to just walk one level back up the stack and use pr to dump the lisp object. (If you're trying to debug emacs, make sure you at least browse etc/DEBUG in the emacs source). The problem is that the lisp datatype checker has no idea what it is:

(gdb) pr obj
#<EMACS BUG: INVALID DATATYPE (0x07) Save your buffers immediately and please report this bug>

So it's no wonder the garbage collector is having trouble.

Update: gdb + google = easy debugging! It seems to be the same problem as this thread: http://lists.gnu.org/archive/html/emacs-pretest-bug/2005-01/msg00301.html
and this one: http://lists.gnu.org/archive/html/emacs-pretest-bug/2005-09/msg00079.html

Update: well none of the threads I found helped me any, they are all inconclusive... Since it's *just* garbage collection, I can run crash free by just eliminating the abort, but that leads to a super phat memory leak. Open 20 frames and you've use 88Mb. Close 19 of them and you are still using 88 Mb!

Update: Seems ok in normal usage (and with plenty of VM to soak up the objects where garbage collection fails) but I would really like to get this bug fixed as I will be using emacs on cygwin for some time.

Update: Bug is still there as of 2006-12-15. See this entry for a current patch.

12:35 PM, 02 Dec 2005 by Mark Aufflick Permalink | Comments (0)

cygwin emacs cvs stack traces

Breakpoint 1, abort () at emacs.c:461
461      kill (getpid (), SIGABRT);
(gdb) bt
#0  abort () at emacs.c:461
#1  0x200efb11 in mark_object (arg=536989607) at alloc.c:5613
#2  0x200f048f in Fgarbage_collect () at alloc.c:4955
#3  0x20104673 in Feval (form=541751997) at eval.c:2116
#4  0x20103398 in internal_condition_case_1 (bfun=0x201045d0 <Feval>,
    arg=541751997, handlers=539968089,
    hfun=0x200a2aa0 <menu_item_eval_property_1>) at eval.c:1506
#5  0x200a2b32 in menu_item_eval_property (sexpr=541751997) at keyboard.c:7176
#6  0x200aeece in get_keyelt (object=540125025, autoload=1) at keymap.c:811
#7  0x200af523 in access_keymap (map=539900333, idx=539933345, t_ok=2,
    noinherit=0, autoload=1) at keymap.c:643
#8  0x200a37fc in tool_bar_items (reuse=566309892, nitems=0x22dcf8)
    at keyboard.c:7631
#9  0x2001d18f in update_tool_bar (f=0x212c4400, save_match_data=0)
    at xdisp.c:9193
#10 0x2002b080 in prepare_menu_bars () at xdisp.c:8899
#11 0x2002bd2e in redisplay_internal (preserve_echo_area=7) at xdisp.c:10584
#12 0x200a7011 in read_char (commandflag=1, nmaps=2, maps=0x22e920,
    prev_event=539912193, used_mouse_menu=0x22e968) at keyboard.c:2535
#13 0x200a99f7 in read_key_sequence (keybuf=0x22eac0, bufsize=30,
    prompt=539912193, dont_downcase_last=0, can_return_switch_frame=1,
    fix_current_buffer=1) at keyboard.c:8840
#14 0x200ab511 in command_loop_1 () at keyboard.c:1523

12:06 PM, 02 Dec 2005 by Mark Aufflick Permalink | Comments (0)

XML

Blog Categories

software (4)
  ..heads up 'tunes (4)

Notifications

Icon of Envelope Request notifications

Syndication Feed

XML

Recent Comments

  1. Mark Aufflick: all good ideas
  2. Unregistered Visitor: Excellent!
  3. Mark Aufflick: Hey thanks
  4. Unregistered Visitor: Fantastic entry
  5. Mark Aufflick: Bah - dashboard widgets
  6. Unregistered Visitor: Nice
  7. Mark Aufflick: elegant maths (as opposed to elegant rabbit)
  8. Unregistered Visitor: Does that really matter?
  9. Mark Aufflick: Inspiration
  10. Unregistered Visitor: Perhaps...