Frictional Games Forum (read-only)
Segmentation fault launcher and AmnesiaAMFP.bin.x86_64 - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Technical Support (https://www.frictionalgames.com/forum/forum-57.html)
+--- Forum: Technical Support - Amnesia: A Machine for Pigs (https://www.frictionalgames.com/forum/forum-52.html)
+---- Forum: Linux - AMFP (https://www.frictionalgames.com/forum/forum-53.html)
+---- Thread: Segmentation fault launcher and AmnesiaAMFP.bin.x86_64 (/thread-23016.html)

Pages: 1 2


RE: Segmentation fault launcher and AmnesiaAMFP.bin.x86_64 - Urkle - 09-19-2013

The crash occurred in XGetICValues which is part of the multi-language input (IME) handling in X11. not sure why exactly it doesn't like eu.UTF-8 setting it to "C" would effectively turn off UTF8 which you generally don't want to do.. you want to use a UTF8 locale.. such as en_US.UTF-8.

Now, on my system (Fedora 17). setting the locale to yours does not cause a crash but rather causes it to quit with an error.

Code:
LANG=eo.utf8 ./Launcher.bin.x86_64
Can't set the specified locale! Check LANG, LC_CTYPE, LC_ALL.

Now, do you have any other lang variables set?? e.g. anything starting with LC_ (set | grep LC_)

Essentially what is going on is I'm initializing the locale with the environment as internally amnesia handles Unicode conversions for text and file paths..

So we do a simple call like this in the startup.


Code:
    if(!std::setlocale(LC_CTYPE, "")) {
                fprintf(stderr, "Can't set the specified locale! Check LANG, LC_CTYPE, LC_ALL.\n");
                return 1;
        }
        char *charset = nl_langinfo(CODESET);
        bool utf8_mode = (strcasecmp(charset, "UTF-8") == 0);
        if (!utf8_mode) {
                fprintf(stderr, "UTF-8 Charset %s available.\nCurrent LANG is %s\nCharset: %s\n",
                        utf8_mode ? "is" : "not",
                        getenv("LANG"), charset);
        }

Which should not fail. (And this is the same code that has been in the Penumbra series, and Amneisa: TDD).. so I'm surprised that there are now issues. And it's rather odd that on Ubuntu setting the locale succeeds only to have the X calls crash later on.

I'll have to investigate more on what is causing this issue.. But you might want to ensure you have the latest updates installed and possible report a bug with your distribution about the issue with that locale.


RE: Segmentation fault launcher and AmnesiaAMFP.bin.x86_64 - Joseph Curwen - 09-23-2013

(09-19-2013, 07:59 PM)Urkle Wrote: Now, on my system (Fedora 17). setting the locale to yours does not cause a crash but rather causes it to quit with an error.

Code:
LANG=eo.utf8 ./Launcher.bin.x86_64
Can't set the specified locale! Check LANG, LC_CTYPE, LC_ALL.
Yes, I get the same error when I set e.g. LANG=foobar or anything other that is not a valid value for this. But for eo.UTF-8 (upper case, don't know if this matters) it still silenty crashens.

Quote:Now, do you have any other lang variables set?? e.g. anything starting with LC_ (set | grep LC_)
Code:
$ set | grep LC_
LC_ADDRESS=eo.UTF-8
LC_IDENTIFICATION=eo.UTF-8
LC_MEASUREMENT=eo.UTF-8
LC_MONETARY=eo.UTF-8
LC_NAME=eo.UTF-8
LC_NUMERIC=eo.UTF-8
LC_PAPER=eo.UTF-8
LC_TELEPHONE=eo.UTF-8
LC_TIME=eo.UTF-8
    for i in $(LC_ALL=C $prog --help);
    for i in $(LC_ALL=C $prog --usage);
    local LC_CTYPE=C;
            __grubcomp "$(LC_ALL=C $prog --help |                         awk -F ":" '/available formats/ { print $2 }' |                         sed 's/, / /g')";
            __grubcomp "$(LC_ALL=C $prog --help |                         awk -F "[()]" '/--target=/ { print $2 }' |                         sed 's/|/ /g')";
    LANG=C LC_MESSAGES=C svn info --non-interactive 2> /dev/null | while read line; do
But only setting LANG=en_US.UTF-8 is enough to make the game run.

Quote:(And this is the same code that has been in the Penumbra series, and Amneisa: TDD)..
No problems with TDD.