Debian Bug report logs - #608181
/usr/bin/xgettext: xgettext segmentation fault

version graph

Package: gettext; Maintainer for gettext is Santiago Vila <sanvila@debian.org>; Source for gettext is src:gettext (PTS, buildd, popcon).

Reported by: "Jean-Luc Coulon \(f5ibh\)" <jean-luc.coulon@wanadoo.fr>

Date: Tue, 28 Dec 2010 12:03:01 UTC

Severity: normal

Found in version gettext/0.18.1.1-3

Fixed in version gettext/0.18.1.1-4

Done: Santiago Vila <sanvila@debian.org>

Bug is archived. No further changes may be made.

Forwarded to bug-gnu-gettext@gnu.org

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Santiago Vila <sanvila@debian.org>:
Bug#608181; Package gettext. (Tue, 28 Dec 2010 12:03:04 GMT) (full text, mbox, link).


Acknowledgement sent to "Jean-Luc Coulon \(f5ibh\)" <jean-luc.coulon@wanadoo.fr>:
New Bug report received and forwarded. Copy sent to Santiago Vila <sanvila@debian.org>. (Tue, 28 Dec 2010 12:03:04 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: "Jean-Luc Coulon \(f5ibh\)" <jean-luc.coulon@wanadoo.fr>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: /usr/bin/xgettext: xgettext segmentation fault
Date: Tue, 28 Dec 2010 12:59:55 +0100
Package: gettext
Version: 0.18.1.1-3
Severity: important
File: /usr/bin/xgettext

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

While trying to extract translatable strings (from WordPress), I get
a Segmentation fault.

I use the following command:

xgettext --width=80 --from-code=utf-8 \
        --keyword=__ --keyword=_e --keyword=esc_attr__ --keyword=esc_attr_e \
        --keyword=esc_html__ --keyword=esc_html_e \
        --keyword=_x:1,2c --keyword=esc_attr_x:1,2c
	--keyword=esc_html_x:1,2c \
        --keyword=_n:1,2 --keyword=_nx:1,2,4c \
        --keyword=_ex:1,2c \
        --keyword=_n_noop:1,2 --keyword=_nx_noop:1,2,3c \
	--default-domain=wp \
	--language=php \
	--files-from=fichiersphp.lst \
	--exclude-file=cities.pot \
	--exclude-file=ms.pot \
	--output=wp.pot

If I remove the option "--exclude-file=ms.pot" (this file is extracted a
similar way), I've not the Segmentation Fault.

If I run it from gdb, I get:
Program received signal SIGSEGV, Segmentation fault.
remember_a_message_plural (mp=0x0, string=0x84bca0 "%s users", context=..., 
    pos=0x84f570, comment=<value optimized out>) at xgettext.c:2438
    2438	  if (mp->msgid_plural == NULL)
    (gdb) bt
    #0  remember_a_message_plural (mp=0x0, string=0x84bca0 "%s users", 
        context=..., pos=0x84f570, comment=<value optimized out>)
        at xgettext.c:2438
    #1  0x0000000000408aaf in arglist_parser_done (ap=0x84f4d0, 
        argnum=<value optimized out>) at xgettext.c:2937
    #2  0x0000000000421e71 in extract_balanced (mlp=<value optimized out>, 
        delim=<value optimized out>, outer_context=..., context_iter=..., 
        argparser=<value optimized out>) at x-php.c:1513
    #3  0x0000000000421f1c in extract_balanced (mlp=<value optimized out>, 
        delim=<value optimized out>, outer_context=..., context_iter=..., 
        argparser=<value optimized out>) at x-php.c:1466
    #4  0x0000000000421f1c in extract_balanced (mlp=<value optimized out>, 
        delim=<value optimized out>, outer_context=..., context_iter=..., 
        argparser=<value optimized out>) at x-php.c:1466
    #5  0x00000000004221ea in extract_php (f=<value optimized out>, 
        real_filename=<value optimized out>, 
	logical_filename=<value	optimized out>, flag_table=0x636580, 
        mdlp=<value optimized out>) at x-php.c:1586
    #6  0x000000000040741f in extract_from_file (
        file_name=0x701f60 "../../wp-admin/ms-admin.php", extractor=..., 
        mdlp=<value optimized out>) at xgettext.c:1957
    #7  0x0000000000407ed6 in main (argc=<value optimized out>, 
        argv=<value optimized out>) at xgettext.c:779
(gdb) 


Regards

Jean-Luc


- -- System Information:
Debian Release: 6.0
  APT prefers unstable
  APT policy: (900, 'unstable'), (700, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.37-rc7-k8-1 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages gettext depends on:
ii  dpkg                      1.15.8.7       Debian package management system
ii  gettext-base              0.18.1.1-3     GNU Internationalization utilities
ii  install-info              4.13a.dfsg.1-6 Manage installed documentation in 
ii  libc6                     2.11.2-7       Embedded GNU C Library: Shared lib
ii  libcroco3                 0.6.2-1        a generic Cascading Style Sheet (C
ii  libglib2.0-0              2.27.5-1       The GLib library of C routines
ii  libgomp1                  4.4.5-10       GCC OpenMP (GOMP) support library
ii  libncurses5               5.7+20100313-4 shared libraries for terminal hand
ii  libunistring0             0.9.3-3        Unicode string library for C
ii  libxml2                   2.7.8.dfsg-2   GNOME XML library

Versions of packages gettext recommends:
ii  autopoint                     0.18.1.1-3 The autopoint program from GNU get
ii  curl                          7.21.2-4   Get a file from an HTTP, HTTPS or 
ii  wget                          1.12-2.1   retrieves files from the web

Versions of packages gettext suggests:
pn  gettext-doc                   <none>     (no description available)

- -- no debconf information

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iD8DBQFNGdE7UdGGXzzGnNARAlY1AKCJU+/NvfVcMetNKpLegB2p+Bp6fACgnRjj
ZZetYEo4utaqhdei91P0V5U=
=W+rO
-----END PGP SIGNATURE-----




Information forwarded to debian-bugs-dist@lists.debian.org, Santiago Vila <sanvila@debian.org>:
Bug#608181; Package gettext. (Tue, 03 May 2011 12:15:03 GMT) (full text, mbox, link).


Acknowledgement sent to Santiago Vila <sanvila@unex.es>:
Extra info received and forwarded to list. Copy sent to Santiago Vila <sanvila@debian.org>. (Tue, 03 May 2011 12:15:23 GMT) (full text, mbox, link).


Message #10 received at 608181@bugs.debian.org (full text, mbox, reply):

From: Santiago Vila <sanvila@unex.es>
To: "Jean-Luc Coulon (f5ibh)" <jean-luc.coulon@wanadoo.fr>
Cc: 608181@bugs.debian.org
Subject: Re: /usr/bin/xgettext: xgettext segmentation fault
Date: Tue, 3 May 2011 14:04:11 +0200 (CEST)
On Tue, 28 Dec 2010, Jean-Luc Coulon (f5ibh) wrote:

> Package: gettext
> Version: 0.18.1.1-3
> Severity: important
> File: /usr/bin/xgettext
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi,
> 
> While trying to extract translatable strings (from WordPress), I get
> a Segmentation fault.
> 
> I use the following command:
> 
> xgettext --width=80 --from-code=utf-8 \
>         --keyword=__ --keyword=_e --keyword=esc_attr__ --keyword=esc_attr_e \
>         --keyword=esc_html__ --keyword=esc_html_e \
>         --keyword=_x:1,2c --keyword=esc_attr_x:1,2c
> 	--keyword=esc_html_x:1,2c \
>         --keyword=_n:1,2 --keyword=_nx:1,2,4c \
>         --keyword=_ex:1,2c \
>         --keyword=_n_noop:1,2 --keyword=_nx_noop:1,2,3c \
> 	--default-domain=wp \
> 	--language=php \
> 	--files-from=fichiersphp.lst \
> 	--exclude-file=cities.pot \
> 	--exclude-file=ms.pot \
> 	--output=wp.pot

I should forward this upstream, but before doing so, we should find a
minimal test case showing the error.

As I don't have the contents of fichiersphp.lst, this is imposible for me.

Could you please provide a minimal test case which is complete, so
that I can forward this upstream?

Thanks.




Information forwarded to debian-bugs-dist@lists.debian.org, Santiago Vila <sanvila@debian.org>:
Bug#608181; Package gettext. (Tue, 03 May 2011 12:51:07 GMT) (full text, mbox, link).


Acknowledgement sent to Jean-Luc Coulon <jean-luc.coulon@wanadoo.fr>:
Extra info received and forwarded to list. Copy sent to Santiago Vila <sanvila@debian.org>. (Tue, 03 May 2011 12:51:08 GMT) (full text, mbox, link).


Message #15 received at 608181@bugs.debian.org (full text, mbox, reply):

From: Jean-Luc Coulon <jean-luc.coulon@wanadoo.fr>
Cc: 608181@bugs.debian.org
Subject: Re: /usr/bin/xgettext: xgettext segmentation fault
Date: Tue, 03 May 2011 14:49:36 +0200
[Message part 1 (text/plain, inline)]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Le 03/05/2011 14:04, Santiago Vila a écrit :
> On Tue, 28 Dec 2010, Jean-Luc Coulon (f5ibh) wrote:

[... ]


> I should forward this upstream, but before doing so, we should find a
> minimal test case showing the error.
> 
> As I don't have the contents of fichiersphp.lst, this is imposible for me.
> 
> Could you please provide a minimal test case which is complete, so
> that I can forward this upstream?
> 
> Thanks.

Please find it attached.
It is the list of *.php files from a wordpress tree.

Regards

Jean-Luc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFNv/ngUdGGXzzGnNARAhKZAJwPPJTQ0yF+T8zJ8F8kwVHMiuuhgACcCqFN
DXTNtJa1IqBrR5VngG7aZi0=
=a7O8
-----END PGP SIGNATURE-----
[fichiersphp.lst (text/plain, attachment)]
[fichiersphp.lst.sig (application/octet-stream, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Santiago Vila <sanvila@debian.org>:
Bug#608181; Package gettext. (Thu, 28 Jul 2011 11:30:38 GMT) (full text, mbox, link).


Acknowledgement sent to Santiago Vila <sanvila@unex.es>:
Extra info received and forwarded to list. Copy sent to Santiago Vila <sanvila@debian.org>. (Thu, 28 Jul 2011 11:30:45 GMT) (full text, mbox, link).


Message #20 received at 608181@bugs.debian.org (full text, mbox, reply):

From: Santiago Vila <sanvila@unex.es>
To: Jean-Luc Coulon <jean-luc.coulon@wanadoo.fr>, 608181@bugs.debian.org
Subject: Re: Bug#608181: /usr/bin/xgettext: xgettext segmentation fault
Date: Thu, 28 Jul 2011 13:29:49 +0200 (CEST)
> > As I don't have the contents of fichiersphp.lst, this is imposible for me.
> > 
> > Could you please provide a minimal test case which is complete, so
> > that I can forward this upstream?
> > 
> > Thanks.
> 
> Please find it attached.
> It is the list of *.php files from a wordpress tree.

Sorry. I'm still unable to reproduce it.

Please provide a *minimal* test case, which is "complete*.

By "complete" I mean that every time the command line references a
file, you should send me the file as well.

You don't need to send me all the .php files. If you tell me that they
are taken *verbatim* from some known wordpress version (preferably,
the latest that you can find), that's ok.

By "minimal" I mean that you should try to trim both the command line
and the number of files as much as you can and see if you can
reproduce it with a shorter command line or less files.

Thanks.




Severity set to 'normal' from 'important' Request was from Santiago Vila <sanvila@unex.es> to control@bugs.debian.org. (Thu, 28 Jul 2011 11:33:03 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Santiago Vila <sanvila@debian.org>:
Bug#608181; Package gettext. (Thu, 28 Jul 2011 18:51:03 GMT) (full text, mbox, link).


Acknowledgement sent to "Jean-Luc Coulon (f5ibh)" <jean-luc.coulon@wanadoo.fr>:
Extra info received and forwarded to list. Copy sent to Santiago Vila <sanvila@debian.org>. (Thu, 28 Jul 2011 18:51:03 GMT) (full text, mbox, link).


Message #27 received at 608181@bugs.debian.org (full text, mbox, reply):

From: "Jean-Luc Coulon (f5ibh)" <jean-luc.coulon@wanadoo.fr>
To: 608181@bugs.debian.org
Subject: Re: Bug#608181: /usr/bin/xgettext: xgettext segmentation fault
Date: Thu, 28 Jul 2011 20:39:44 +0200
[Message part 1 (text/plain, inline)]
Hi,

OK

What I've done:
I got wordpress tree version 3.2.

I've, in the ./wp-content/langages 3 shell scripts
- one for cities names: extraccities.sh
- one for multisites related stuff: extractms.sh
- one for other files: extractpo.sh

Running in this order the 3 scripts, I get 
- cities.pot
- ms.pot
- wp.pot

For extractpo.sh, I get the files names from fichiersphp.lst
I sue the following command to build this file:
find ../../ -name '*php' > fichiersphp.lst
I excludes previously extracted files with --exclude statement

I've removed all (well most) of the php and part of the tree not needed 
to trigger the segfault.

Attached a tarball of the resulting tree.

Regards

Jean-Luc

Le 28/07/2011 13:29:49, Santiago Vila a écrit :
>> > As I don't have the contents of fichiersphp.lst, this is imposible
>for me.
>> > 
>> > Could you please provide a minimal test case which is complete, so
>> > that I can forward this upstream?
>> > 
>> > Thanks.
>> 
>> Please find it attached.
>> It is the list of *.php files from a wordpress tree.
>
>Sorry. I'm still unable to reproduce it.
>
>Please provide a *minimal* test case, which is "complete*.
>
>By "complete" I mean that every time the command line references a
>file, you should send me the file as well.
>
>You don't need to send me all the .php files. If you tell me that they
>are taken *verbatim* from some known wordpress version (preferably,
>the latest that you can find), that's ok.
>
>By "minimal" I mean that you should try to trim both the command line
>and the number of files as much as you can and see if you can
>reproduce it with a shorter command line or less files.
>
>Thanks.
>
>


[wp-mini-gettext-pb.tar.bz2 (application/x-bzip-compressed-tar, attachment)]
[Message part 3 (application/pgp-signature, inline)]

Reply sent to Santiago Vila <sanvila@unex.es>:
You have marked Bug as forwarded. (Fri, 29 Jul 2011 09:00:14 GMT) (full text, mbox, link).


Message #30 received at 608181-forwarded@bugs.debian.org (full text, mbox, reply):

From: Santiago Vila <sanvila@unex.es>
To: bug-gnu-gettext@gnu.org
Cc: 608181-forwarded@bugs.debian.org, jean-luc.coulon@wanadoo.fr
Subject: Bug#608181: /usr/bin/xgettext: xgettext segmentation fault (fwd)
Date: Fri, 29 Jul 2011 10:58:21 +0200 (CEST)
Hello.

I received this report from the Debian bug system.

I asked the submitter for a way to reproduce it and he sent me a
tarball including all the required files, so I have made this short
recipe to reproduce the segfault:

wget http://people.debian.org/~sanvila/bug-608181/wp-mini-gettext-pb.tar.bz2
tar xjvf wp-mini-gettext-pb.tar.bz2 
cd wp/wp-content/languages
./extractpo.sh

Thanks.

---------- Forwarded message ----------
From: "Jean-Luc Coulon (f5ibh)" <jean-luc.coulon@wanadoo.fr>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Date: Tue, 28 Dec 2010 12:59:55 +0100
Subject: Bug#608181: /usr/bin/xgettext: xgettext segmentation fault

Package: gettext
Version: 0.18.1.1-3
Severity: important
File: /usr/bin/xgettext

Hi,

While trying to extract translatable strings (from WordPress), I get
a Segmentation fault.

I use the following command:

xgettext --width=80 --from-code=utf-8 \
        --keyword=__ --keyword=_e --keyword=esc_attr__ --keyword=esc_attr_e \
        --keyword=esc_html__ --keyword=esc_html_e \
        --keyword=_x:1,2c --keyword=esc_attr_x:1,2c
	--keyword=esc_html_x:1,2c \
        --keyword=_n:1,2 --keyword=_nx:1,2,4c \
        --keyword=_ex:1,2c \
        --keyword=_n_noop:1,2 --keyword=_nx_noop:1,2,3c \
	--default-domain=wp \
	--language=php \
	--files-from=fichiersphp.lst \
	--exclude-file=cities.pot \
	--exclude-file=ms.pot \
	--output=wp.pot

If I remove the option "--exclude-file=ms.pot" (this file is extracted a
similar way), I've not the Segmentation Fault.

If I run it from gdb, I get:
Program received signal SIGSEGV, Segmentation fault.
remember_a_message_plural (mp=0x0, string=0x84bca0 "%s users", context=..., 
    pos=0x84f570, comment=<value optimized out>) at xgettext.c:2438
    2438	  if (mp->msgid_plural == NULL)
    (gdb) bt
    #0  remember_a_message_plural (mp=0x0, string=0x84bca0 "%s users", 
        context=..., pos=0x84f570, comment=<value optimized out>)
        at xgettext.c:2438
    #1  0x0000000000408aaf in arglist_parser_done (ap=0x84f4d0, 
        argnum=<value optimized out>) at xgettext.c:2937
    #2  0x0000000000421e71 in extract_balanced (mlp=<value optimized out>, 
        delim=<value optimized out>, outer_context=..., context_iter=..., 
        argparser=<value optimized out>) at x-php.c:1513
    #3  0x0000000000421f1c in extract_balanced (mlp=<value optimized out>, 
        delim=<value optimized out>, outer_context=..., context_iter=..., 
        argparser=<value optimized out>) at x-php.c:1466
    #4  0x0000000000421f1c in extract_balanced (mlp=<value optimized out>, 
        delim=<value optimized out>, outer_context=..., context_iter=..., 
        argparser=<value optimized out>) at x-php.c:1466
    #5  0x00000000004221ea in extract_php (f=<value optimized out>, 
        real_filename=<value optimized out>, 
	logical_filename=<value	optimized out>, flag_table=0x636580, 
        mdlp=<value optimized out>) at x-php.c:1586
    #6  0x000000000040741f in extract_from_file (
        file_name=0x701f60 "../../wp-admin/ms-admin.php", extractor=..., 
        mdlp=<value optimized out>) at xgettext.c:1957
    #7  0x0000000000407ed6 in main (argc=<value optimized out>, 
        argv=<value optimized out>) at xgettext.c:779
(gdb) 


Regards

Jean-Luc




Message #31 received at 608181-forwarded@bugs.debian.org (full text, mbox, reply):

From: Bruno Haible <bruno@clisp.org>
To: Santiago Vila <sanvila@unex.es>
Cc: bug-gnu-gettext@gnu.org, 608181-forwarded@bugs.debian.org, jean-luc.coulon@wanadoo.fr
Subject: Re: Bug#608181: /usr/bin/xgettext: xgettext segmentation fault (fwd)
Date: Sat, 30 Jul 2011 04:18:04 +0200
Hello Jean-Luc,

> While trying to extract translatable strings (from WordPress), I get
> a Segmentation fault.
> 
> I use the following command:
> 
> xgettext --width=80 --from-code=utf-8 \
>         --keyword=__ --keyword=_e --keyword=esc_attr__ --keyword=esc_attr_e \
>         --keyword=esc_html__ --keyword=esc_html_e \
>         --keyword=_x:1,2c --keyword=esc_attr_x:1,2c
> 	--keyword=esc_html_x:1,2c \
>         --keyword=_n:1,2 --keyword=_nx:1,2,4c \
>         --keyword=_ex:1,2c \
>         --keyword=_n_noop:1,2 --keyword=_nx_noop:1,2,3c \
> 	--default-domain=wp \
> 	--language=php \
> 	--files-from=fichiersphp.lst \
> 	--exclude-file=cities.pot \
> 	--exclude-file=ms.pot \
> 	--output=wp.pot
> 
> If I remove the option "--exclude-file=ms.pot" (this file is extracted a
> similar way), I've not the Segmentation Fault.

Thanks for the report. I can reproduce it with the wp-mini-gettext-pb.tar.bz2
tarball that you provided. Here is a fix, which I'm applying for the next
release.


2011-07-29  Bruno Haible  <bruno@clisp.org>

	Fix xgettext crash when extracting a message with plural that is
	excluded.
	* xgettext.h (remember_a_message): Document the return value.
	* xgettext.c (arglist_parser_done): Handle the case where
	remember_a_message returned NULL.
	* x-smalltalk.c (extract_smalltalk): Likewise.
	* x-ycp.c (extract_parenthesized): Likewise.
	Reported by Jean-Luc Coulon <jean-luc.coulon@wanadoo.fr> via
	Santiago Vila <sanvila@unex.es>.

--- gettext-tools/src/x-smalltalk.c.orig	Sat Jul 30 04:07:04 2011
+++ gettext-tools/src/x-smalltalk.c	Sat Jul 30 04:00:34 2011
@@ -1,5 +1,5 @@
 /* xgettext Smalltalk backend.
-   Copyright (C) 2002-2003, 2005-2009 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003, 2005-2009, 2011 Free Software Foundation, Inc.
 
    This file was written by Bruno Haible <haible@clisp.cons.org>, 2002.
 
@@ -562,9 +562,10 @@
                 lex_pos_ty pos;
                 pos.file_name = logical_file_name;
                 pos.line_number = token.line_number;
-                remember_a_message_plural (plural_mp, token.string,
-                                           null_context, &pos,
-                                           savable_comment);
+                if (plural_mp != NULL)
+                  remember_a_message_plural (plural_mp, token.string,
+                                             null_context, &pos,
+                                             savable_comment);
                 state = 0;
                 break;
               }
--- gettext-tools/src/x-ycp.c.orig	Sat Jul 30 04:07:04 2011
+++ gettext-tools/src/x-ycp.c	Sat Jul 30 04:05:09 2011
@@ -1,5 +1,5 @@
 /* xgettext YCP backend.
-   Copyright (C) 2001-2003, 2005-2009 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2005-2009, 2011 Free Software Foundation, Inc.
 
    This file was written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
@@ -640,6 +640,7 @@
                        bool in_i18n)
 {
   int state; /* 1 or 2 inside _( ... ), otherwise 0 */
+  int plural_state = 0; /* defined only when in states 1 and 2 */
   message_ty *plural_mp = NULL; /* defined only when in states 1 and 2 */
   /* Context iterator that will be used if the next token is a '('.  */
   flag_context_list_iterator_ty next_context_iter =
@@ -678,20 +679,22 @@
               pos.file_name = logical_file_name;
               pos.line_number = token.line_number;
 
-              if (plural_mp == NULL)
+              if (plural_state == 0)
                 {
                   /* Seen an msgid.  */
                   plural_mp = remember_a_message (mlp, NULL, token.string,
                                                   inner_context, &pos,
                                                   NULL, token.comment);
+                  plural_state = 1;
                   state = 2;
                 }
               else
                 {
                   /* Seen an msgid_plural.  */
-                  remember_a_message_plural (plural_mp, token.string,
-                                             inner_context, &pos,
-                                             token.comment);
+                  if (plural_mp != NULL)
+                    remember_a_message_plural (plural_mp, token.string,
+                                               inner_context, &pos,
+                                               token.comment);
                   state = 0;
                 }
               drop_reference (token.comment);
--- gettext-tools/src/xgettext.c.orig	Sat Jul 30 04:07:04 2011
+++ gettext-tools/src/xgettext.c	Sat Jul 30 03:57:55 2011
@@ -1,5 +1,5 @@
 /* Extracts strings from C source file to Uniforum style .po file.
-   Copyright (C) 1995-1998, 2000-2010 Free Software Foundation, Inc.
+   Copyright (C) 1995-1998, 2000-2011 Free Software Foundation, Inc.
    Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, April 1995.
 
    This program is free software: you can redistribute it and/or modify
@@ -2934,7 +2934,7 @@
                                      msgid_context,
                                      &best_cp->msgid_pos,
                                      NULL, best_cp->msgid_comment);
-            if (best_cp->msgid_plural != NULL)
+            if (mp != NULL && best_cp->msgid_plural != NULL)
               remember_a_message_plural (mp, best_cp->msgid_plural,
                                          msgid_plural_context,
                                          &best_cp->msgid_plural_pos,
--- gettext-tools/src/xgettext.h.orig	Sat Jul 30 04:07:04 2011
+++ gettext-tools/src/xgettext.h	Sat Jul 30 03:56:05 2011
@@ -1,5 +1,5 @@
 /* xgettext common functions.
-   Copyright (C) 2001-2003, 2005-2006, 2008-2009 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2005-2006, 2008-2009, 2011 Free Software Foundation, Inc.
    Written by Peter Miller <millerp@canb.auug.org.au>
    and Bruno Haible <haible@clisp.cons.org>, 2001.
 
@@ -247,7 +247,8 @@
    or NULL.
    COMMENT may be savable_comment, or it may be a saved copy of savable_comment
    (then add_reference must be used when saving it, and drop_reference while
-   dropping it).  Clear savable_comment.  */
+   dropping it).  Clear savable_comment.
+   Return the new or found message, or NULL if the message is excluded.  */
 extern message_ty *remember_a_message (message_list_ty *mlp,
                                        char *msgctxt,
                                        char *msgid,

-- 
In memoriam Pavel Dybenko <http://en.wikipedia.org/wiki/Pavel_Dybenko>




Message #32 received at 608181-forwarded@bugs.debian.org (full text, mbox, reply):

From: "Jean-Luc Coulon (f5ibh)" <jean-luc.coulon@wanadoo.fr>
To: Bruno Haible <bruno@clisp.org>
Cc: 608181-forwarded@bugs.debian.org
Subject: Re: Bug#608181: /usr/bin/xgettext: xgettext segmentation fault (fwd)
Date: Sat, 30 Jul 2011 14:37:02 +0200
[Message part 1 (text/plain, inline)]
Hello Bruno,


>Thanks for the report. I can reproduce it with the
>wp-mini-gettext-pb.tar.bz2
>tarball that you provided. Here is a fix, which I'm applying for the
>next
>release.

I've applied the patch et rebuilt the package but I still have the 
problem...

Regards

Jean-Luc
[Message part 2 (application/pgp-signature, inline)]

Message #33 received at 608181-forwarded@bugs.debian.org (full text, mbox, reply):

From: Bruno Haible <bruno@clisp.org>
To: "Jean-Luc Coulon (f5ibh)" <jean-luc.coulon@wanadoo.fr>
Cc: 608181-forwarded@bugs.debian.org
Subject: Re: Bug#608181: /usr/bin/xgettext: xgettext segmentation fault (fwd)
Date: Sat, 30 Jul 2011 17:02:25 +0200
Hello Jean-Luc,

> >Thanks for the report. I can reproduce it with the
> >wp-mini-gettext-pb.tar.bz2
> >tarball that you provided. Here is a fix, which I'm applying for the
> >next
> >release.
> 
> I've applied the patch et rebuilt the package but I still have the 
> problem...

With the same stack trace? If yes, then I would verify that you are really
using the new, modified xgettext program. If not, i.e. if it crashes in a
different way, please open a new ticket, again with a reproducible test case.

Bruno
-- 
In memoriam Ebrahim Berookhim <http://www.jewishjournal.com/iranianamericanjews/item/conversations_about_berookhims_execution_30_years_ago_in_iran/>




Message #34 received at 608181-forwarded@bugs.debian.org (full text, mbox, reply):

From: "Jean-Luc Coulon (f5ibh)" <jean-luc.coulon@wanadoo.fr>
To: Bruno Haible <bruno@clisp.org>
Cc: 608181-forwarded@bugs.debian.org
Subject: Re: Bug#608181: /usr/bin/xgettext: xgettext segmentation fault (fwd)
Date: Sat, 30 Jul 2011 18:08:15 +0200
[Message part 1 (text/plain, inline)]
Hello Bruno,

>With the same stack trace? If yes, then I would verify that you are
>really
>using the new, modified xgettext program. If not, i.e. if it crashes 
> in a different way, please open a new ticket, again with a  
> reproducible test case.

Ermmm... not sure.
I can reproduce it with the same case as before.

Attached the gdb session.

Regards

J-L

[xgettext-SIGSEGV.bt (text/plain, attachment)]
[Message part 3 (application/pgp-signature, inline)]

Message #35 received at 608181-forwarded@bugs.debian.org (full text, mbox, reply):

From: Bruno Haible <bruno@clisp.org>
To: "Jean-Luc Coulon (f5ibh)" <jean-luc.coulon@wanadoo.fr>
Cc: 608181-forwarded@bugs.debian.org
Subject: Re: Bug#608181: /usr/bin/xgettext: xgettext segmentation fault (fwd)
Date: Sun, 31 Jul 2011 00:08:20 +0200
> I can reproduce it with the same case as before.
> 
> Attached the gdb session.

Did you notice the gdb message
  "warning: Source file is more recent than executable."?
It indicates that the executable that is being run was *not* created
by the modified sources (otherwise its timestamp would be newer).

Bruno
-- 
In memoriam Ebrahim Berookhim <http://www.jewishjournal.com/iranianamericanjews/item/conversations_about_berookhims_execution_30_years_ago_in_iran/>




Message #36 received at 608181-forwarded@bugs.debian.org (full text, mbox, reply):

From: "Jean-Luc Coulon (f5ibh)" <jean-luc.coulon@wanadoo.fr>
To: Bruno Haible <bruno@clisp.org>
Cc: 608181-forwarded@bugs.debian.org
Subject: Re: Bug#608181: /usr/bin/xgettext: xgettext segmentation fault (fwd)
Date: Sun, 31 Jul 2011 08:40:17 +0200
[Message part 1 (text/plain, inline)]
Hello Bruno,


Le 31/07/2011 00:08:20, Bruno Haible a écrit :
>> I can reproduce it with the same case as before.
>> 
>> Attached the gdb session.
>
>Did you notice the gdb message
>  "warning: Source file is more recent than executable."?
>It indicates that the executable that is being run was *not* created
>by the modified sources (otherwise its timestamp would be newer).
>

Yesyes, I notices that.
I is a consequence the way I've got an unstripped version of xgettext:

1st, I grabbed the debian source (apt-get source gettext)
2dn I applied your patch to the tree
3rd I build it (debuid) and installed it (debi)

As the default behaviour is to build binaries unstripped, I moved the 
unstripped version from the tree to /usr/bin.

So the timestamp was not consistant with the whole package.

Regards
J-L
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Santiago Vila <sanvila@debian.org>:
Bug#608181; Package gettext. (Fri, 05 Aug 2011 14:36:03 GMT) (full text, mbox, link).


Acknowledgement sent to Santiago Vila <sanvila@unex.es>:
Extra info received and forwarded to list. Copy sent to Santiago Vila <sanvila@debian.org>. (Fri, 05 Aug 2011 14:36:03 GMT) (full text, mbox, link).


Message #41 received at 608181@bugs.debian.org (full text, mbox, reply):

From: Santiago Vila <sanvila@unex.es>
To: "Jean-Luc Coulon (f5ibh)" <jean-luc.coulon@wanadoo.fr>
Cc: Bruno Haible <bruno@clisp.org>, 608181@bugs.debian.org
Subject: Re: Bug#608181: /usr/bin/xgettext: xgettext segmentation fault (fwd)
Date: Fri, 5 Aug 2011 16:32:23 +0200 (CEST)
B1;2801;0cOn Sun, 31 Jul 2011, Jean-Luc Coulon (f5ibh) wrote:

> I is a consequence the way I've got an unstripped version of xgettext:
> 
> 1st, I grabbed the debian source (apt-get source gettext)
> 2dn I applied your patch to the tree
> 3rd I build it (debuid) and installed it (debi)
> 
> As the default behaviour is to build binaries unstripped, I moved the 
> unstripped version from the tree to /usr/bin.

Ok, some comments:

*) Sorry, I forgot: Please reply to the 608181@bugs.debian.org
address, so that I can receive all the emails automatically. [ Not a
big problem because I can retrieve past messages from the web page ].

*) You don't need to move binaries around, you can also do this

export DEB_BUILD_OPTIONS=noopt,nostrip
dpkg-buildpackage

and you get .deb pacakges with unstripped binaries and without
optimization that you can install with dpkg -i. This is not just for
gettext, every Debian package should support DEB_BUILD_OPTIONS
according to policy.

*) I can't reproduce the segfault anymore after applying the patch by
Bruno (thanks a lot, Bruno!) which is why I have uploaded a new
version and closed the bug. If you can still reproduce it, just report
another bug as Bruno says.

Thanks.




Reply sent to Santiago Vila <sanvila@debian.org>:
You have taken responsibility. (Fri, 05 Aug 2011 14:51:09 GMT) (full text, mbox, link).


Notification sent to "Jean-Luc Coulon \(f5ibh\)" <jean-luc.coulon@wanadoo.fr>:
Bug acknowledged by developer. (Fri, 05 Aug 2011 14:51:09 GMT) (full text, mbox, link).


Message #46 received at 608181-close@bugs.debian.org (full text, mbox, reply):

From: Santiago Vila <sanvila@debian.org>
To: 608181-close@bugs.debian.org
Subject: Bug#608181: fixed in gettext 0.18.1.1-4
Date: Fri, 05 Aug 2011 14:48:06 +0000
Source: gettext
Source-Version: 0.18.1.1-4

We believe that the bug you reported is fixed in the latest version of
gettext, which is due to be installed in the Debian FTP archive:

autopoint_0.18.1.1-4_all.deb
  to main/g/gettext/autopoint_0.18.1.1-4_all.deb
gettext-base_0.18.1.1-4_amd64.deb
  to main/g/gettext/gettext-base_0.18.1.1-4_amd64.deb
gettext-doc_0.18.1.1-4_all.deb
  to main/g/gettext/gettext-doc_0.18.1.1-4_all.deb
gettext-el_0.18.1.1-4_all.deb
  to main/g/gettext/gettext-el_0.18.1.1-4_all.deb
gettext_0.18.1.1-4.debian.tar.gz
  to main/g/gettext/gettext_0.18.1.1-4.debian.tar.gz
gettext_0.18.1.1-4.dsc
  to main/g/gettext/gettext_0.18.1.1-4.dsc
gettext_0.18.1.1-4_amd64.deb
  to main/g/gettext/gettext_0.18.1.1-4_amd64.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 608181@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Santiago Vila <sanvila@debian.org> (supplier of updated gettext package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Fri, 05 Aug 2011 15:47:34 +0200
Source: gettext
Binary: gettext-base gettext gettext-el gettext-doc autopoint
Architecture: source all amd64
Version: 0.18.1.1-4
Distribution: unstable
Urgency: low
Maintainer: Santiago Vila <sanvila@debian.org>
Changed-By: Santiago Vila <sanvila@debian.org>
Description: 
 autopoint  - The autopoint program from GNU gettext
 gettext    - GNU Internationalization utilities
 gettext-base - GNU Internationalization utilities for the base system
 gettext-doc - Documentation for GNU gettext
 gettext-el - Emacs po-mode for editing gettext .po files
Closes: 608181
Changes: 
 gettext (0.18.1.1-4) unstable; urgency=low
 .
   * Applied patch by Bruno Haible to fix xgettext crash when extracting
     a message with plural that is excluded. Closes: #608181.
   * Dropped obsolete -D_REENTRANT. Use --enable-threads instead.
Checksums-Sha1: 
 01a67e253a1c83145dabc1f82ed7903c8c8c5a4f 1514 gettext_0.18.1.1-4.dsc
 73792f66c49d2dc2321b5689a906aa03088b3ab2 39505 gettext_0.18.1.1-4.debian.tar.gz
 37c6cae5c746674b37a7b4bc5342636b3bc02c77 59606 gettext-el_0.18.1.1-4_all.deb
 836da3391d70358e738577add6f71dfe705248a4 913370 gettext-doc_0.18.1.1-4_all.deb
 93e607341fbb34ca08968b33183c2e5f8fb30ced 623812 autopoint_0.18.1.1-4_all.deb
 92981f21ff757f34e8e6630f1af518f329df569a 153966 gettext-base_0.18.1.1-4_amd64.deb
 07cf76cd6e1d2ec996f6bd9bcfa73a7248bab1bf 2079220 gettext_0.18.1.1-4_amd64.deb
Checksums-Sha256: 
 8588dd650654fa73db2a2759845f3237b6ce115683d1321261a401de99d838cb 1514 gettext_0.18.1.1-4.dsc
 30013b4de2477f22c2c9805d11be3d25f36868e23bc92fbc0409763b9aef5431 39505 gettext_0.18.1.1-4.debian.tar.gz
 341958dcb9212e0ecbb753aab6abc801725d2a5612910e874a8028bdccdff5c9 59606 gettext-el_0.18.1.1-4_all.deb
 7de7cc03de4a2a3389c23e7681e5a368c22cbcdeac4755be00f5e145428de3ba 913370 gettext-doc_0.18.1.1-4_all.deb
 e241bba0bf9456bdeebbd0a93dc966acb48feed36258628a4b6faa677169d243 623812 autopoint_0.18.1.1-4_all.deb
 bbf1e6d0b96f41e72092f3ba4b519badfd10b5a5f45c72f0487f80e498851963 153966 gettext-base_0.18.1.1-4_amd64.deb
 e4d36cf6b5617aec56382d634b1f02d53f1f8a84c6ed526bc96fa0266cddb84f 2079220 gettext_0.18.1.1-4_amd64.deb
Files: 
 725e1d60e0f7e4e70d671c9ac02d67ba 1514 devel optional gettext_0.18.1.1-4.dsc
 aa9d269183232f0ac63f624a99d290a7 39505 devel optional gettext_0.18.1.1-4.debian.tar.gz
 0e5a746ae61998ce00a07cf14640eb15 59606 lisp optional gettext-el_0.18.1.1-4_all.deb
 5fa5f4a13ce7e4f9cbd275451a43f943 913370 doc optional gettext-doc_0.18.1.1-4_all.deb
 405a0eef81fb7363f03c2bbbe3dced2c 623812 devel optional autopoint_0.18.1.1-4_all.deb
 4379b5900f7c3350483fd81404d42c55 153966 utils standard gettext-base_0.18.1.1-4_amd64.deb
 64ecea482fe65984e1ab4787a1fa964f 2079220 devel optional gettext_0.18.1.1-4_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEcBAEBCAAGBQJOO/XgAAoJEEHOfwufG4sy+UwH/RdyJIDZ9r3SCAoIAQ/wgErf
5is2c59FGiI7e9pWVx1cphj0YCo7lvn1zgpnHDQnx7YRBS+6R4AutYABYCyYXOQQ
RRU6kdpVDZERwYcRJmWwbPo26V3GW8oWbNbqcIg7vYxd4g8iZe6xI6UK7n51abty
6Ngmzp0Zs6g8SQ7x+POdMkB58PdRpafBsNniGmOmjAigYldJ6QEgWN70pxPLQ4ss
dissUpRMe3xMnpOoGED0Xc9o4/gM6YH6LB1mXgYLp1LsXWL2beGOtsSir6WDtSvP
Krgap0oYs6+WBxTZ2YaFNrPZFAkONxNY805XAXGDe0m4GHpJyQ2XTUyoi5C9wiw=
=H4tw
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Tue, 13 Sep 2011 07:40:01 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Sep 28 08:19:13 2023; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.