zsh-workers
 help / color / mirror / code / Atom feed
* Core dump in C03traps.zsh
@ 2004-11-23 15:42 Vin Shelton
  2004-11-23 16:02 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Vin Shelton @ 2004-11-23 15:42 UTC (permalink / raw)
  To: zsh-workers

Building from latest CVS sources, there are core dumps in test C03 on
Solaris 5.5 and 5.8.  Here is verbose output from a 5.5 run:

cd Test ; make check
make[1]: Entering directory `/u/sheltonv/software/SunOS-5.5/build/zsh-2004-11-23/Test'
if test -n "cc"; then \
  cd .. && DESTDIR= \
  make MODDIR=`pwd`/Test/Modules install.modules > /dev/null; \
fi
mkdir /u/sheltonv/software/SunOS-5.5/build/zsh-2004-11-23/Test/Modules
mkdir /u/sheltonv/software/SunOS-5.5/build/zsh-2004-11-23/Test/Modules/zsh
mkdir /u/sheltonv/software/SunOS-5.5/build/zsh-2004-11-23/Test/Modules/zsh/net
for f in /u/sheltonv/software/SunOS-5.5/src/zsh-2004-11-23/Test/C03*.ztst; do \
  ZTST_exe=../Src/zsh \
    ../Src/zsh +Z -f /u/sheltonv/software/SunOS-5.5/src/zsh-2004-11-23/Test/ztst.zsh $f; \
done
/u/sheltonv/software/SunOS-5.5/src/zsh-2004-11-23/Test/C03traps.ztst: starting.
ZTST_getsect: read section name: prep
ZTST_getchunk: read code chunk:
  setopt localtraps
  mkdir traps.tmp && cd traps.tmp
ZTST_execchunk: status 0
ZTST_getchunk: read code chunk:

ZTST_getsect: read section name: test
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:
  fn1() {
ZTST_getchunk: read code chunk:
  fn1() {
    trap 'print EXIT1' EXIT
    fn2() { trap 'print EXIT2' EXIT; }
    fn2
  }
  fn1
ZTST_test: examining line:
>EXIT2
ZTST_getredir: read redir for '>':
EXIT2
EXIT1
ZTST_test: examining line:

Running test: Nested `trap ... EXIT'
ZTST_test: expecting status: 0
Input: /tmp/zsh.ztst.in.10721, output: /tmp/zsh.ztst.out.10721, error: /tmp/zsh.ztst.terr.10721
ZTST_execchunk: status 0
ZTST_test: test produced standard output:
EXIT2
EXIT1
ZTST_test: and standard error:

Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:
  fn1() {
ZTST_getchunk: read code chunk:
  fn1() {
    TRAPEXIT() { print EXIT1; }
    fn2() { TRAPEXIT() { print EXIT2; }; }
    fn2
  }
  fn1
ZTST_test: examining line:
>EXIT2
ZTST_getredir: read redir for '>':
EXIT2
EXIT1
ZTST_test: examining line:

Running test:  Nested TRAPEXIT
ZTST_test: expecting status: 0
Input: /tmp/zsh.ztst.in.10721, output: /tmp/zsh.ztst.out.10721, error: /tmp/zsh.ztst.terr.10721
Segmentation Fault - core dumped
make[1]: [check] Error 139 (ignored)
rm -rf Modules .zcompdump
make[1]: Leaving directory `/u/sheltonv/software/SunOS-5.5/build/zsh-2004-11-23/Test'

HTH,
  Vin

-- 
In a minute there is time
For decisions and revisions which a minute will reverse.         T.S. Eliot
[URL: http://www.cs.amherst.edu/~ccm/prufrock.html]


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

* Re: Core dump in C03traps.zsh
  2004-11-23 15:42 Core dump in C03traps.zsh Vin Shelton
@ 2004-11-23 16:02 ` Peter Stephenson
  2004-11-23 16:54   ` Vin Shelton
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 2004-11-23 16:02 UTC (permalink / raw)
  To: zsh-workers

Vin Shelton wrote:
> Building from latest CVS sources, there are core dumps in test C03 on
> Solaris 5.5 and 5.8.  Here is verbose output from a 5.5 run:

Thanks, I should have tested this.

Index: Src/signals.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/signals.c,v
retrieving revision 1.33
diff -u -r1.33 signals.c
--- Src/signals.c	22 Nov 2004 10:33:06 -0000	1.33
+++ Src/signals.c	23 Nov 2004 16:00:49 -0000
@@ -1010,7 +1010,19 @@
 	HashNode hn = gettrapnode(sig, 0);
 
 	args = znewlinklist();
-	name = ztrdup(hn->nam);
+	/*
+	 * In case of multiple names, try to get
+	 * a hint of the name in use from the function table.
+	 * In special cases, e.g. EXIT traps, the function
+	 * has already been removed.  Then it's OK to
+	 * use the standard name.
+	 */
+	if (hn) {
+	    name = ztrdup(hn->nam);
+	} else {
+	    name = (char *) zalloc(5 + strlen(sigs[sig]));
+	    sprintf(name, "TRAP%s", sigs[sig]);
+	}
 	zaddlinknode(args, name);
 	sprintf(num, "%d", sig);
 	zaddlinknode(args, num);

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


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

* Re: Core dump in C03traps.zsh
  2004-11-23 16:02 ` Peter Stephenson
@ 2004-11-23 16:54   ` Vin Shelton
  0 siblings, 0 replies; 3+ messages in thread
From: Vin Shelton @ 2004-11-23 16:54 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-workers

Peter Stephenson <pws@csr.com> writes:

> Vin Shelton wrote:
>> Building from latest CVS sources, there are core dumps in test C03 on
>> Solaris 5.5 and 5.8.  Here is verbose output from a 5.5 run:
>
> Thanks, I should have tested this.
>

Yes, that fixes the crash.

Thanks, Peter

  - vin

-- 
In a minute there is time
For decisions and revisions which a minute will reverse.         T.S. Eliot
[URL: http://www.cs.amherst.edu/~ccm/prufrock.html]


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

end of thread, other threads:[~2004-11-23 16:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-23 15:42 Core dump in C03traps.zsh Vin Shelton
2004-11-23 16:02 ` Peter Stephenson
2004-11-23 16:54   ` Vin Shelton

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

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).