Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Core dump in C03traps.zsh



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@xxxxxxx>                  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
**********************************************************************



Messages sorted by: Reverse Date, Date, Thread, Author