unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#4228: 23.1; --script and stack-trace-on-error
@ 2009-08-21 22:38 ` Tom Tromey
  2009-08-21 23:05   ` Dan Nicolaescu
  2009-09-20 17:15   ` bug#4228: marked as done (23.1; --script and stack-trace-on-error) Emacs bug Tracking System
  0 siblings, 2 replies; 4+ messages in thread
From: Tom Tromey @ 2009-08-21 22:38 UTC (permalink / raw)
  To: bug-gnu-emacs


Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
and to the gnu.emacs.bug news group.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:


I have a script that I run using emacs --script.  When writing the
script, I get errors on occasion.  It would be very useful if
stack-trace-on-error worked in this situation.  Currently it does not.


If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
/usr/share/emacs/23.1/etc/DEBUG for instructions.


In GNU Emacs 23.1.1 (i386-redhat-linux-gnu, GTK+ Version 2.16.5)
 of 2009-08-03 on x86-5.fedora.phx.redhat.com
Windowing system distributor `The X.Org Foundation', version 11.0.10601901
configured using `configure  '--build=i386-redhat-linux-gnu' '--host=i386-redhat-linux-gnu' '--target=i586-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-dbus' '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xft' '--with-xpm' '--with-x-toolkit=gtk' 'build_alias=i386-redhat-linux-gnu' 'host_alias=i386-redhat-linux-gnu' 'target_alias=i586-redhat-linux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-bu
 ffer-size=4 -m32 -march=i586 -mtune=generic -fasynchronous-unwind-tables''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  erc-spelling-mode: t
  erc-truncate-mode: t
  diff-auto-refine-mode: t
  shell-dirtrack-mode: t
  highlight-changes-visible-mode: t
  flyspell-mode: t
  eldoc-mode: t
  erc-status-mode: t
  erc-services-mode: t
  erc-networks-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
h e r M-b M-l SPC l i s p SPC v a r s M-b M-b s t a 
t i c p r o ' d SPC C-e <return> ( d o l i s t SPC 
( v SPC s p e c M-/ ) <return> ( i n M-/ SPC ( c o 
n s SPC v SPC v ) ) ) C-f C-f C-o <tab> ; ; SPC n o 
n - g c - p r o f <backspace> ' d s <M-backspace> <M-backspace> 
<M-backspace> s t a t M-/ C-g i <backspace> p r o s 
' <backspace> <backspace> <M-backspace> C-/ ' d SPC 
s t u f f C-x C-s C-l C-z o <f10> <f10> <f10> <switch-frame> 
<switch-frame> C-z o C-z o <switch-frame> <switch-frame> 
C-z o C-a C-v M-v M-v M-v C-v C-v M-< M-> M-< C-z o 
<f10> <f10> C-z o C-v C-u C-n C-n C-M-f C-a C-u C-u 
C-n C-u C-u C-n C-l M-< C-u C-n C-u C-p C-o C-o ( s 
t <backspace> e t q SPC s t a c k - t r ESC TAB SPC 
t ) C-x C-s <switch-frame> C-z o C-v M-v C-v C-v C-l 
C-u C-p C-p C-e C-u C-p C-p C-p C-d " L I M-/ M-/ M-/ 
" C-x C-s <switch-frame> <f10> C-c b <help-echo> <switch-frame> 
M-< M-x r e p o r t C-g M-f M-f C-h v <return> C-x 
1 C-h f b a c k <tab> t r <tab> <tab> <return> C-z 
o <f10> <f10> C-z o C-x 1 C-v C-v M-> C-f M-< M-x r 
e p o r t - e m <tab> b <tab> <M-backspace> <tab> b 
<tab> C-g C-v C-v M-x r e p o r t - e m <tab> b <tab> 
<return>

Recent messages:
Wrote /home/tromey/gnu/Emacs/git-emacs/emacs/src/x-defvar.el
Mark set
Quit
Type C-x 1 to delete the help window.
Making completion list... [2 times]
Type C-x 1 to delete the help window.
Mark set
call-interactively: End of buffer
Mark set
Making completion list...
Quit
Tom






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#4228: 23.1; --script and stack-trace-on-error
  2009-08-21 22:38 ` bug#4228: 23.1; --script and stack-trace-on-error Tom Tromey
@ 2009-08-21 23:05   ` Dan Nicolaescu
  2009-09-19  1:57     ` Tom Tromey
  2009-09-20 17:15   ` bug#4228: marked as done (23.1; --script and stack-trace-on-error) Emacs bug Tracking System
  1 sibling, 1 reply; 4+ messages in thread
From: Dan Nicolaescu @ 2009-08-21 23:05 UTC (permalink / raw)
  To: Tom Tromey; +Cc: 4228

Tom Tromey <tromey@redhat.com> writes:

  > I have a script that I run using emacs --script.  When writing the
  > script, I get errors on occasion.  It would be very useful if
  > stack-trace-on-error worked in this situation.  Currently it does not.

As a workaround you might be able to use `debug-on-error':

emacs --batch --eval '(setq debug-on-error t)' --eval '(this-function-does-not exist)'
Debugger entered--Lisp error: (void-function this-function-does-not)
  (this-function-does-not exist)
  eval((this-function-does-not exist))
  command-line-1(("--eval" "(setq debug-on-error t)" "--eval"
  "(this-function-does-not exist)"))
  command-line()
  normal-top-level()

[No idea why stack-trace-on-error does not work]





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#4228: 23.1; --script and stack-trace-on-error
  2009-08-21 23:05   ` Dan Nicolaescu
@ 2009-09-19  1:57     ` Tom Tromey
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2009-09-19  1:57 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: 4228

Dan> [No idea why stack-trace-on-error does not work]

I looked at this a little bit.

eval.c:find_handler_clause prints to a buffer named *Backtrace*.  So,
I'm guessing that the stack trace is created -- just not visible.

The appended patch works for me.

Tom

2009-09-19  Tom Tromey  <tromey@redhat.com>

	* eval.c (find_handler_clause): Respect 'noninteractive'.

diff --git a/src/eval.c b/src/eval.c
index 8299474..44f8ec7 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1922,14 +1922,19 @@ find_handler_clause (handlers, conditions, sig, data)
 	{
 	  max_lisp_eval_depth += 15;
 	  max_specpdl_size++;
+	  if (noninteractive)
+	    Fbacktrace ();
+	  else
+	    {
 #ifdef PROTOTYPES
-	  internal_with_output_to_temp_buffer ("*Backtrace*",
-					       (Lisp_Object (*) (Lisp_Object)) Fbacktrace,
-					       Qnil);
+	      internal_with_output_to_temp_buffer ("*Backtrace*",
+						   (Lisp_Object (*) (Lisp_Object)) Fbacktrace,
+						   Qnil);
 #else
-	  internal_with_output_to_temp_buffer ("*Backtrace*",
-					       Fbacktrace, Qnil);
+	      internal_with_output_to_temp_buffer ("*Backtrace*",
+						   Fbacktrace, Qnil);
 #endif
+	    }
 	  max_specpdl_size--;
 	  max_lisp_eval_depth -= 15;
 	}





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#4228: marked as done (23.1; --script and stack-trace-on-error)
  2009-08-21 22:38 ` bug#4228: 23.1; --script and stack-trace-on-error Tom Tromey
  2009-08-21 23:05   ` Dan Nicolaescu
@ 2009-09-20 17:15   ` Emacs bug Tracking System
  1 sibling, 0 replies; 4+ messages in thread
From: Emacs bug Tracking System @ 2009-09-20 17:15 UTC (permalink / raw)
  To: Stefan Monnier

[-- Attachment #1: Type: text/plain, Size: 893 bytes --]

Your message dated Sun, 20 Sep 2009 13:05:51 -0400
with message-id <jwvfxah1r9d.fsf-monnier+emacsbugreports@gnu.org>
and subject line Re: bug#4228: 23.1; --script and stack-trace-on-error
has caused the Emacs bug report #4228,
regarding 23.1; --script and stack-trace-on-error
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)


-- 
4228: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=4228
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 7144 bytes --]

From: Tom Tromey <tromey@redhat.com>
To: bug-gnu-emacs@gnu.org
Subject: 23.1; --script and stack-trace-on-error
Date: Fri, 21 Aug 2009 16:38:21 -0600
Message-ID: <m3eir423oi.fsf@fleche.redhat.com>


Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
and to the gnu.emacs.bug news group.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:


I have a script that I run using emacs --script.  When writing the
script, I get errors on occasion.  It would be very useful if
stack-trace-on-error worked in this situation.  Currently it does not.


If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
/usr/share/emacs/23.1/etc/DEBUG for instructions.


In GNU Emacs 23.1.1 (i386-redhat-linux-gnu, GTK+ Version 2.16.5)
 of 2009-08-03 on x86-5.fedora.phx.redhat.com
Windowing system distributor `The X.Org Foundation', version 11.0.10601901
configured using `configure  '--build=i386-redhat-linux-gnu' '--host=i386-redhat-linux-gnu' '--target=i586-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-dbus' '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xft' '--with-xpm' '--with-x-toolkit=gtk' 'build_alias=i386-redhat-linux-gnu' 'host_alias=i386-redhat-linux-gnu' 'target_alias=i586-redhat-linux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-bu
 ffer-size=4 -m32 -march=i586 -mtune=generic -fasynchronous-unwind-tables''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  erc-spelling-mode: t
  erc-truncate-mode: t
  diff-auto-refine-mode: t
  shell-dirtrack-mode: t
  highlight-changes-visible-mode: t
  flyspell-mode: t
  eldoc-mode: t
  erc-status-mode: t
  erc-services-mode: t
  erc-networks-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
h e r M-b M-l SPC l i s p SPC v a r s M-b M-b s t a 
t i c p r o ' d SPC C-e <return> ( d o l i s t SPC 
( v SPC s p e c M-/ ) <return> ( i n M-/ SPC ( c o 
n s SPC v SPC v ) ) ) C-f C-f C-o <tab> ; ; SPC n o 
n - g c - p r o f <backspace> ' d s <M-backspace> <M-backspace> 
<M-backspace> s t a t M-/ C-g i <backspace> p r o s 
' <backspace> <backspace> <M-backspace> C-/ ' d SPC 
s t u f f C-x C-s C-l C-z o <f10> <f10> <f10> <switch-frame> 
<switch-frame> C-z o C-z o <switch-frame> <switch-frame> 
C-z o C-a C-v M-v M-v M-v C-v C-v M-< M-> M-< C-z o 
<f10> <f10> C-z o C-v C-u C-n C-n C-M-f C-a C-u C-u 
C-n C-u C-u C-n C-l M-< C-u C-n C-u C-p C-o C-o ( s 
t <backspace> e t q SPC s t a c k - t r ESC TAB SPC 
t ) C-x C-s <switch-frame> C-z o C-v M-v C-v C-v C-l 
C-u C-p C-p C-e C-u C-p C-p C-p C-d " L I M-/ M-/ M-/ 
" C-x C-s <switch-frame> <f10> C-c b <help-echo> <switch-frame> 
M-< M-x r e p o r t C-g M-f M-f C-h v <return> C-x 
1 C-h f b a c k <tab> t r <tab> <tab> <return> C-z 
o <f10> <f10> C-z o C-x 1 C-v C-v M-> C-f M-< M-x r 
e p o r t - e m <tab> b <tab> <M-backspace> <tab> b 
<tab> C-g C-v C-v M-x r e p o r t - e m <tab> b <tab> 
<return>

Recent messages:
Wrote /home/tromey/gnu/Emacs/git-emacs/emacs/src/x-defvar.el
Mark set
Quit
Type C-x 1 to delete the help window.
Making completion list... [2 times]
Type C-x 1 to delete the help window.
Mark set
call-interactively: End of buffer
Mark set
Making completion list...
Quit
Tom



[-- Attachment #3: Type: message/rfc822, Size: 2169 bytes --]

From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Tom Tromey <tromey@redhat.com>
Cc: Dan Nicolaescu <dann@ics.uci.edu>
Subject: Re: bug#4228: 23.1; --script and stack-trace-on-error
Date: Sun, 20 Sep 2009 13:05:51 -0400
Message-ID: <jwvfxah1r9d.fsf-monnier+emacsbugreports@gnu.org>

Dan> [No idea why stack-trace-on-error does not work]
> I looked at this a little bit.

> eval.c:find_handler_clause prints to a buffer named *Backtrace*.  So,
> I'm guessing that the stack trace is created -- just not visible.

> The appended patch works for me.

Thanks, installed (and removed the non-prototype code since Emacs's
C code now requires prototypes anyway).


        Stefan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-09-20 17:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <jwvfxah1r9d.fsf-monnier+emacsbugreports@gnu.org>
2009-08-21 22:38 ` bug#4228: 23.1; --script and stack-trace-on-error Tom Tromey
2009-08-21 23:05   ` Dan Nicolaescu
2009-09-19  1:57     ` Tom Tromey
2009-09-20 17:15   ` bug#4228: marked as done (23.1; --script and stack-trace-on-error) Emacs bug Tracking System

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).