pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #6066: Bad string in German translation causes segfault (user-triggerable)
6+ messages / 5 participants
[nested] [flat]

* BUG #6066: Bad string in German translation causes segfault (user-triggerable)
@ 2011-06-17 08:18 Christoph Berg <cb@df7cb.de>
  2011-06-17 08:22 ` Re: BUG #6066: Bad string in German translation causes segfault (user-triggerable) Bernd Helmle <mailings@oopsware.de>
  2011-06-20 11:59 ` Re: BUG #6066: Bad string in German translation causes segfault (user-triggerable) Michael Meskes <meskes@postgresql.org>
  0 siblings, 2 replies; 6+ messages in thread

From: Christoph Berg @ 2011-06-17 08:18 UTC (permalink / raw)
  To: pgsql-bugs


The following bug has been logged online:

Bug reference:      6066
Logged by:          Christoph Berg
Email address:      cb@df7cb.de
PostgreSQL version: 9.1, 9.0, 8.4
Operating system:   any
Description:        Bad string in German translation causes segfault
(user-triggerable)
Details: 

In German locale, the follow statement causes vsnprintf() to segfault when
printing the hint:

SELECT TO_DATE('30.12.2011', 'YYYYMMDD') AS datum;

Fix tested for 8.4:

$ diff -c src/backend/po/de.po.orig src/backend/po/de.po
inline patch 1: src/backend/po/de.po (+0/-0 lines) download inline-1.patch*** src/backend/po/de.po.orig 2011-06-17 10:06:41.000000000 +0200 --- src/backend/po/de.po 2011-06-17 10:06:48.000000000 +0200 *************** *** 12318,12324 **** "If your source string is not fixed-width, try using the \"FM\"
modifier." msgstr "" "Wenn die Quellzeichenkette keine feste Breite hat, versuchen Sie den " ! "Modifikator »%s«." #: utils/adt/formatting.c:1886 utils/adt/formatting.c:1899 #: utils/adt/formatting.c:2029 --- 12318,12324 ---- "If your source string is not fixed-width, try using the \"FM\" modifier." msgstr "" "Wenn die Quellzeichenkette keine feste Breite hat, versuchen Sie den " ! "Modifikator »FM«." #: utils/adt/formatting.c:1886 utils/adt/formatting.c:1899 #: utils/adt/formatting.c:2029 ^ permalink raw reply [nested|flat] 6+ messages in thread

* Re: BUG #6066: Bad string in German translation causes segfault (user-triggerable)
  2011-06-17 08:18 BUG #6066: Bad string in German translation causes segfault (user-triggerable) Christoph Berg <cb@df7cb.de>
@ 2011-06-17 08:22 ` Bernd Helmle <mailings@oopsware.de>
  2011-06-17 08:42   ` Re: BUG #6066: Bad string in German translation causes segfault (user-triggerable) Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
  2011-06-20 20:16   ` Re: BUG #6066: Bad string in German translation causes segfault (user-triggerable) Peter Eisentraut <peter_e@gmx.net>
  1 sibling, 2 replies; 6+ messages in thread

From: Bernd Helmle @ 2011-06-17 08:22 UTC (permalink / raw)
  To: Christoph Berg <cb@df7cb.de>; pgsql-bugs



--On 17. Juni 2011 08:18:03 +0000 Christoph Berg <cb@df7cb.de> wrote:

> In German locale, the follow statement causes vsnprintf() to segfault when
> printing the hint:
>
> SELECT TO_DATE('30.12.2011', 'YYYYMMDD') AS datum;
>
> Fix tested for 8.4:

Additionally, this seems to be the case for 9.0, 9.1 and current -HEAD, too.

-- 
Thanks

	Bernd



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: BUG #6066: Bad string in German translation causes segfault (user-triggerable)
  2011-06-17 08:18 BUG #6066: Bad string in German translation causes segfault (user-triggerable) Christoph Berg <cb@df7cb.de>
  2011-06-17 08:22 ` Re: BUG #6066: Bad string in German translation causes segfault (user-triggerable) Bernd Helmle <mailings@oopsware.de>
@ 2011-06-17 08:42   ` Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
  2011-06-17 09:11     ` Re: BUG #6066: Bad string in German translation causes segfault (user-triggerable) Christoph Berg <cb@df7cb.de>
  1 sibling, 1 reply; 6+ messages in thread

From: Heikki Linnakangas @ 2011-06-17 08:42 UTC (permalink / raw)
  To: Bernd Helmle <mailings@oopsware.de>; +Cc: Christoph Berg <cb@df7cb.de>; pgsql-bugs

On 17.06.2011 11:22, Bernd Helmle wrote:
> --On 17. Juni 2011 08:18:03 +0000 Christoph Berg <cb@df7cb.de> wrote:
>
>> In German locale, the follow statement causes vsnprintf() to segfault
>> when
>> printing the hint:
>>
>> SELECT TO_DATE('30.12.2011', 'YYYYMMDD') AS datum;
>>
>> Fix tested for 8.4:
>
> Additionally, this seems to be the case for 9.0, 9.1 and current -HEAD,
> too.

So, this is a case where the untranslated string doesn't have a %s in 
it, but the translated one does. We should have a way to check those 
automatically. In fact, I'm surprised if someone somewhere hasn't 
already written such a script, as gettext is used very widely. Anyone 
want to research/write a script?

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: BUG #6066: Bad string in German translation causes segfault (user-triggerable)
  2011-06-17 08:18 BUG #6066: Bad string in German translation causes segfault (user-triggerable) Christoph Berg <cb@df7cb.de>
  2011-06-17 08:22 ` Re: BUG #6066: Bad string in German translation causes segfault (user-triggerable) Bernd Helmle <mailings@oopsware.de>
  2011-06-17 08:42   ` Re: BUG #6066: Bad string in German translation causes segfault (user-triggerable) Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
@ 2011-06-17 09:11     ` Christoph Berg <cb@df7cb.de>
  0 siblings, 0 replies; 6+ messages in thread

From: Christoph Berg @ 2011-06-17 09:11 UTC (permalink / raw)
  To: pgsql-bugs

Re: Heikki Linnakangas 2011-06-17 <4DFB137E.4040404@enterprisedb.com>
> So, this is a case where the untranslated string doesn't have a %s
> in it, but the translated one does. We should have a way to check
> those automatically. In fact, I'm surprised if someone somewhere
> hasn't already written such a script, as gettext is used very
> widely. Anyone want to research/write a script?

Actually, msgfmt can do that itself with -c. This can be set in
Makefile.global:

$ grep MSGFMT src/Makefile.global
MSGFMT  = msgfmt -c

Unfortunately that doesn't help in this case, as the bad string isn't
tagged as "#, c-format", but still gets used as such. This seems to be
the case for many errhint() strings. Maybe xgettext should be taught
to treat all errhint() et al arguments as c-strings.

Christoph
-- 
cb@df7cb.de | http://www.df7cb.de/



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: BUG #6066: Bad string in German translation causes segfault (user-triggerable)
  2011-06-17 08:18 BUG #6066: Bad string in German translation causes segfault (user-triggerable) Christoph Berg <cb@df7cb.de>
  2011-06-17 08:22 ` Re: BUG #6066: Bad string in German translation causes segfault (user-triggerable) Bernd Helmle <mailings@oopsware.de>
@ 2011-06-20 20:16   ` Peter Eisentraut <peter_e@gmx.net>
  1 sibling, 0 replies; 6+ messages in thread

From: Peter Eisentraut @ 2011-06-20 20:16 UTC (permalink / raw)
  To: Bernd Helmle <mailings@oopsware.de>; +Cc: Christoph Berg <cb@df7cb.de>; pgsql-bugs

On fre, 2011-06-17 at 10:22 +0200, Bernd Helmle wrote:
> 
> --On 17. Juni 2011 08:18:03 +0000 Christoph Berg <cb@df7cb.de> wrote:
> 
> > In German locale, the follow statement causes vsnprintf() to segfault when
> > printing the hint:
> >
> > SELECT TO_DATE('30.12.2011', 'YYYYMMDD') AS datum;
> >
> > Fix tested for 8.4:
> 
> Additionally, this seems to be the case for 9.0, 9.1 and current -HEAD, too.

Fix committed to 8.4, 9.0, 9.1 translation repositories.




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: BUG #6066: Bad string in German translation causes segfault (user-triggerable)
  2011-06-17 08:18 BUG #6066: Bad string in German translation causes segfault (user-triggerable) Christoph Berg <cb@df7cb.de>
@ 2011-06-20 11:59 ` Michael Meskes <meskes@postgresql.org>
  1 sibling, 0 replies; 6+ messages in thread

From: Michael Meskes @ 2011-06-20 11:59 UTC (permalink / raw)
  To: Christoph Berg <cb@df7cb.de>; +Cc: pgsql-bugs

On Fri, Jun 17, 2011 at 08:18:03AM +0000, Christoph Berg wrote:
> $ diff -c src/backend/po/de.po.orig src/backend/po/de.po
> *** src/backend/po/de.po.orig	2011-06-17 10:06:41.000000000 +0200
> --- src/backend/po/de.po	2011-06-17 10:06:48.000000000 +0200
> ***************
> *** 12318,12324 ****
>   "If your source string is not fixed-width, try using the \"FM\"
> modifier."
>   msgstr ""
>   "Wenn die Quellzeichenkette keine feste Breite hat, versuchen Sie den "
> ! "Modifikator »%s«."
>   
>   #: utils/adt/formatting.c:1886 utils/adt/formatting.c:1899
>   #: utils/adt/formatting.c:2029
> --- 12318,12324 ----
>   "If your source string is not fixed-width, try using the \"FM\"
> modifier."
>   msgstr ""
>   "Wenn die Quellzeichenkette keine feste Breite hat, versuchen Sie den "
> ! "Modifikator »FM«."
>   
>   #: utils/adt/formatting.c:1886 utils/adt/formatting.c:1899
>   #: utils/adt/formatting.c:2029

Applied, thanks for the patch.

Michael
-- 
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
Jabber: michael.meskes at googlemail dot com
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2011-06-20 20:16 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-06-17 08:18 BUG #6066: Bad string in German translation causes segfault (user-triggerable) Christoph Berg <cb@df7cb.de>
2011-06-17 08:22 ` Bernd Helmle <mailings@oopsware.de>
2011-06-17 08:42   ` Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
2011-06-17 09:11     ` Christoph Berg <cb@df7cb.de>
2011-06-20 20:16   ` Peter Eisentraut <peter_e@gmx.net>
2011-06-20 11:59 ` Michael Meskes <meskes@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox