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 20 Mar 2011 12:50:17 PM UTC  
 
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 20 Mar 2011 08:50:15 PM UTC, 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 20 Mar 2011 08:21:49 PM UTC, comment #4:

Confirm that problem is solved.

Regarding LC_CTYPE - on my Archlinux laptop I have:

$ echo $LC_CTYPE

$ locale | grep LC_CTYPE
LC_CTYPE="en_US.UTF-8"

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 20 Mar 2011 05:47:10 PM UTC, 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 20 Mar 2011 04:55:39 PM UTC, 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 20 Mar 2011 01:03:17 PM UTC, comment #1:

Hmm!

<itemlist>
<itemproto>
<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 20 Mar 2011 12:50:17 PM UTC, 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):
   
   
Comment:
   

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 20 Mar 2011 08:50:15 PM UTCbenasselstineItem GroupNone=>0.2.0
      Open/ClosedOpen=>Closed
      Summary[0.2.0] Segfaults on OpenBSD on "New Game"=>game crashes when LANG environment variable is not set
    Sun 20 Mar 2011 12:50:17 PM UTCczarkoffAttached File-=>Added law.backtrace, #22972

    Back to the top


    Powered by Savane 3.1-cleanup