aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorPaul Eggert2012-09-04 11:29:04 -0700
committerPaul Eggert2012-09-04 11:29:04 -0700
commitcf29dd84d205e1c78fed5d1ea0006a382658598c (patch)
tree7e6806fdd94ef53cda78db6b29a4df0276408eb4 /doc
parent972debf2e7381b4fd2c70f9c1fd585d8bd137917 (diff)
downloademacs-cf29dd84d205e1c78fed5d1ea0006a382658598c.tar.gz
emacs-cf29dd84d205e1c78fed5d1ea0006a382658598c.zip
Give more-useful info on a fatal error (Bug#12328).
* doc/emacs/trouble.texi (Crashing): New section, documenting this. * etc/NEWS: Document the change. * src/alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>. (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead of doing the work ourselves. * src/emacs.c (fatal_error_signal): Let fatal_error_backtrace do most of the work. (fatal_error_backtrace): New function, taken from the guts of the old fatal_error_signal, but with a new option to output a backtrace. (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful info about the signal than just its number. * src/lisp.h (fatal_error_backtrace, emacs_backtrace): New decls. * src/sysdep.c: Include <execinfo.h> (emacs_backtrace): New function, taken partly from the previous code of the 'die' function. (emacs_abort): Call fatal_error_backtrace rather than abort.
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/ChangeLog5
-rw-r--r--doc/emacs/emacs.texi3
-rw-r--r--doc/emacs/trouble.texi39
3 files changed, 46 insertions, 1 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index a4f9985ad85..78f1d2c8e3b 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,8 @@
12012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2
3 Give more-useful info on a fatal error (Bug#12328).
4 * trouble.texi (Crashing): New section, documenting this.
5
12012-08-24 Michael Albinus <michael.albinus@gmx.de> 62012-08-24 Michael Albinus <michael.albinus@gmx.de>
2 7
3 * cmdargs.texi (General Variables): Setting 8 * cmdargs.texi (General Variables): Setting
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi
index 6357aebc6ff..192a9a2bb28 100644
--- a/doc/emacs/emacs.texi
+++ b/doc/emacs/emacs.texi
@@ -1136,6 +1136,7 @@ Dealing with Emacs Trouble
1136* Screen Garbled:: Garbage on the screen. 1136* Screen Garbled:: Garbage on the screen.
1137* Text Garbled:: Garbage in the text. 1137* Text Garbled:: Garbage in the text.
1138* Memory Full:: How to cope when you run out of memory. 1138* Memory Full:: How to cope when you run out of memory.
1139* Crashing:: What Emacs does when it crashes.
1139* After a Crash:: Recovering editing in an Emacs session that crashed. 1140* After a Crash:: Recovering editing in an Emacs session that crashed.
1140* Emergency Escape:: What to do if Emacs stops responding. 1141* Emergency Escape:: What to do if Emacs stops responding.
1141 1142
@@ -1320,7 +1321,7 @@ when you get it, not just free for the manufacturer.
1320If you find GNU Emacs useful, please @strong{send a donation} to the 1321If you find GNU Emacs useful, please @strong{send a donation} to the
1321Free Software Foundation to support our work. Donations to the Free 1322Free Software Foundation to support our work. Donations to the Free
1322Software Foundation are tax deductible in the US. If you use GNU Emacs 1323Software Foundation are tax deductible in the US. If you use GNU Emacs
1323at your workplace, please suggest that the company make a donation. 1324at your workplace, please suggest that the company make a donation.
1324For more information on how you can help, see 1325For more information on how you can help, see
1325@url{http://www.gnu.org/help/help.html}. 1326@url{http://www.gnu.org/help/help.html}.
1326 1327
diff --git a/doc/emacs/trouble.texi b/doc/emacs/trouble.texi
index 025185c583f..1806339e45d 100644
--- a/doc/emacs/trouble.texi
+++ b/doc/emacs/trouble.texi
@@ -149,6 +149,7 @@ Emacs.
149* Screen Garbled:: Garbage on the screen. 149* Screen Garbled:: Garbage on the screen.
150* Text Garbled:: Garbage in the text. 150* Text Garbled:: Garbage in the text.
151* Memory Full:: How to cope when you run out of memory. 151* Memory Full:: How to cope when you run out of memory.
152* Crashing:: What Emacs does when it crashes.
152* After a Crash:: Recovering editing in an Emacs session that crashed. 153* After a Crash:: Recovering editing in an Emacs session that crashed.
153* Emergency Escape:: What to do if Emacs stops responding. 154* Emergency Escape:: What to do if Emacs stops responding.
154@end menu 155@end menu
@@ -277,6 +278,44 @@ editing in the same Emacs session.
277out of memory, because the buffer menu needs a fair amount of memory 278out of memory, because the buffer menu needs a fair amount of memory
278itself, and the reserve supply may not be enough. 279itself, and the reserve supply may not be enough.
279 280
281@node Crashing
282@subsection When Emacs Crashes
283
284 Emacs is not supposed to crash, but if it does, before it exits it
285reports some information about the crash to the standard error stream
286@code{stderr}. This report may be useful to someone who later debugs
287the same version of Emacs on the same platform. The format of this
288report depends on the platform, and some platforms support backtraces.
289Here is an example, generated on x86-64 GNU/Linux with version 2.15 of
290the GNU C Library:
291
292@example
293Fatal error 11: Segmentation fault
294Backtrace:
295emacs[0x5094e4]
296emacs[0x4ed3e6]
297emacs[0x4ed504]
298/lib64/libpthread.so.0[0x375220efe0]
299/lib64/libpthread.so.0(read+0xe)[0x375220e08e]
300emacs[0x509af6]
301emacs[0x5acc26]
302emacs[0x5adbfb]
303emacs[0x56566b]
304emacs[0x59bac3]
305emacs[0x565151]
306...
307@end example
308
309@noindent
310The number @samp{11} is the system signal number that corresponds to
311the problem, a segmentation fault here. The hexadecimal program
312addresses can be useful in debugging sessions. For example, the GDB
313command @samp{list *0x509af6} prints the source-code lines
314corresponding to the @samp{emacs[0x509af6]} entry in the backtrace.
315
316The three dots at the end indicate that Emacs suppressed further
317backtrace entries, in the interest of brevity.
318
280@node After a Crash 319@node After a Crash
281@subsection Recovery After a Crash 320@subsection Recovery After a Crash
282 321