Page MenuHome GnuPG

po: msgstr entries with unmatched %-format string (was: gpg --full-gen-key cause segfault under ja_JP.UTF-8 locale)
Closed, ResolvedPublic

Description

gpg2.2.3 crashes with --full-gen-key under ja_JP.UTF-8 locale.

henrich@hp:~ $ env|grep LANG
LANG=ja_JP.UTF-8
GDM_LANG=ja_JP.UTF-8
henrich@hp:~ $ gpg --full-gen-key
gpg (GnuPG) 2.2.3; Copyright (C) 2017 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

ご希望の鍵の種類を選択してください:

(1) RSA と RSA (デフォルト)
(2) DSA と Elgamal
(3) DSA (署名のみ)
(4) RSA (署名のみ)

あなたの選択は?
RSA 鍵は 1024 から 4096 ビットの長さで可能です。
鍵長は? (3072)
要求された鍵長は3072ビット
鍵の有効期限を指定してください。

   0 = 鍵は無期限
<n>  = 鍵は n 日間で期限切れ
<n>w = 鍵は n 週間で期限切れ
<n>m = 鍵は n か月間で期限切れ
<n>y = 鍵は n 年間で期限切れ

鍵の有効期間は? (0)

gpg: signal Segmentation fault caught ... exiting
Segmentation fault

Enviroment: Debian unstable, openSUSE tumbleweed and Fedora27

Note: I've tried it under other locales as kr_KO.UTF-8 and zn_CN.UTF-8 but it doesn't crash.

Details

Version
2.2.3

Event Timeline

It also happens with gpg1.4.22 with --gen-key option.

gniibe changed the task status from Open to Testing.Dec 18 2017, 6:35 AM
gniibe claimed this task.
gniibe triaged this task as High priority.
gniibe added a project: gnupg.
gniibe added a subscriber: gniibe.

Thanks for the report. It seems there has been this bug for four years.
I don't know the reason why msgfmt -c doen't show us the error.
Fixed in repos of GnuPG 1.4, 2.2, 2.0 and master.

OK. I realized that msgfmt -c only works when #, c-format exist.
To check all problems, I did something like following for 1.4, 2.0, 2.2, and master:

$ grep -l -z -P -e '\n\nmsgid.*\nmsgstr.*%' *.po

The output is:

gnupg14/po/fr.po
gnupg14/po/ro.po
gnupg14/po/sk.po
gnupg20/po/de.po
gnupg20/po/nl.po
gnupg20/po/ro.po
gnupg20/po/sk.po
gnupg22/po/de.po
gnupg22/po/nl.po
gnupg22/po/ro.po
gnupg22/po/sk.po
gnupg/po/de.po
gnupg/po/nl.po
gnupg/po/ro.po
gnupg/po/sk.po

Using regexp search on Emacs manually, I located all msgid/msgstr:

gnupg14/po/fr.po: msgid "URL to retrieve public key: "
gnupg14/po/ro.po: msgid "Are you sure you still want to sign it? (y/N) "
gnupg14/po/sk.po: msgid "unable to display photo ID!\n"
gnupg20/po/de.po: msgid "Encryption algorithm supported"
gnupg20/po/nl.po: msgid "failed to get the fingerprint\n"
gnupg20/po/ro.po: msgid "Are you sure you still want to sign it? (y/N) "
gnupg20/po/sk.po: msgid "unable to display photo ID!\n"
gnupg22/po/de.po: msgid "Encryption algorithm supported"
gnupg22/po/nl.po: msgid "failed to get the fingerprint\n"
gnupg22/po/ro.po: msgid "Are you sure you still want to sign it? (y/N) "
gnupg22/po/sk.po: msgid "unable to display photo ID!\n"
gnupg/po/de.po: msgid "Encryption algorithm supported"
gnupg/po/nl.po: msgid "failed to get the fingerprint\n"
gnupg/po/ro.po: msgid "Are you sure you still want to sign it? (y/N) "
gnupg/po/sk.po: msgid "unable to display photo ID!\n"
gniibe renamed this task from gpg --full-gen-key cause segfault under ja_JP.UTF-8 locale to po: msgstr entries with unmatched %-format string (was: gpg --full-gen-key cause segfault under ja_JP.UTF-8 locale).Dec 19 2017, 3:31 AM

All fixed (or marked fuzzy) except for master which will be done with the next merge from 2.2.