{"action":"closed","issue":{"url":"https://api.github.com/repos/Brewtarget/brewtarget/issues/127","labels_url":"https://api.github.com/repos/Brewtarget/brewtarget/issues/127/labels{/name}","comments_url":"https://api.github.com/repos/Brewtarget/brewtarget/issues/127/comments","events_url":"https://api.github.com/repos/Brewtarget/brewtarget/issues/127/events","html_url":"https://github.com/Brewtarget/brewtarget/issues/127","id":121979676,"number":127,"title":"Segfault in Log constructor","user":{"login":"rocketman768","id":752558,"avatar_url":"https://avatars.githubusercontent.com/u/752558?v=3","gravatar_id":"","url":"https://api.github.com/users/rocketman768","html_url":"https://github.com/rocketman768","followers_url":"https://api.github.com/users/rocketman768/followers","following_url":"https://api.github.com/users/rocketman768/following{/other_user}","gists_url":"https://api.github.com/users/rocketman768/gists{/gist_id}","starred_url":"https://api.github.com/users/rocketman768/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rocketman768/subscriptions","organizations_url":"https://api.github.com/users/rocketman768/orgs","repos_url":"https://api.github.com/users/rocketman768/repos","events_url":"https://api.github.com/users/rocketman768/events{/privacy}","received_events_url":"https://api.github.com/users/rocketman768/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Brewtarget/brewtarget/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"malavv","id":706112,"avatar_url":"https://avatars.githubusercontent.com/u/706112?v=3","gravatar_id":"","url":"https://api.github.com/users/malavv","html_url":"https://github.com/malavv","followers_url":"https://api.github.com/users/malavv/followers","following_url":"https://api.github.com/users/malavv/following{/other_user}","gists_url":"https://api.github.com/users/malavv/gists{/gist_id}","starred_url":"https://api.github.com/users/malavv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malavv/subscriptions","organizations_url":"https://api.github.com/users/malavv/orgs","repos_url":"https://api.github.com/users/malavv/repos","events_url":"https://api.github.com/users/malavv/events{/privacy}","received_events_url":"https://api.github.com/users/malavv/received_events","type":"User","site_admin":false},"milestone":null,"comments":0,"created_at":"2015-12-14T06:02:20Z","updated_at":"2015-12-16T05:48:28Z","closed_at":"2015-12-16T05:48:28Z","body":"@malavv\r\n\r\nI should have caught this in the review, but the statically-initialized Log() instance uses `getUserDataDir()`, but this is only valid after we read the preferences in `Brewtarget::initialize()`. So, you'll have to move the initialization somewhere after that to fix.\r\n\r\n    Program received signal SIGSEGV, Segmentation fault.\r\n    0x00007ffff2f7921d in QString::append(QString const&) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5\r\n    (gdb) bt\r\n    #0  0x00007ffff2f7921d in QString::append(QString const&) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5\r\n    #1  0x00000000004c16ff in QString::operator+= (this=0x7fffffffded0, s=...) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:410\r\n    #2  0x00000000004c1882 in operator+ (s1=..., s2=...) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:1203\r\n    #3  0x00000000005c73da in Log::Log (this=0x9c6dc0 <Brewtarget::log>, defaultDir=..., isLoggingToStderr=true) at /home/philip/myc/brewtarget/brewtarget/src/Log.cpp:36\r\n    #4  0x0000000000505a93 in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at /home/philip/myc/brewtarget/brewtarget/src/brewtarget.cpp:91\r\n    #5  0x0000000000505b6c in _GLOBAL__sub_I_brewtarget.cpp(void) () at /home/philip/myc/brewtarget/brewtarget/src/brewtarget.cpp:1583\r\n    #6  0x00000000006bf65d in __libc_csu_init ()\r\n    #7  0x00007ffff229aad5 in __libc_start_main (main=0x4b88f6 <main(int, char**)>, argc=1, argv=0x7fffffffe0f8, init=0x6bf610 <__libc_csu_init>, fini=<optimized out>, \r\n    rtld_fini=<optimized out>, stack_end=0x7fffffffe0e8) at libc-start.c:246\r\n    #8  0x00000000004b8829 in _start ()\r\n    (gdb) f 3\r\n    #3  0x00000000005c73da in Log::Log (this=0x9c6dc0 <Brewtarget::log>, defaultDir=..., isLoggingToStderr=true) at /home/philip/myc/brewtarget/brewtarget/src/Log.cpp:36\r\n    36         file.setFileName(defaultDir + filename);\r\n    (gdb) p filename\r\n    $1 = {static null = {<No data fields>}, d = 0x0}\r\n    (gdb) p defaultDir\r\n    $2 = {static null = {<No data fields>}, d = 0x7fffffffdfa0}\r\n"}}