After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 609696 - Gtranslator raise a "segfault" error trying to load a file with wrong formatted headers
Gtranslator raise a "segfault" error trying to load a file with wrong formatt...
Status: RESOLVED FIXED
Product: gtranslator
Classification: Other
Component: Generally bug'd
HEAD
Other Linux
: Normal critical
: 2.0
Assigned To: gtranslator-maint
gtranslator-maint
Depends on:
Blocks:
 
 
Reported: 2010-02-11 23:15 UTC by Fran Diéguez
Modified: 2012-04-24 09:25 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Fran Diéguez 2010-02-11 23:15:51 UTC
Trying to load a file with some of the pofile headers wrongly formatted causes a "segfault".
This could be catched by showing a popup window that informs about this issue or just saying "This file has the headers part wrongly formatted"
Comment 1 Ignacio Casal Quinteiro (nacho) 2010-02-11 23:17:43 UTC
Could you give more info? Which profile headers?
Comment 2 Fran Diéguez 2010-02-11 23:23:47 UTC
Try to load a file with just this content (I know has wrong format...):

format"
msgstr "O documento DVI ten un formato incorrecto"

#: ../backend/dvi/dvidocument.evince-backend.in.h:1
msgid "DVI Documents"
msgstr "Documentos DVI"

#: ../backend/pdf/ev-poppler.cc:571
msgid "This work is in the Public Domain"
msgstr "Este traballo está en dominio público"

#. translators: this is the document security state
#: ../backend/pdf/ev-poppler.cc:824
msgid "Yes"
msgstr "Si"


This is showed on error output:

leela.Descargas >gtranslator evince.master.gl.po
zsh: segmentation fault  gtranslator evince.master.gl.po
Comment 3 Geodebay 2010-09-23 17:04:26 UTC
(In reply to comment #1)
> Could you give more info? Which profile headers?

For example, in this .po file header :
"Project-Id-Version: gtkmm-documentation master\n"
"POT-Creation-Date: 2010-07-20 22:25+0000\n"
"PO-Revision-Date: 2010-09-23 18:41+0200\n"
"Last-Translator: Gérard Baylard <Geodebay@gmail.com>\n"
"Language-Team: français <GNOME French Team <gnomefr@traduc.org>>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

the item
"Report-Msgid-Bugs-To: \n"
is missing. It is common.

Then when you try to save the file, from file menu or automatically, the gtranslator window close unexpectedly - without saving anything.

You must add the missing item. If you do so, it works fine.
If you forgot, you lost all translation work.
Comment 4 gymka 2011-11-17 12:48:17 UTC
same problem(then trying to save) if header is 

"POT-Creation-Date: 2010-07-20 22:25+0000\n"
"PO-Revision-Date: 2010-09-23 18:41+0200\n"
"Last-Translator: Gérard Baylard <Geodebay@gmail.com>\n"
"Language-Team: français <GNOME French Team <gnomefr@traduc.org>>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"Project-Id-Version: gtkmm-documentation master\n"

and not 
"Project-Id-Version: gtkmm-documentation master\n"
"POT-Creation-Date: 2010-07-20 22:25+0000\n"
"PO-Revision-Date: 2010-09-23 18:41+0200\n"
"Last-Translator: Gérard Baylard <Geodebay@gmail.com>\n"
"Language-Team: français <GNOME French Team <gnomefr@traduc.org>>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

poedit not sees problem with such header, msgfmt --check-header too don't sees any problems...
Comment 5 Seán de Búrca 2012-04-23 19:13:54 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.

The rewrite of header handling fixed at least one of the above problems. I committed a patch last night that should fix the last one. If you experienced this problem in the past, please test and verify that it's fixed. Please reopen this bug if it persists.
Comment 6 gymka 2012-04-24 05:46:56 UTC
tested everything works:) if file don't has header, gtranslator adds it.
Comment 7 Fran Diéguez 2012-04-24 09:25:11 UTC
Tested here with gtranslator from repository. All works like a charm.
Tks