ooxi / violetland

An open source cross-platform game similar to Crimsonland
https://violetland.github.io/
Other
66 stars 15 forks source link

Program crash when `USER' environment variable not found #71

Closed ooxi closed 9 years ago

ooxi commented 9 years ago

Program output

# ./violetland 
violetland v0.4.4~SNAPSHOT @ GNU/LINUX
Path to resources is set to:
    "/violetland/dist/bin/../share/violetland"
To change the path use -r <path> key
Can't open config file.
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct null not valid
Aborted (core dumped)

gdb backtrace

(gdb) bt
#0  0x00007ffff629ecc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff62a20d8 in __GI_abort () at abort.c:89
#2  0x00007ffff6ba9535 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff6ba76d6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff6ba7703 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff6ba7922 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007ffff6bf91a7 in std::__throw_logic_error(char const*) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#7  0x00007ffff6c049b1 in char* std::string::_S_construct<char const*>(char const*, char const*, std::allocator<char> const&, std::forward_iterator_tag) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#8  0x00007ffff6c04d48 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#9  0x0000000000463794 in getDefaultName () at /violetland/src/program.cpp:259
#10 0x00000000004638cc in initSystem () at /violetland/src/program.cpp:296
#11 0x0000000000472411 in main (argc=1, argv=0x7fffffffe7b8) at /violetland/src/program.cpp:2283
ooxi commented 9 years ago

Fixed in commit 0db33ecaba1449027cea624587c630f444a0fc10