aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorK. Handa2016-01-08 23:21:43 +0900
committerK. Handa2016-01-08 23:21:43 +0900
commitf36805424633e3acb48ed9f0f729a36760e4cb7f (patch)
tree555f0e21f19aeee47d2855a5c7700afec5c81386 /src
parentbc9a28ab424647209cc2f91ad21cdb41a7052812 (diff)
parent4580671f5e2a68885e0fca93eeaf9daaeebe82b3 (diff)
downloademacs-f36805424633e3acb48ed9f0f729a36760e4cb7f.tar.gz
emacs-f36805424633e3acb48ed9f0f729a36760e4cb7f.zip
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.in22
-rw-r--r--src/emacs.c19
-rw-r--r--src/keyboard.c19
-rw-r--r--src/kqueue.c2
-rw-r--r--src/sysdep.c3
5 files changed, 46 insertions, 19 deletions
diff --git a/src/Makefile.in b/src/Makefile.in
index f96ebb2aeeb..97505b98687 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -649,32 +649,34 @@ extraclean: distclean
649 -rm -f *~ \#* 649 -rm -f *~ \#*
650 650
651 651
652ETAGS = ../lib-src/etags 652ETAGS = ../lib-src/etags${EXEEXT}
653 653
654ctagsfiles1 = [xyzXYZ]*.[hc] 654${ETAGS}: FORCE
655ctagsfiles2 = [a-wA-W]*.[hc] 655 ${MAKE} -C ../lib-src $(notdir $@)
656ctagsfiles3 = [a-zA-Z]*.m 656
657ctagsfiles1 = $(wildcard ${srcdir}/*.[hc])
658ctagsfiles2 = $(wildcard ${srcdir}/*.m)
657 659
658## FIXME? In out-of-tree builds, should TAGS be generated in srcdir? 660## FIXME? In out-of-tree builds, should TAGS be generated in srcdir?
659 661
660## This does not need to depend on ../lisp and ../lwlib TAGS files, 662## This does not need to depend on ../lisp and ../lwlib TAGS files,
661## because etags "--include" only includes a pointer to the file, 663## because etags "--include" only includes a pointer to the file,
662## rather than the file contents. 664## rather than the file contents.
663TAGS: $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2) $(srcdir)/$(ctagsfiles3) 665TAGS: ${ETAGS} $(ctagsfiles1) $(ctagsfiles2)
664 "$(ETAGS)" --include=../lisp/TAGS --include=$(lwlibdir)/TAGS \ 666 ${ETAGS} --include=../lisp/TAGS --include=$(lwlibdir)/TAGS \
665 --regex='{c}/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/\1/' \ 667 --regex='{c}/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/\1/' \
666 --regex='{c}/[ ]*DEFVAR_[A-Z_ (]+"[^"]+",[ ]\([A-Za-z0-9_]+\)/\1/' \ 668 --regex='{c}/[ ]*DEFVAR_[A-Z_ (]+"[^"]+",[ ]\([A-Za-z0-9_]+\)/\1/' \
667 $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2) \ 669 $(ctagsfiles1) \
668 --regex='{objc}/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/\1/' \ 670 --regex='{objc}/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/\1/' \
669 --regex='{objc}/[ ]*DEFVAR_[A-Z_ (]+"[^"]+",[ ]\([A-Za-z0-9_]+\)/\1/' \ 671 --regex='{objc}/[ ]*DEFVAR_[A-Z_ (]+"[^"]+",[ ]\([A-Za-z0-9_]+\)/\1/' \
670 $(srcdir)/$(ctagsfiles3) 672 $(ctagsfiles2)
671 673
672## Arrange to make tags tables for ../lisp and ../lwlib, 674## Arrange to make tags tables for ../lisp and ../lwlib,
673## which the above TAGS file for the C files includes by reference. 675## which the above TAGS file for the C files includes by reference.
674../lisp/TAGS: 676../lisp/TAGS: FORCE
675 $(MAKE) -C ../lisp TAGS ETAGS="$(ETAGS)" 677 $(MAKE) -C ../lisp TAGS ETAGS="$(ETAGS)"
676 678
677$(lwlibdir)/TAGS: 679$(lwlibdir)/TAGS: FORCE
678 $(MAKE) -C $(lwlibdir) TAGS ETAGS="$(ETAGS)" 680 $(MAKE) -C $(lwlibdir) TAGS ETAGS="$(ETAGS)"
679 681
680tags: TAGS ../lisp/TAGS $(lwlibdir)/TAGS 682tags: TAGS ../lisp/TAGS $(lwlibdir)/TAGS
diff --git a/src/emacs.c b/src/emacs.c
index 926aa989e6a..d13413d880b 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -370,17 +370,20 @@ terminate_due_to_signal (int sig, int backtrace_limit)
370{ 370{
371 signal (sig, SIG_DFL); 371 signal (sig, SIG_DFL);
372 372
373 /* If fatal error occurs in code below, avoid infinite recursion. */ 373 if (attempt_orderly_shutdown_on_fatal_signal)
374 if (! fatal_error_in_progress)
375 { 374 {
376 fatal_error_in_progress = 1; 375 /* If fatal error occurs in code below, avoid infinite recursion. */
376 if (! fatal_error_in_progress)
377 {
378 fatal_error_in_progress = 1;
377 379
378 totally_unblock_input (); 380 totally_unblock_input ();
379 if (sig == SIGTERM || sig == SIGHUP || sig == SIGINT) 381 if (sig == SIGTERM || sig == SIGHUP || sig == SIGINT)
380 Fkill_emacs (make_number (sig)); 382 Fkill_emacs (make_number (sig));
381 383
382 shut_down_emacs (sig, Qnil); 384 shut_down_emacs (sig, Qnil);
383 emacs_backtrace (backtrace_limit); 385 emacs_backtrace (backtrace_limit);
386 }
384 } 387 }
385 388
386 /* Signal the same code; this time it will really be fatal. 389 /* Signal the same code; this time it will really be fatal.
diff --git a/src/keyboard.c b/src/keyboard.c
index 6fa38aa1328..eb2c7563afd 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -11659,6 +11659,25 @@ Currently, the only supported values for this
11659variable are `sigusr1' and `sigusr2'. */); 11659variable are `sigusr1' and `sigusr2'. */);
11660 Vdebug_on_event = intern_c_string ("sigusr2"); 11660 Vdebug_on_event = intern_c_string ("sigusr2");
11661 11661
11662 DEFVAR_BOOL ("attempt-stack-overflow-recovery",
11663 attempt_stack_overflow_recovery,
11664 doc: /* If non-nil, attempt to recover from C stack
11665overflow. This recovery is unsafe and may lead to deadlocks or data
11666corruption, but it usually works and may preserve modified buffers
11667that would otherwise be lost. If nil, treat stack overflow like any
11668other kind of crash. */);
11669 attempt_stack_overflow_recovery = true;
11670
11671 DEFVAR_BOOL ("attempt-orderly-shutdown-on-fatal-signal",
11672 attempt_orderly_shutdown_on_fatal_signal,
11673 doc: /* If non-nil, attempt to perform an orderly
11674shutdown when Emacs receives a fatal signal (e.g., a crash).
11675This cleanup is unsafe and may lead to deadlocks or data corruption,
11676but it usually works and may preserve modified buffers that would
11677otherwise be lost. If nil, crash immediately in response to fatal
11678signals. */);
11679 attempt_orderly_shutdown_on_fatal_signal = true;
11680
11662 /* Create the initial keyboard. Qt means 'unset'. */ 11681 /* Create the initial keyboard. Qt means 'unset'. */
11663 initial_kboard = allocate_kboard (Qt); 11682 initial_kboard = allocate_kboard (Qt);
11664} 11683}
diff --git a/src/kqueue.c b/src/kqueue.c
index 1830040637e..e0ee5fb9d7b 100644
--- a/src/kqueue.c
+++ b/src/kqueue.c
@@ -257,7 +257,7 @@ kqueue_compare_dir_list
257 257
258 /* At this point, old_dl, new_dl and pending_dl shall be empty. 258 /* At this point, old_dl, new_dl and pending_dl shall be empty.
259 deleted_dl might not be empty when there was a rename to a 259 deleted_dl might not be empty when there was a rename to a
260 nonexisting file. Let's make a check for this (might be removed 260 nonexistent file. Let's make a check for this (might be removed
261 once the code is stable). */ 261 once the code is stable). */
262 if (! NILP (old_dl)) 262 if (! NILP (old_dl))
263 report_file_error ("Old list not empty", old_dl); 263 report_file_error ("Old list not empty", old_dl);
diff --git a/src/sysdep.c b/src/sysdep.c
index 1af323eb8d6..a29155c144a 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1622,6 +1622,9 @@ static unsigned char sigsegv_stack[SIGSTKSZ];
1622static bool 1622static bool
1623stack_overflow (siginfo_t *siginfo) 1623stack_overflow (siginfo_t *siginfo)
1624{ 1624{
1625 if (!attempt_stack_overflow_recovery)
1626 return false;
1627
1625 /* In theory, a more-accurate heuristic can be obtained by using 1628 /* In theory, a more-accurate heuristic can be obtained by using
1626 GNU/Linux pthread_getattr_np along with POSIX pthread_attr_getstack 1629 GNU/Linux pthread_getattr_np along with POSIX pthread_attr_getstack
1627 and pthread_attr_getguardsize to find the location and size of the 1630 and pthread_attr_getguardsize to find the location and size of the