bugLordsAWar! - Bugs: bug #32864, game crashes when LANG environment...


bug #32864: game crashes when LANG environment variable is not set

Submitted by:  Dmitrij D. Czarkoff <czarkoff>
Submitted on:  Sun Mar 20 12:50:17 2011  
Category: gameSeverity: 3 - Normal
Item Group: 0.2.0Status: None
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Sun Mar 20 20:50:15 2011, comment #5:

Thanks for reporting the bug and testing the patch.
I have made a note of this bug in the online manual.

Ben Asselstine <benasselstine>
Project Administrator
Sun Mar 20 20:21:49 2011, comment #4:

Confirm that problem is solved.

Regarding LC_CTYPE - on my Archlinux laptop I have:

$ echo $LC_CTYPE

$ locale | grep LC_CTYPE

I must have missed something. At least a couple of years before on Gentoo one had to ensure LC_CTYPE is defined (it was inherited by default from LC_ALL) to get needed locale.

Dmitrij D. Czarkoff <czarkoff>
Sun Mar 20 17:47:10 2011, comment #3:

Thanks for the tip. I've changed the method to check LANG, LC_ALL, and LC_CTYPE environment variables.

I'm kinda clueless about the POSIX rules regarding this!

My GNU+Linux system doesn't have LC_CTYPE defined.

Ben Asselstine <benasselstine>
Project Administrator
Sun Mar 20 16:55:39 2011, comment #2:

Setting LANG helped, I think the patch will help. Now compiling with it.

Just in case: in OpenBSD only LC_CTYPE is defined (normally, to C, national 8-bit encoding or en_US.UTF-8). AFAIK it is also defined in any Linux distro, in other BSDs and in Solaris.

Dmitrij D. Czarkoff <czarkoff>
Sun Mar 20 13:03:17 2011, comment #1:


<d_name>Shield of Courage</d_name>
<d_name xml:lang="ca">Escut de coratge</d_name>

It's segfaulting while reading the first catalan translation in one of the scenario files.

do you have a LANG environment variable set?

--- xmlhelper.cpp (revision 2592)
+++ xmlhelper.cpp (working copy)
@@ -735,6 +735,8 @@
static char *envlang = getenv("LANG");
if (lang == "")
return true;
+ if (envlang == NULL)
+ return false;
if (lang == envlang)
return true;

does this patch help?

Ben Asselstine <benasselstine>
Project Administrator
Sun Mar 20 12:50:17 2011, original submission:

After compiling and installing game I tried to run it, but it segfaults when I press "New Game" button on welcome screen.

Configured with options "--disable-static --disable-sdltest --with-boost-includedir=/usr/local/include --with-libtar=/usr/local/lib --disable-rpath --disable-optimizations", installed to "/usr/local".

The GDB output attached (until Savannah disagreed with me about it's imortance for this report).

Dmitrij D. Czarkoff <czarkoff>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #22972:  law.backtrace added by czarkoff (7kB - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by benasselstine (Posted a comment)
  • -unavailable- added by czarkoff (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun Mar 20 20:50:15 2011benasselstineItem GroupNone=>0.2.0
      Summary[0.2.0] Segfaults on OpenBSD on "New Game"=>game crashes when LANG environment variable is not set
    Sun Mar 20 12:50:17 2011czarkoffAttached File-=>Added law.backtrace, #22972

    Back to the top

    Powered by Savane 3.1-cleanup1