[slime-devel] How to debug a crash?

Harald Hanche-Olsen hanche at math.ntnu.no
Sun Dec 3 22:05:19 UTC 2006


I have a certain Lisp file that appears to be toxic to the emacs/slime
combination.  If I edit the file while slime is running (by which I
just mean there is a slime-repl buffer with an active lisp in it),
emacs crashes.  If I edit the same file without slime being active, or
edit another lisp file in slime's presence, no crash.  Also, I get no
crash if emacs runs in a terminal.

I should mention that the file in question contains some nonstandard
lisp syntax.  I have a reader macro that reads in something like
@2006-12-03 and converts it to a date.  But of course, this is
harmless if read with standard syntax:  It just becomes another symbol.

I am somewhat at a loss as to how I can get enough information out of
the crash so as to gain some notion about why and how this happens.

A bit of background:  The slime is from cvs, downloaded in the past
few days.  The lisp is sbcl 1.0.  I am running GNU Emacs 23.0.0, the
emacs-unicode-2 branch out of cvs (somewhat stale) on Mac OS X 10.4.8.

If I start sbcl in a terminal window, run (swank:create-server
:dont-close) and the connect from slime and trigger the bug, this is
what I see in the terminal

;; swank:close-connection: end of file on #<sb-sys:fd-stream for "a constant string" {11CFA201}>

which I suppose is the expected result if emacs just goes away for any
reason.

The crash leaves a backtrace in
Library/Logs/CrashReporter/emacs.crash.log
which could actually be informative, since my emacs is not stripped.
I include it below, in case anybody can make sense out of it.
But the following excerpt makes me wonder if it is really some
incoming data from the superior lisp that is causing the trouble?

37  emacs 	0x0015e68c read_process_output + 1236 (process.c:5088)
38  emacs 	0x00160fd4 wait_reading_process_output + 4200 (process.c:4697)
39  emacs 	0x0000bcd0 sit_for + 216 (dispnew.c:6412)
40  emacs 	0x000be990 read_char + 3016 (keyboard.c:2777)
41  emacs 	0x000c1b18 read_key_sequence + 2440 (keyboard.c:8872)
42  emacs 	0x000c3768 command_loop_1 + 1064 (keyboard.c:1540)

Is there an easy way to get a trace of the traffic between emacs and
the superior lisp?  I know that some such information is traced on the
emacs side, but since emacs crashes, I cannot see it there.

- Harald


----------------------------------------------------------------
PS. Sorry, but I won't include the toxic file, as it contains
information of a private nature.

Anyway, here is the full backtrace.

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_INVALID_ADDRESS (0x0001) at 0x0110afff

Thread 0 Crashed:
0   emacs 	0x00145934 char_quoted + 120 (syntax.c:301)
1   emacs 	0x0014ae84 Fbackward_prefix_chars + 604 (syntax.c:2868)
2   emacs 	0x00125d8c Ffuncall + 844 (eval.c:2898)
3   emacs 	0x001571bc Fbyte_code + 2264 (bytecode.c:695)
4   emacs 	0x001258b8 funcall_lambda + 848 (eval.c:3088)
5   emacs 	0x00125f7c Ffuncall + 1340 (eval.c:2968)
6   emacs 	0x001571bc Fbyte_code + 2264 (bytecode.c:695)
7   emacs 	0x001258b8 funcall_lambda + 848 (eval.c:3088)
8   emacs 	0x00125f7c Ffuncall + 1340 (eval.c:2968)
9   emacs 	0x001571bc Fbyte_code + 2264 (bytecode.c:695)
10  emacs 	0x001258b8 funcall_lambda + 848 (eval.c:3088)
11  emacs 	0x00125f7c Ffuncall + 1340 (eval.c:2968)
12  emacs 	0x001571bc Fbyte_code + 2264 (bytecode.c:695)
13  emacs 	0x001258b8 funcall_lambda + 848 (eval.c:3088)
14  emacs 	0x00125f7c Ffuncall + 1340 (eval.c:2968)
15  emacs 	0x001571bc Fbyte_code + 2264 (bytecode.c:695)
16  emacs 	0x001258b8 funcall_lambda + 848 (eval.c:3088)
17  emacs 	0x001259d4 apply_lambda + 248 (eval.c:3013)
18  emacs 	0x00125198 Feval + 1312 (eval.c:2283)
19  emacs 	0x0012553c Fprogn + 60 (eval.c:432)
20  emacs 	0x00128010 Flet + 504 (eval.c:1053)
21  emacs 	0x00125280 Feval + 1544 (eval.c:2306)
22  emacs 	0x0012553c Fprogn + 60 (eval.c:432)
23  emacs 	0x00125888 funcall_lambda + 800 (eval.c:3081)
24  emacs 	0x00125f7c Ffuncall + 1340 (eval.c:2968)
25  emacs 	0x001571bc Fbyte_code + 2264 (bytecode.c:695)
26  emacs 	0x001258b8 funcall_lambda + 848 (eval.c:3088)
27  emacs 	0x00125f7c Ffuncall + 1340 (eval.c:2968)
28  emacs 	0x001571bc Fbyte_code + 2264 (bytecode.c:695)
29  emacs 	0x001258b8 funcall_lambda + 848 (eval.c:3088)
30  emacs 	0x00125f7c Ffuncall + 1340 (eval.c:2968)
31  emacs 	0x001571bc Fbyte_code + 2264 (bytecode.c:695)
32  emacs 	0x001258b8 funcall_lambda + 848 (eval.c:3088)
33  emacs 	0x00125f7c Ffuncall + 1340 (eval.c:2968)
34  emacs 	0x00127848 Fapply + 532 (eval.c:2394)
35  emacs 	0x001278b4 apply1 + 88 (eval.c:2659)
36  emacs 	0x001237ec internal_condition_case_1 + 352 (eval.c:1522)
37  emacs 	0x0015e68c read_process_output + 1236 (process.c:5088)
38  emacs 	0x00160fd4 wait_reading_process_output + 4200 (process.c:4697)
39  emacs 	0x0000bcd0 sit_for + 216 (dispnew.c:6412)
40  emacs 	0x000be990 read_char + 3016 (keyboard.c:2777)
41  emacs 	0x000c1b18 read_key_sequence + 2440 (keyboard.c:8872)
42  emacs 	0x000c3768 command_loop_1 + 1064 (keyboard.c:1540)
43  emacs 	0x00123aec internal_condition_case + 344 (eval.c:1474)
44  emacs 	0x000b538c command_loop_2 + 64 (keyboard.c:1329)
45  emacs 	0x00123660 internal_catch + 256 (eval.c:1211)
46  emacs 	0x000b5078 command_loop + 148 (keyboard.c:1311)
47  emacs 	0x000b5190 recursive_edit_1 + 176 (keyboard.c:1001)
48  emacs 	0x000b5308 Frecursive_edit + 256 (keyboard.c:1063)
49  emacs 	0x000b4ba8 main + 4496 (emacs.c:1800)
50  emacs 	0x000024d0 _start + 348 (crt.c:272)
51  emacs 	0x00002370 start + 60



More information about the slime-devel mailing list