davewx7 / citadel

A turn based strategy game based on the Anura engine
Other
99 stars 25 forks source link

Segmentation fault when executing just after compiling #261

Closed aalonso99 closed 5 years ago

aalonso99 commented 5 years ago

Hello. I am trying to install the game from source but it does not work. I already had a few compilation errors which I managed to solve, due to changes in the ImGui repository (I have already requested those changes to be merged). However when I run ./anura --modules=citadel I get the following log:

INFO: main.cpp:477 : Anura engine version 1.4
INFO: main.cpp:516 : Default Tile Size: 16
INFO: main.cpp:517 : Default Tile Scale: 2
INFO: main.cpp:519 : Build Options:
INFO: main.cpp:521 :     isomap
INFO: main.cpp:521 :     lua
INFO: main.cpp:521 :     save_png
INFO: main.cpp:521 :     sdl2
INFO: main.cpp:521 :     svg
INFO: main.cpp:525 : LOADING CONFIGURATION FROM master-config.cfg
INFO: preferences.cpp:583 : SET PREFERENCES PATH: ~/.citadel/
INFO: module.cpp:334 : LOOKING IN 'modules/citadel/module.cfg': 1
INFO: preferences.cpp:583 : SET PREFERENCES PATH: ~/.citadel/
INFO: preferences.cpp:637 : EXPAND DATA PATHS
INFO: preferences.cpp:637 : EXPAND DATA PATHS
INFO: preferences.cpp:637 : EXPAND DATA PATHS
INFO: preferences.cpp:637 : EXPAND DATA PATHS
INFO: preferences.cpp:637 : EXPAND DATA PATHS
INFO: main.cpp:622 : ARGS: --module=citadel
INFO: main.cpp:622 : ARGS: --auto-size-window
INFO: main.cpp:622 : ARGS: --auto-size-ideal-width=1920
INFO: main.cpp:622 : ARGS: --auto-size-ideal-height=1080
INFO: main.cpp:622 : ARGS: --defer-archive-min-window-width=800
INFO: main.cpp:622 : ARGS: --defer-archive-min-window-height=600
INFO: main.cpp:622 : ARGS: --auto-anchor-objects
INFO: main.cpp:622 : ARGS: --set-fps=60
INFO: preferences.cpp:1082 : FPS: 60 = 16ms/frame
INFO: main.cpp:622 : ARGS: --no-autopause
INFO: main.cpp:622 : ARGS: --server=http://theargentlark.com:23456
INFO: main.cpp:622 : ARGS: --tbs-server
INFO: preferences.cpp:1121 : TURN ON internal server
INFO: main.cpp:622 : ARGS: --allow-debug-console-clicking=false
INFO: main.cpp:622 : ARGS: --disable-global-alpha-filter
INFO: main.cpp:622 : ARGS: --mouse-drag-threshold=100
INFO: main.cpp:622 : ARGS: --loading-screen-bg-color=#16232e
INFO: main.cpp:622 : ARGS: --reload-modified-objects
INFO: main.cpp:622 : ARGS: --start-rumble=false
INFO: main.cpp:622 : ARGS: --enable-graphical-fonts=false
INFO: main.cpp:622 : ARGS: --draw-objects-on-even-pixel-boundaries=false
INFO: main.cpp:622 : ARGS: --allow-builtin-settings-dialog=false
INFO: main.cpp:622 : ARGS: --disable-fullscreen
INFO: main.cpp:622 : ARGS: --max-frame-skips=2
INFO: main.cpp:622 : ARGS: --force-send-stats=false
INFO: main.cpp:622 : ARGS: --devtools=true
INFO: main.cpp:622 : ARGS: --particle-ui-show-save=false
INFO: main.cpp:622 : ARGS: --particle-ui-show-camera=false
INFO: main.cpp:622 : ARGS: --particle-ui-2d=true
INFO: main.cpp:622 : ARGS: --dump-to-console=false
INFO: main.cpp:622 : ARGS: --defer-archive-desktop-fullscreen=true
INFO: main.cpp:622 : ARGS: --log-instrumentation=true
INFO: main.cpp:622 : ARGS: --no-tests
INFO: main.cpp:622 : ARGS: --ffl-vm=true
INFO: preferences.cpp:637 : EXPAND DATA PATHS
INFO: main.cpp:756 : Preferences dir: /home/alejandro/.citadel/
INFO: main.cpp:995 : Initializing fullscreen window: {
    "fullscreen": false,
    "height": 600,
    "renderer": "opengl",
    "resizeable": false,
    "use_vsync": false,
    "width": 800
}
INFO: main.cpp:380 : REJECTED MODE IS 1366x768
INFO: main.cpp:409 : CHOSEN MODE IS 1366x768
anura: imgui/imgui.cpp:3253: ImGuiIO& ImGui::GetIO(): Assertion `GImGui != __null && "No current context. Did you call ImGui::CreateContext() and ImGui::SetCurrentContext() ?"' failed.

Also a segmentation fault at the end. When executing with valgrind it gives the following additional information:

==13758== Process terminating with default action of signal 6 (SIGABRT)
==13758==    at 0x7C90E97: raise (raise.c:51)
==13758==    by 0x7C92800: abort (abort.c:79)
==13758==    by 0x7C82399: __assert_fail_base (assert.c:92)
==13758==    by 0x7C82411: __assert_fail (assert.c:101)
==13758==    by 0x11BFED4: ImGui::GetIO() (in /home/alejandro/Repositories/anura/anura)
==13758==    by 0x65CD68: ImGui_ImplSdlGL3_Init(SDL_Window*) (imgui_impl_sdl_gl3.cpp:380)
==13758==    by 0x57E726: KRE::SDLWindow::createWindow() (WindowManager.cpp:275)
==13758==    by 0x57B209: KRE::WindowManager::createWindow(std::shared_ptr<KRE::Window>) (WindowManager.cpp:719)
==13758==    by 0x4BAD80: main (main.cpp:1020)
==13758== 
==13758== HEAP SUMMARY:
==13758==     in use at exit: 1,796,752 bytes in 9,710 blocks
==13758==   total heap usage: 41,559 allocs, 31,849 frees, 6,041,960 bytes allocated
==13758== 
==13758== LEAK SUMMARY:
==13758==    definitely lost: 17 bytes in 2 blocks
==13758==    indirectly lost: 176 bytes in 4 blocks
==13758==      possibly lost: 584 bytes in 4 blocks
==13758==    still reachable: 1,795,975 bytes in 9,700 blocks
==13758==         suppressed: 0 bytes in 0 blocks

All the dependencies where satisfied and the compilation and linking processes end with no errors.

I cannot find any call to ImGui::CreateContext() in the code. I suppose the ImGui context used to be set with a different function in previous versions so I must change that to the new one, but I am unable to find it.

I want to contribute to the game, so I would be thankful for any help you can give me.

NOTE: I thought I might have downloaded the wrong version of ImGui, but even if I download the version linked in the anura engine repository it updates during the compilation. I guess that was the problem all the time but I do not know how to disable it.