Skip to content

segfault without having game resources downloaded #11

Description

@kamiccolo

Plain clone, build, run procedure segfaults on missing resources. I guess, it's not really nice behaviour.

Valgrind dump:

$ valgrind --leak-check=full --track-origins=yes ./fheroes2 
==13426== Memcheck, a memory error detector
==13426== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==13426== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==13426== Command: ./fheroes2
==13426== 
03:16:49 PM: [ERROR]	SetLangEnvPath:  translation not found: en.po
03:16:49 PM: [ERROR]	GetMaxMode:  GetMaxMode: no modes available
03:16:49 PM: [ERROR]	Open:  Couldn't open dejavusans.ttf
==13426== Invalid read of size 8
==13426==    at 0x5545E9A: TTF_SizeUNICODE (in /usr/lib/x86_64-linux-gnu/libSDL_ttf-2.0.so.0.10.1)
==13426==    by 0x5547219: TTF_RenderUNICODE_Blended (in /usr/lib/x86_64-linux-gnu/libSDL_ttf-2.0.so.0.10.1)
==13426==    by 0x40ED44: FontTTF::RenderUnicodeChar(unsigned short, RGBA const&, bool) const (in /home/zilvinas/Compile/fheroes2enh/build/fheroes2)
==13426==    by 0x43D81B: AGG::LoadTTFChar(unsigned int) (in /home/zilvinas/Compile/fheroes2enh/build/fheroes2)
==13426==    by 0x43DC2E: AGG::LoadFNT() (in /home/zilvinas/Compile/fheroes2enh/build/fheroes2)
==13426==    by 0x43E39B: AGG::Init() (in /home/zilvinas/Compile/fheroes2enh/build/fheroes2)
==13426==    by 0x5591C1: main (in /home/zilvinas/Compile/fheroes2enh/build/fheroes2)
==13426==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==13426== 
==13426== 
==13426== Process terminating with default action of signal 11 (SIGSEGV)
==13426==    at 0x6245428: raise (raise.c:54)
==13426==    by 0x62454AF: ??? (in /lib/x86_64-linux-gnu/libc-2.23.so)
==13426==    by 0x5545E99: TTF_SizeUNICODE (in /usr/lib/x86_64-linux-gnu/libSDL_ttf-2.0.so.0.10.1)
==13426==    by 0x5547219: TTF_RenderUNICODE_Blended (in /usr/lib/x86_64-linux-gnu/libSDL_ttf-2.0.so.0.10.1)
==13426==    by 0x40ED44: FontTTF::RenderUnicodeChar(unsigned short, RGBA const&, bool) const (in /home/zilvinas/Compile/fheroes2enh/build/fheroes2)
==13426==    by 0x43D81B: AGG::LoadTTFChar(unsigned int) (in /home/zilvinas/Compile/fheroes2enh/build/fheroes2)
==13426==    by 0x43DC2E: AGG::LoadFNT() (in /home/zilvinas/Compile/fheroes2enh/build/fheroes2)
==13426==    by 0x43E39B: AGG::Init() (in /home/zilvinas/Compile/fheroes2enh/build/fheroes2)
==13426==    by 0x5591C1: main (in /home/zilvinas/Compile/fheroes2enh/build/fheroes2)
==13426== 
==13426== HEAP SUMMARY:
==13426==     in use at exit: 201,281 bytes in 1,258 blocks
==13426==   total heap usage: 14,839 allocs, 13,581 frees, 3,328,539 bytes allocated
==13426== 
==13426== 18 bytes in 2 blocks are definitely lost in loss record 20 of 475
==13426==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13426==    by 0x629B489: strdup (strdup.c:42)
==13426==    by 0x6F9B596: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F9C5B4: _XimSetICValueData (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F97B68: _XimLocalCreateIC (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F7D652: XCreateIC (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x4E79BCC: ??? (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
==13426==    by 0x4E7AB71: ??? (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
==13426==    by 0x4E6C405: SDL_VideoInit (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
==13426==    by 0x4E43E6B: SDL_InitSubSystem (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
==13426==    by 0x4E43EE3: SDL_Init (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
==13426==    by 0x40E4DE: SDL::Init(unsigned int) (in /home/zilvinas/Compile/fheroes2enh/build/fheroes2)
==13426== 
==13426== 192 (16 direct, 176 indirect) bytes in 1 blocks are definitely lost in loss record 439 of 475
==13426==    at 0x4C2FD5F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13426==    by 0x6F831FC: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F83770: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F8504E: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F8587B: _XlcCreateLC (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6FA265F: _XlcDefaultLoader (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F8CE4D: _XOpenLC (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F8CF87: _XlcCurrentLC (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F8CFBD: XSetLocaleModifiers (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x4E79AF6: ??? (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
==13426==    by 0x4E7AB71: ??? (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
==13426==    by 0x4E6C405: SDL_VideoInit (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
==13426== 
==13426== 192 (16 direct, 176 indirect) bytes in 1 blocks are definitely lost in loss record 440 of 475
==13426==    at 0x4C2FD5F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13426==    by 0x6F831FC: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F83770: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F8504E: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F8587B: _XlcCreateLC (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6FA265F: _XlcDefaultLoader (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F8CE4D: _XOpenLC (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F8D05A: _XrmInitParseInfo (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F74D3F: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F7835D: XrmGetStringDatabase (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F54D13: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F54FBD: XGetDefault (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426== 
==13426== LEAK SUMMARY:
==13426==    definitely lost: 50 bytes in 4 blocks
==13426==    indirectly lost: 352 bytes in 8 blocks
==13426==      possibly lost: 0 bytes in 0 blocks
==13426==    still reachable: 200,879 bytes in 1,246 blocks
==13426==         suppressed: 0 bytes in 0 blocks
==13426== Reachable blocks (those to which a pointer was found) are not shown.
==13426== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==13426== 
==13426== For counts of detected and suppressed errors, rerun with: -v
==13426== ERROR SUMMARY: 4 errors from 4 contexts (suppressed: 0 from 0)
Segmentation fault (core dumped)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions