Crash at download start with Spanish locale

Bug #209277 reported by eMTee
6
Affects Status Importance Assigned to Milestone
DC++
Fix Released
High
Unassigned

Bug Description

If locale set to se (Spanish) both 0.705 and svn1085 are crash when a download begins. Happens in ADC and NMDC hubs either. XP SP2, seems independent on OS language/regional settings.
To reproduce : set Spanish locale, go to a hub, try to get a filelist.
Related support issue : https://answers.launchpad.net/dcplusplus/+question/28363

Revision history for this message
poy (poy) wrote :

the crash happens because of the string which is on line 702 of TransferView.cpp:
ui->setStatusString(str(TF_("Requesting %1%") % getFile(d)));

the console window only tells the following when the crash happens:
terminate called after throwing an instance of 'boost::io::bad_format_string'
  what(): boost::bad_format_string: format-string is ill-formed

and GDB has no call stack to show.

the string seems translated correctly in the .po in the repository:
#: win32/TransferView.cpp:703
#, boost-format
msgid "Requesting %1%"
msgstr "Solicitando %1%"

however, in the .mo file provided with DC++ 0.705, this string has become:
Solicitando % 1%

besides fixing the translated string, there should be a way to catch that boost::bad_format_string exception and not make the whole program crash when an altered string is encountered...

Changed in dcplusplus:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Kryppy (kryppy-one) wrote :

I am sorry for this :(

i should be more attent when translating strings.my mistake

Revision history for this message
Jacek Sieka (arnetheduck) wrote :

tentatively fixed - could someone try this with the .mo file from 0.705?

Changed in dcplusplus:
status: Confirmed → Fix Committed
Revision history for this message
poy (poy) wrote :

still crashes, same error message.

Changed in dcplusplus:
status: Fix Committed → Confirmed
Revision history for this message
poy (poy) wrote :

attached patch works, the trick is to create an instance of basic_format with an empty string, so that it doesn't get parsed when it's created; then set the execptions to "no" (it's set to "all" in the basic_format constructor) and finally parse the string.

Revision history for this message
Jacek Sieka (arnetheduck) wrote :

looks good to me...

Changed in dcplusplus:
status: Confirmed → Fix Committed
MikeJJ (mrmikejj)
Changed in dcplusplus:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Patches

Remote bug watches

Bug watches keep track of this bug in other bug trackers.