Menu

#15 megaglest 3.6.0.2 crashes before the menu screen appears

closed-fixed
None
7
2012-01-22
2011-12-23
No

I've build glest for openSUSE 12.1. When I run it i get an segfault.
It looks like it's caused by ftgl (2.1.3~rc5 ) I've also tried your precompiled version, that one showed the same result.
The rpm's can be found in http://download.opensuse.org/repositories/home:/worldcitizen:/test/openSUSE_12.1/ as for games glew is broken I've build against version 1.6.0 as this one is not broken.

Program received signal SIGSEGV, Segmentation fault.
0x000000000057a93d in Glest::Game::Renderer::getCentered3DPos (text=..., font=0xf6c620, pos=..., w=150, h=22, centeredW=true, centeredH=true, this=<optimized out>) at /usr/src/debug/megaglest-3.6.0.2/source/glest_game/graphics/renderer.cpp:2332
2332 float lineWidth = (font->getTextHandler()->Advance(text.c_str()) * Font::scaleFontValue);

megaglest-3.6.0.2/source/glest_game/graphics/renderer.cpp

2329
2330 Vec2f Renderer::getCentered3DPos(const string &text, Font3D *font, Vec2f &pos, int w, int h,bool centeredW, bool centeredH) {
2331 if(centeredW == true) {
2332 float lineWidth = (font->getTextHandler()->Advance(text.c_str()) * Font::scaleFontValue);
2333 if(lineWidth < w) {
2334 pos.x += ((w / 2.f) - (lineWidth / 2.f));
2335 }
2336 }
2337

I've attached a gdb file. I hope it's helpful.

If I need to test or try something please let me know.

Discussion

  • worldcitizen

    worldcitizen - 2011-12-23

    gdb file

     
  • worldcitizen

    worldcitizen - 2011-12-23
    • priority: 5 --> 7
     
  • Mark Vejvoda

    Mark Vejvoda - 2012-01-02

    Please run in verbose mode and pipe console output to a log file and attach its contents:

    ./megaglest --verbose >info.log

    Thanks

     
  • worldcitizen

    worldcitizen - 2012-01-05

    output of /usr/bin/megaglest --verbose >info.log

     
  • worldcitizen

    worldcitizen - 2012-01-05

    The error.log file assosiated with /usr/bin/megaglest --verbose >info.log

     
  • worldcitizen

    worldcitizen - 2012-01-05

    I've attached the info.log and the .megaglest/error.log file

     
  • Mark Vejvoda

    Mark Vejvoda - 2012-01-05

    Try editing english.lng and add the line:

    MEGAGLEST_FONT=$APPLICATIONDATAPATH/data/core/fonts/LinBiolinum_RB.ttf

    (or edit it to point to a path with the font file mentioned). There are numerous ways to handle this situation but I first want to confirm that the problem is that its not finding the proper font. Thanks. Also where does that font normally live. The game looks for this font be default then falls back to:

    tryFont = getenv("MEGAGLEST_FONT");

    CHECK_FONT_PATH("/usr/share/fonts/truetype/linux-libertine/LinLibertine_Re.ttf")
    CHECK_FONT_PATH("/usr/share/fonts/truetype/freefont/FreeSerif.ttf")
    CHECK_FONT_PATH("/usr/share/fonts/truetype/freefont/FreeSans.ttf")
    CHECK_FONT_PATH("/usr/share/fonts/truetype/freefont/FreeMono.ttf")

     
  • worldcitizen

    worldcitizen - 2012-01-05

    The problem is solved. I hadn't installed data/core/fonts of megaglest-source-embedded-3.6.0.2.tar.xz .

    I like the idea that removed packages like libircclient and libminiupnpc, the standard libs need to be used.

    I need to find out how to handle the fonts without usage of the megaglest-source-embedded tarball.

    openSUSE has for example font /usr/share/fonts/truetype/LinBiolinum_RB.otf (not ttf) in LinuxLibertine-5.1.3-2.1.1.noarch .

     
  • worldcitizen

    worldcitizen - 2012-01-05

    Thank you very much for your help. It's great megaglest is now fixed for openSUSE.

    Extra information the freefonts are found in freefont-0.20110523-4.1.3.noarch

    /usr/share/fonts/truetype/FreeMono.ttf
    /usr/share/fonts/truetype/FreeSans.ttf
    /usr/share/fonts/truetype/FreeSerif.ttf

    Might there way that megaglest can use the standard "Xorg" truetype fonts?

     
  • worldcitizen

    worldcitizen - 2012-01-05

    Patch I used so megaglest-source-embedded-3.6.0.2.tar.xz . doesn't need to be used

     
  • worldcitizen

    worldcitizen - 2012-01-05

    I've used a patch to solve the issue. I've attached the patch.
    I don't know if this is the best way.

     
  • Mark Vejvoda

    Mark Vejvoda - 2012-01-05

    Ok now that we know what is going on (its wasn't finding the fonts) we can try to address this properly. First of all I had code that was supposed to try using fontconfig (to find fonts) but i did not test it and it wasn't compiling right. Currently thats fixed in svn and fontconfig should find the fonts on any distro as long as they are installed and regitered with fontconfig.

    For now (using the current release code) you have multiple options. You could edit 3 languages files and place the correct path to the font on opensuse in them. Edit english.lng, chinese.lng and japanese.lng and set the proper path for the entry:

    MEGAGLEST_FONT=$APPLICATIONDATAPATH/data/core/fonts/<some font name here>

    Set the proper path and fontname for opensuse (chinese and japaense use a font for their language which is quite standard for most Linux distros)

    Thanks

     
  • Narendiran

    Narendiran - 2012-01-22

    Similar problem on Arch linux .....

    megaglest v3.6.0.2
    Compiled using: GNUC: 40602 [64bit] on: Jan 15 2012 14:48:49
    SVN: [Rev: ] - using STREFLOP
    FTGL: error loading font: (null)
    [2012-01-22 11:32:32] *ERROR* In [/build/src/megaglest-3.6.0.2/source/shared_lib/sources/graphics/font.cpp::Font Line: 196] Error [FTGL: error loading font]
    FTGL: error loading font: (null)
    [2012-01-22 11:32:32] *ERROR* In [/build/src/megaglest-3.6.0.2/source/shared_lib/sources/graphics/font.cpp::Font Line: 196] Error [FTGL: error loading font]
    FTGL: error loading font: (null)
    [2012-01-22 11:32:32] *ERROR* In [/build/src/megaglest-3.6.0.2/source/shared_lib/sources/graphics/font.cpp::Font Line: 196] Error [FTGL: error loading font]
    FTGL: error loading font: (null)
    [2012-01-22 11:32:32] *ERROR* In [/build/src/megaglest-3.6.0.2/source/shared_lib/sources/graphics/font.cpp::Font Line: 196] Error [FTGL: error loading font]
    FTGL: error loading font: (null)
    [2012-01-22 11:32:32] *ERROR* In [/build/src/megaglest-3.6.0.2/source/shared_lib/sources/graphics/font.cpp::Font Line: 196] Error [FTGL: error loading font]
    FTGL: error loading font: (null)
    [2012-01-22 11:32:32] *ERROR* In [/build/src/megaglest-3.6.0.2/source/shared_lib/sources/graphics/font.cpp::Font Line: 196] Error [FTGL: error loading font]
    void Shared::Platform::createGlFontOutlines(Shared::Platform::uint32&, const string&, int, float, int, Shared::Graphics::FontMetrics&) not implemented.
    void Shared::Platform::createGlFontOutlines(Shared::Platform::uint32&, const string&, int, float, int, Shared::Graphics::FontMetrics&) not implemented.
    void Shared::Platform::createGlFontOutlines(Shared::Platform::uint32&, const string&, int, float, int, Shared::Graphics::FontMetrics&) not implemented.
    void Shared::Platform::createGlFontOutlines(Shared::Platform::uint32&, const string&, int, float, int, Shared::Graphics::FontMetrics&) not implemented.
    void Shared::Platform::createGlFontOutlines(Shared::Platform::uint32&, const string&, int, float, int, Shared::Graphics::FontMetrics&) not implemented.
    void Shared::Platform::createGlFontOutlines(Shared::Platform::uint32&, const string&, int, float, int, Shared::Graphics::FontMetrics&) not implemented.
    In [/build/src/megaglest-3.6.0.2/source/glest_game/main/main.cpp::handleSIGSEGV Line: 652] Error detected: signal 11:
    Error saved to logfile [/home/narendiran/.megaglest/error.log]
    [2012-01-22 11:32:37] *ERROR* In [/build/src/megaglest-3.6.0.2/source/glest_game/main/main.cpp::handleRuntimeError Line: 416] [In [/build/src/megaglest-3.6.0.2/source/glest_game/main/main.cpp::handleSIGSEGV Line: 652] Error detected: signal 11:
    ] gameInitialized = 1, program = 0x1ee55f0
    [2012-01-22 11:32:37] *ERROR* In [/build/src/megaglest-3.6.0.2/source/glest_game/main/main.cpp::handleRuntimeError Line: 509] [In [/build/src/megaglest-3.6.0.2/source/glest_game/main/main.cpp::handleSIGSEGV Line: 652] Error detected: signal 11:

    Stack Trace:
    megaglest() [0x5bf052] address [0x5bf052] line: 0
    /lib/libc.so.6:() address [0x7f687875e9b0] line: 0
    megaglest() [0x5684dd] address [0x5684dd] line: 0
    megaglest:Glest::Game::Renderer::renderTextBoundingBox3D(std::string const&, Shared::Graphics::Font3D*, Shared::Graphics::Vec4<float> const&, int, int, int, int, bool, bool) address [0x56c6b3] line: 0
    megaglest() [0x56cc05] address [0x56cc05] line: 0
    megaglest:Glest::Game::MenuStateRoot::render() address [0x627cff] line: 0
    megaglest:Glest::Game::MainMenu::render() address [0x6926ef] line: 0
    megaglest:Glest::Game::Program::loopWorker() address [0x5dab9e] line: 0
    megaglest:Glest::Game::glestMain(int, char**) address [0x5caab1] line: 0
    megaglest:Glest::Game::glestMainWrapper(int, char**) address [0x5cc0b6] line: 0
    /lib/libc.so.6:__libc_start_main() address [0x7f687874b38d] line: 0
    megaglest() [0x4a3119] address [0x4a3119] line: 0
    ]
    Segmentation fault

     
  • worldcitizen

    worldcitizen - 2012-01-22

    Can you try to install FreeMono (ttf-freefont) - Unicode and see what happens i.e. if it solves the issue?

    https://wiki.archlinux.org/index.php/Fonts

     
  • Narendiran

    Narendiran - 2012-01-22

    ttf-frefont was already installed

     
  • worldcitizen

    worldcitizen - 2012-01-22

    Can you find out where the fonts have been installed and what the exact names are?

    FreeMono.ttf
    FreeSans.ttf
    FreeSerif.ttf

     
  • worldcitizen

    worldcitizen - 2012-01-22

    Just check they are:

    /usr/share/fonts/TTF/FreeMono.ttf
    /usr/share/fonts/TTF/FreeMonoBold.ttf
    /usr/share/fonts/TTF/FreeMonoBoldOblique.ttf
    /usr/share/fonts/TTF/FreeMonoOblique.ttf
    /usr/share/fonts/TTF/FreeSans.ttf
    /usr/share/fonts/TTF/FreeSansBold.ttf
    /usr/share/fonts/TTF/FreeSansBoldOblique.ttf
    /usr/share/fonts/TTF/FreeSansOblique.ttf
    /usr/share/fonts/TTF/FreeSerif.ttf
    /usr/share/fonts/TTF/FreeSerifBold.ttf
    /usr/share/fonts/TTF/FreeSerifBoldItalic.ttf
    /usr/share/fonts/TTF/FreeSerifItalic.ttf

    You can try:
    mkdir -p /usr/share/fonts/truetype/freefont
    ln -s /usr/share/fonts/TTF/FreeSerif.ttf /usr/share/fonts/truetype/freefont/FreeSerif.ttf
    ln -s /usr/share/fonts/TTF/FreeSans.ttf /usr/share/fonts/truetype/freefont/FreeSans.ttf
    ln -s /usr/share/fonts/TTF/FreeMono.ttf /usr/share/fonts/truetype/freefont/FreeMono.ttf

    Can you check if this solves the issue?

     
  • Sea Mac

    Sea Mac - 2012-01-22

    Check that the size of the Skull Model and the Texture Map 10 are 70 Kbytes. I had a corrupted download (Matched MD5 anyway) that exhibited a Segment fault/Crashed before Menu appears" and the size of those two files was 66 Kbytes. After I replaced those two files with 70 Kb sized copies I got from the data sources it went to the Menu OK.

     
  • Tom Reynolds

    Tom Reynolds - 2012-01-22
    • assigned_to: nobody --> mvejvoda
    • status: open --> closed-fixed
     
  • Tom Reynolds

    Tom Reynolds - 2012-01-22

    Please ignore the comment by carlmccall, it is irrelevant to this issue.
    Narendiran: Please start a new bug report for every new issue, even if it may seem releated to an existing one.
    I'm marking this bug as fixed since the original bug report is, according to Softcoders' latest comment, fixed in subversion. The original bug reporter (only), Worldcitizen, is welcome to comment on and reopen this bug should this turn out to be incorrect.
    Thanks to all of you.

     
  • Mark Vejvoda

    Mark Vejvoda - 2012-01-23

    We are preparing a 3.6.0.3 patch release which should fix this issue since fontconfig works properly and should find fonts on any fontconfig implementation distro. This release will be fully backwards compatible with the current 3.6.0.2 release (which is what is likely to be released on Debian and Ubuntu upcoming releases)

     

Log in to post a comment.