Author Topic: [fixed] 3.6.0: Crash with outdated language file reference  (Read 2422 times)

tomreyn

  • Local Moderator
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
This is a report by Atze (who doesn't have a forum account since we only offer english language support so far). He ran into an issue where the game encounteres a situation where it generates a stack trace (error.log). This happens when he starts the game with a glestuser.ini reference to deutsch.ini (which no longer exists - it was replaced by german.lng):

Code: [Select]
v3.6.0-GNUC: 40401 [64bit]-Dec  3 2011 09:46:59, SVN: [Rev: 2954], [STREFLOP]
Language file NOT FOUND, can't open file: [/home/aufgehts/Programme/Spiele/megaglest//data/lang/deutsch.lng] switching to default language: english
AL lib: pulseaudio.c:331: PulseAudio returned minreq > tlength/2; expect break up
[2011-12-04 17:01:47] *ERROR* In [/home/softcoder/Code/megaglest/trunk/source/shared_lib/sources/platform/sdl/window.cpp::handleEvent Line: 334] (a2) Couldn't process event: [Value not found on list box: -] codeLocation = f
Error saved to logfile [/home/aufgehts/.megaglest/error.log]
[2011-12-04 17:01:47] *ERROR* In [/home/softcoder/Code/megaglest/trunk/source/glest_game/main/main.cpp::handleRuntimeError Line: 416] [Value not found on list box: -] gameInitialized = 1, program = 0x274e310
[2011-12-04 17:01:47] *ERROR* In [/home/softcoder/Code/megaglest/trunk/source/glest_game/main/main.cpp::handleRuntimeError Line: 509] [Value not found on list box: -
Stack Trace:
./megaglest:Glest::Game::glestMain(int, char**) address [0x6e4960] line: 3620
./megaglest:Glest::Game::glestMainWrapper(int, char**) address [0x6e60c3] line: 3739
/lib/x86_64-linux-gnu/libc.so.6:__libc_start_main() address [0x7fa0e9abbead] line: 0
./megaglest() [0x5be0a9] address [0x5be0a9] line: 116
]
Cancelled

error.txt:
Code: [Select]
[2011-12-04 17:01:47] Runtime Error information:
======================================================
Value not found on list box: -
Stack Trace:
./megaglest:Glest::Game::glestMain(int, char**) address [0x6e4960] line: 3620
./megaglest:Glest::Game::glestMainWrapper(int, char**) address [0x6e60c3] line: 3739
/lib/x86_64-linux-gnu/libc.so.6:__libc_start_main() address [0x7fa0e9abbead] line: 0
./megaglest() [0x5be0a9] address [0x5be0a9] line: 116
« Last Edit: 5 December 2011, 03:28:38 by tomreyn »
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

Pizza90

  • Draco Rider
  • *****
  • Posts: 282
    • View Profile
Re: 3.6.0: Crash with outdated language file reference
« Reply #1 on: 4 December 2011, 19:53:57 »
The error looks similar to the one i got: http://img195.imageshack.us/img195/517/screen11y.png are they the same thing?
I translated Megaglest in italian and i keep the translation updated.

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: 3.6.0: Crash with outdated language file reference
« Reply #2 on: 4 December 2011, 21:33:56 »
Please explain exact steps to reproduce this error (like what menu and steps taken)

tomreyn

  • Local Moderator
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: 3.6.0: Crash with outdated language file reference
« Reply #3 on: 5 December 2011, 01:27:17 »
Here's how to reproduce it on 3.6.0:

Code: [Select]
sed -i 's/^Lang=.*$//' ~/.megaglest/glestuser.ini
echo 'Lang=non-existent' >> ~/.megaglest/glestuser.ini
grep '^Lang=' ~/.megaglest/glestuser.ini  # Should report: Lang=non-existent
./start_megaglest

Once in the main menu, click on 'Options', the game should then segfault with:

Code: [Select]
gamedir [/home/tomreyn/megaglest-3.6.0]
[ldconfig stuff redacted]
v3.6.0-GNUC: 40401 [64bit]-Dec  3 2011 09:46:59, SVN: [Rev: 2954], [STREFLOP]
Language file NOT FOUND, can't open file: [/home/tomreyn/megaglest-3.6.0//data/lang/deutsch.lng] switching to default language: english
[2011-12-05 02:11:58] *ERROR* In [/home/softcoder/Code/megaglest/trunk/source/shared_lib/sources/platform/sdl/window.cpp::handleEvent Line: 334] (a2) Couldn't process event: [Value not found on list box: -] codeLocation = f
Error saved to logfile [/home/tomreyn/.megaglest/error.log]
[2011-12-05 02:11:58] *ERROR* In [/home/softcoder/Code/megaglest/trunk/source/glest_game/main/main.cpp::handleRuntimeError Line: 416] [Value not found on list box: -] gameInitialized = 1, program = 0x7f08f4000c40
[2011-12-05 02:11:58] *ERROR* In [/home/softcoder/Code/megaglest/trunk/source/glest_game/main/main.cpp::handleRuntimeError Line: 509] [Value not found on list box: -
Stack Trace:
./megaglest:Glest::Game::glestMain(int, char**) address [0x6e4960] line: 3620
./megaglest:Glest::Game::glestMainWrapper(int, char**) address [0x6e60c3] line: 3739
/lib/x86_64-linux-gnu/libc.so.6:__libc_start_main() address [0x7f090521530d] line: 0
./megaglest() [0x5be0a9] address [0x5be0a9] line: 116
]
Aborted (core dumped)

This configuration does not cause a segmentation fault on r2957 so I assume this is already fixed?
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

tomreyn

  • Local Moderator
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: 3.6.0: Crash with outdated language file reference
« Reply #4 on: 5 December 2011, 03:22:32 »
As softcoder reports on IRC, a fix for this issue is available in the subversion repository. This issue only occurs for users who had previously installed MegaGlest and had a non-english language set, and only when they access the 'options' menu. What triggers this issue is that I have renamed the translation files for the 3.6.0 release, so translations which which used to exist in previous versions may not exist now, which the game does not handle gracefully for the options menu in 3.6.0.

Since most 3.6.0 users will be unable to change their language if they had MG installed with a localized language before, affected users should do the following:

[big]Linux[/big]

You may choose beween a simple and a more complex way. If one doesn't work, you may try the other.

1. The Simple way:


Start a terminal (XTerm, Gnome Terminal or the like), it should be available on your application menu.
Type this exactly as it says here, then press Enter:
sed -i 's/^Lang=.*$//' ~/.megaglest/glestuser.ini

If this works out, you won't get any message back but just a new line.

Now start your game and retry to access the Options menu. If it works, set the language to your preferred value.

2. Complex way:

Code: [Select]
#!/bin/bash
USERDATA_ROOT=~/.megaglest/
INIFILE=$USERDATA_ROOT/glestuser.ini
###
echo 'Old Lang setting(s):'
grep '^Lang=' $INIFILE
sed -i 's/^Lang=.*$//' $INIFILE
echo 'Lang=english' >> $INIFILE
echo 'New Lang setting:'
grep '^Lang=' $INIFILE
echo 'You should now be able to run the game, access the "options" menu, and set your preferred language there.'
echo 'Press enter to quit.'
read

To use this script, start a simple text editor (GEdit, Kate or similar), paste the above to it, save it as megaglest-3.6.0-language-fix.sh on your Desktop or another well accessible location and close the editor. Then right-click this file and select properties (may be called similar but different), change its permissions/authority to exectuable for the user/owner (or set may be started as a program) and confirm to close this window. Then double-click the file to execute it. A window should open and you should get to see some lines of text.

If nothing happens when you double-click, then run the following comand instead: bash ~/Desktop/megaglest-3.6.0-language-fix.sh

If this script does not fix the problem please copy and paste the output generated by the script in a reply to this thread, explaining what you did.

It is safe to run this script multiple times and you can safely delete this file at any time.

[big]Windows [/big]

To fix this on Windows, open the Windows / Start menu, browse to the MegaGlest folder and click on the "User Data" entry. You should get to see a file browser window. Look for the file named glestuser.ini or glestuser and rename it to glestuser_360_languagefix.ini. Verify that this file has been renamed, then close the file browser.

Now start your game and retry to access the Options menu. If it works, set the language and all other options to your preferred value, then restart the game to make sure it all works as intended.

[big]Mac OS X [/big]

Instructions will be made available as needed.
« Last Edit: 5 December 2011, 15:39:53 by tomreyn »
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: [fixed] 3.6.0: Crash with outdated language file reference
« Reply #5 on: 5 December 2011, 03:49:59 »
One minor question that's a release too late: Why were the language files renamed? They seemed to cause a lot of harm with no improvement at all.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

tomreyn

  • Local Moderator
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: [fixed] 3.6.0: Crash with outdated language file reference
« Reply #6 on: 5 December 2011, 06:34:56 »
This impression is probably mislead due to lack of information, so it's good you're asking. Some translation file names were in english language already, others were in native language. So the primary goal was unification. Also, the native language files names naturally contained special (non ASCII) characters which can cause locale mismatch and cross platform issues with legacy file systems.
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: [fixed] 3.6.0: Crash with outdated language file reference
« Reply #7 on: 5 December 2011, 06:43:32 »
To add to tomreyns comment in conjunction with standardizing file names, we added the native display names as keys in the lng files so that in the UI you see Native language name + english file name, thus it is highly like a user can pick out the language if they know a) the native language name or the english version of the language name.

Believe me that Internationalization is not a simple task, it was many weeks of work to get this working.

 

anything