Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Nov 2009 15:07:12 +0100 (CET)
From:      Eric Masson <emss@free.fr>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/140899: XEmacs : Fatal error: assertion failed, file regex.c, line 6357, ABORT()
Message-ID:  <20091126140712.507C6170E4@srvbsdnanssv.interne.kisoft-services.com>
Resent-Message-ID: <200911261440.nAQEe26e045378@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         140899
>Category:       ports
>Synopsis:       XEmacs : Fatal error: assertion failed, file regex.c, line 6357, ABORT()
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 26 14:40:02 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Eric Masson
>Release:        FreeBSD 6.4-RELEASE-p7 i386
>Organization:
>Environment:
System: FreeBSD srvbsdnanssv.interne.kisoft-services.com 6.4-RELEASE-p7 FreeBSD 6.4-RELEASE-p7 #3: Sat Oct 3 20:51:17 CEST 2009 emss@srvbsdnanssv.interne.kisoft-services.com:/vol0/build/vol0/src/sys/KV8AMD64 i386


>Description:
Hello,

I'm using XEmacs as xemacs-devel-mule, from time to time I experience crashes related to regex.c while using gnus.
The problem has been reported to mainstream and a fix has been provided :
http://tracker.xemacs.org/XEmacs/its/issue630

An adapted diff is attached.

Regards

>How-To-Repeat:
See : http://tracker.xemacs.org/XEmacs/its/issue630
>Fix:
Add following diff to files subdirectory :
$ cat patch-regex.c-Issue630
--- src/regex.c	Sun Nov 15 20:52:09 2009 +0000
+++ src/regex.c	Mon Nov 16 19:44:33 2009 +0000
@@ -35,6 +35,7 @@
 /* We assume non-Mule if emacs isn't defined. */
 #ifndef emacs
 #undef MULE
+#define MAX_ICHAR_LEN 1
 #endif
 
 /* XEmacs addition */
@@ -3340,9 +3341,6 @@
 	normal_char:
 	  {
 	    /* XEmacs: modifications here for Mule. */
-	    /* `q' points to the beginning of the next char. */
-	    re_char *q = p;
-
 	    /* If no exactn currently being built.  */
 	    if (!pending_exact
 
@@ -3350,18 +3348,17 @@
 		|| pending_exact + *pending_exact + 1 != buf_end
 
 		/* We have only one byte following the exactn for the count. */
-		|| ((unsigned int) (*pending_exact + (q - p)) >=
-		    ((unsigned int) (1 << BYTEWIDTH) - 1))
+		|| *pending_exact >= (1 << BYTEWIDTH) - MAX_ICHAR_LEN
 
 		/* If followed by a repetition operator.  */
-		|| *q == '*' || *q == '^'
+                || (p != pend && (*p == '*' || *p == '^'))
 		|| ((syntax & RE_BK_PLUS_QM)
-		    ? *q == '\\' && (q[1] == '+' || q[1] == '?')
-		    : (*q == '+' || *q == '?'))
+		    ? p + 1 < pend && *p == '\\' && (p[1] == '+' || p[1] == '?')
+		    : p != pend && (*p == '+' || *p == '?'))
 		|| ((syntax & RE_INTERVALS)
 		    && ((syntax & RE_NO_BK_BRACES)
-			? *q == '{'
-			: (q[0] == '\\' && q[1] == '{'))))
+			? p != pend && *p == '{'
+			: p + 1 < pend && (p[0] == '\\' && p[1] == '{'))))
 	      {
 		/* Start building a new exactn.  */
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091126140712.507C6170E4>