bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Internal error in gawk-3.1.3 with character class


From: Stepan Kasal
Subject: Re: Internal error in gawk-3.1.3 with character class
Date: Mon, 8 Sep 2003 09:36:32 +0200
User-agent: Mutt/1.2.5.1i

Hello,

On Sun, Sep 07, 2003 at 11:11:51PM +0200, Michael Mauch wrote:
> LC_ALL=en_US gawk -v IGNORECASE=1 '
>   BEGIN { if("a" ~ /[[:alnum:]]/) print "Ok" }'

> Program received signal SIGSEGV, Segmentation fault.
> 0x0807504f in build_charclass (...

> With LC_ALL=C it's ok, but with any other locale it breaks.

the problem lies in the new regex code, which is copied to the gawk
source tree from GNU libc source.  The problem is known, unfortunately
it hasn't been included into glibc CVS yet.

Patch attached below; apply with
        cd gawk-3.1.3; patch <glibc-regex-re-translate-type.patch
(without the usual -p1).

Glibc people, could you please put this to the CVS?

Stepan Kasal


2003-07-23  Christophe Bisiere  <address@hidden>  (tiny change)

        * posix/regex.h (RE_TRANSLATE_TYPE): Define it to "unsigned char,"
          to avoid problems at hosts with signed char.
        * posix/regexec.c (re_search_internal): Don't say
          "unsigned RE_TRANSLATE_TYPE."

diff -urpN libc/posix/regex.h libc.sk/posix/regex.h
--- libc/posix/regex.h  Fri Jun 13 11:24:36 2003
+++ libc.sk/posix/regex.h       Wed Jul 23 14:53:02 2003
@@ -329,7 +329,7 @@ typedef enum
    private to the regex routines.  */
 
 #ifndef RE_TRANSLATE_TYPE
-# define RE_TRANSLATE_TYPE char *
+# define RE_TRANSLATE_TYPE unsigned char *
 #endif
 
 struct re_pattern_buffer
diff -urpN libc/posix/regexec.c libc.sk/posix/regexec.c
--- libc/posix/regexec.c        Wed Jun 18 15:06:35 2003
+++ libc.sk/posix/regexec.c     Wed Jul 23 14:53:02 2003
@@ -653,8 +653,8 @@ re_search_internal (preg, string, length
        {
          if (BE (fast_translate, 1))
            {
-             unsigned RE_TRANSLATE_TYPE t
-               = (unsigned RE_TRANSLATE_TYPE) preg->translate;
+             RE_TRANSLATE_TYPE t
+               = (RE_TRANSLATE_TYPE) preg->translate;
              if (BE (range >= 0, 1))
                {
                  if (BE (t != NULL, 0))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]