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

 
 

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

Submitter:  Dmitrij D. Czarkoff <czarkoff>
Submitted:  Sun 20 Mar 2011 12:50:17 PM UTC
   
 
Category:  game Severity:  3 - Normal
Item Group:  0.2.0 Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group 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>
Group 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>
Group 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 Files:
   
   
Comment:
   

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

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-03-20 benasselstine Item GroupNone 0.2.0
        Open/ClosedOpen Closed
        Summary[0.2.0] Segfaults on OpenBSD on &quot;New Game&quot; game crashes when LANG environment variable is not set
    2011-03-20 czarkoff Attached File- Added law.backtrace, #22972

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code