[IRCServices] services panic

Andrew Church achurch at achurch.org
Fri Mar 30 13:07:19 PDT 2007


>I've recompile my services with CFLAGS=-g and -dumpcore. Now i have 
>several cores. You can look to backtraces on the url:
>http://butcher.heavennet.ru/services/

     Thanks for the help--it looks like this is caused by erroneous code
that just happens to work properly on 32-bit x86 systems (my own
environment).  Try applying the following patch and let me know if it
solves the problem.

  --Andrew Church
    achurch at achurch.org
    http://achurch.org/

-----------------------------------------------------------------------

Index: misc.c
===================================================================
RCS file: /var/local/cvsroot/ircservices/misc.c,v
retrieving revision 2.37.2.4
diff -u -r2.37.2.4 misc.c
--- misc.c	23 Mar 2007 18:10:42 -0000	2.37.2.4
+++ misc.c	30 Mar 2007 04:07:10 -0000
@@ -616,11 +616,15 @@
     /* Now call the callback routine for each index. */
     numcount = 0;
     for (i = min; i <= max; i++) {
+	va_list args_copy;
 	int res;
+
 	if (!(numflag[i>>3] & (1 << (i&7))))
 	    continue;
 	numcount++;
-	res = callback(u, i, args);
+	va_copy(args_copy, args);
+	res = callback(u, i, args_copy);
+	va_end(args_copy);
 	if (debug)
 	    log("debug: process_numlist: tried to do %d; result = %d", i, res);
 	if (res < 0)