bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: msgfmt segfault on Solaris


From: Bruno Haible
Subject: Re: msgfmt segfault on Solaris
Date: Fri, 10 Jan 2003 20:26:30 +0100 (CET)

Chuck Berg writes:
> Attached is a file (po/zh_CN.po from the Gaim IM
> client) that causes msgfmt to segfault on my Solaris 8
> system.

I could reproduce it only with Solaris 9, not with Solaris 8 or
Solaris 7. It is a bug in Solaris iconv(). Please use the appended
fix. Thanks for reporting this.

Bruno


*** lib/linebreak.c     14 Nov 2002 15:00:43 -0000      1.12
--- lib/linebreak.c     10 Jan 2003 19:20:27 -0000
***************
*** 1502,1507 ****
--- 1502,1519 ----
        to_utf8 = (iconv_t)(-1);
        else
  # endif
+       /* Avoid Solaris 2.9 bug with GB2312, EUC-TW, BIG5, BIG5-HKSCS, GBK,
+          GB18030.  */
+ # if defined __sun && !defined _LIBICONV_VERSION
+       if (   STREQ (encoding, "GB2312", 'G', 'B', '2', '3', '1', '2', 0, 0, 0)
+           || STREQ (encoding, "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0)
+           || STREQ (encoding, "BIG5", 'B', 'I', 'G', '5', 0, 0, 0, 0, 0)
+           || STREQ (encoding, "BIG5-HKSCS", 'B', 'I', 'G', '5', '-', 'H', 
'K', 'S', 'C')
+           || STREQ (encoding, "GBK", 'G', 'B', 'K', 0, 0, 0, 0, 0, 0)
+           || STREQ (encoding, "GB18030", 'G', 'B', '1', '8', '0', '3', '0', 
0, 0))
+         to_utf8 = (iconv_t)(-1);
+       else
+ # endif
        to_utf8 = iconv_open (UTF8_NAME, encoding);
        if (to_utf8 != (iconv_t)(-1))
          {
***************
*** 1581,1586 ****
--- 1593,1610 ----
  # if (__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) && !defined 
_LIBICONV_VERSION
        if (STREQ (encoding, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0))
        to_utf8 = (iconv_t)(-1);
+       else
+ # endif
+       /* Avoid Solaris 2.9 bug with GB2312, EUC-TW, BIG5, BIG5-HKSCS, GBK,
+          GB18030.  */
+ # if defined __sun && !defined _LIBICONV_VERSION
+       if (   STREQ (encoding, "GB2312", 'G', 'B', '2', '3', '1', '2', 0, 0, 0)
+           || STREQ (encoding, "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0)
+           || STREQ (encoding, "BIG5", 'B', 'I', 'G', '5', 0, 0, 0, 0, 0)
+           || STREQ (encoding, "BIG5-HKSCS", 'B', 'I', 'G', '5', '-', 'H', 
'K', 'S', 'C')
+           || STREQ (encoding, "GBK", 'G', 'B', 'K', 0, 0, 0, 0, 0, 0)
+           || STREQ (encoding, "GB18030", 'G', 'B', '1', '8', '0', '3', '0', 
0, 0))
+         to_utf8 = (iconv_t)(-1);
        else
  # endif
        to_utf8 = iconv_open (UTF8_NAME, encoding);
*** src/po-charset.c    14 Nov 2002 15:00:45 -0000      1.15
--- src/po-charset.c    10 Jan 2003 19:20:27 -0000
***************
*** 260,265 ****
--- 260,277 ----
              /* Avoid glibc-2.1 bug with EUC-KR.  */
  # if (__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) && !defined 
_LIBICONV_VERSION
              if (strcmp (po_lex_charset, "EUC-KR") == 0)
+               po_lex_iconv = (iconv_t)(-1);
+             else
+ # endif
+             /* Avoid Solaris 2.9 bug with GB2312, EUC-TW, BIG5, BIG5-HKSCS,
+                GBK, GB18030.  */
+ # if defined __sun && !defined _LIBICONV_VERSION
+             if (   strcmp (po_lex_charset, "GB2312") == 0
+                 || strcmp (po_lex_charset, "EUC-TW") == 0
+                 || strcmp (po_lex_charset, "BIG5") == 0
+                 || strcmp (po_lex_charset, "BIG5-HKSCS") == 0
+                 || strcmp (po_lex_charset, "GBK") == 0
+                 || strcmp (po_lex_charset, "GB18030") == 0)
                po_lex_iconv = (iconv_t)(-1);
              else
  # endif
*** src/write-po.c      14 Nov 2002 15:00:45 -0000      1.30
--- src/write-po.c      10 Jan 2003 19:20:27 -0000
***************
*** 236,241 ****
--- 236,253 ----
        /* Avoid glibc-2.1 bug with EUC-KR.  */
  # if (__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) && !defined 
_LIBICONV_VERSION
        if (strcmp (canon_charset, "EUC-KR") == 0)
+       conv = (iconv_t)(-1);
+       else
+ # endif
+       /* Avoid Solaris 2.9 bug with GB2312, EUC-TW, BIG5, BIG5-HKSCS, GBK,
+        GB18030.  */
+ # if defined __sun && !defined _LIBICONV_VERSION
+       if (   strcmp (po_lex_charset, "GB2312") == 0
+         || strcmp (po_lex_charset, "EUC-TW") == 0
+         || strcmp (po_lex_charset, "BIG5") == 0
+         || strcmp (po_lex_charset, "BIG5-HKSCS") == 0
+         || strcmp (po_lex_charset, "GBK") == 0
+         || strcmp (po_lex_charset, "GB18030") == 0)
        conv = (iconv_t)(-1);
        else
  # endif




reply via email to

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