openage icon indicating copy to clipboard operation
openage copied to clipboard

Game crashes on launch (macOS Catalina)

Open UmbertoCorvaglia opened this issue 4 years ago • 6 comments

Hi, after the make run command the game seems to start but then it crashes.

below the error:

make run
[  0%] Automatic MOC for target libopenage
bin/run game
INFO [py] launching openage v0.4.0-104-g0ccc92c0
INFO [py] compiled by AppleClang 11.0.0.11000033
INFO [py] running in DEVMODE
INFO launching engine with Path(Union(Directory(/Users/u***a/AOE2_HD/openage/cfg).root @ (b'cfg',), Directory(/Users/u***a/AOE2_HD/openage/assets).root @ (b'assets',)):) and fps limit 0
INFO SDL audio subsystems initialized
INFO Using audio device: default [freq=48000, format=32784, channels=2, samples=4096]
INFO Initialized SDL video subsystems.
INFO Compiled with Qt 5.13.2 and run with Qt 5.13.2
Traceback (most recent call last):
  File "run.py", line 15, in init run
    main()
  File "/Users/u***a/AOE2_HD/openage/.bin/g++-release-Oauto-sanitize-none/openage/__main__.py", line 129, in main
    return args.entrypoint(args, cli.error)
  File "/Users/u***a/AOE2_HD/openage/.bin/g++-release-Oauto-sanitize-none/openage/game/main.py", line 78, in main
    return run_game(args, root)
  File "openage/game/main_cpp.pyx", line 47, in openage.game.main_cpp.run_game
    result = run_game_cpp(args_cpp)
  File "", line 0, in __pyx_pw_7openage_4game_8main_cpp_1run_game(_object*, _object*, _object*)+0xd97
  File "", line 0, in openage::run_game(openage::main_arguments const&)+0x182
  File "", line 0, in openage::Engine::Engine(openage::util::Path const&, int, bool, char const*)+0xf99
  File "", line 0, in openage::gui::GUI::GUI(SDL_Window*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, openage::gui::EngineQMLInfo*)+0x60d
  File "", line 0, in openage::shader::Program::link()+0x39
  File "", line 0, in openage::shader::Program::check(unsigned int)+0x18d
  File "", line 0, in openage::error::Error::Error(openage::log::message const&, bool, bool)+0x111
  File "libopenage/shader/program.cpp", line 97, in void openage::shader::Program::check(GLenum)
    auto errormsg = MSG(err);
openage.cppinterface.exctranslate.CPPException: Program validation failed
Validation Failed: Current draw framebuffer is invalid.

make: *** [run] Error 1

UmbertoCorvaglia avatar Dec 21 '19 11:12 UmbertoCorvaglia

Hm, your system seems unhappy about the shader validation: At the point where the validation is invoked, the framebuffer is not valid, because we probably didn't bind it.

Without actually having looked at the code and finding the bug, we have two possible solutions:

  • Bind the draw framebuffer before shader validation takes place
  • Let the shader validation be run later, when the framebuffer was already bound

I'd say we go for the first variant and bind a dummy draw framebuffer explicitly (as this bug seems macOS-specific and doesn't occur on Linux or Windows).

TheJJ avatar Dec 21 '19 11:12 TheJJ

thanks for the quick answer, if I want to follow your advice, where in the code should I go to modify?

UmbertoCorvaglia avatar Dec 21 '19 11:12 UmbertoCorvaglia

Maybe this helps:

diff --git a/libopenage/gui/gui.cpp b/libopenage/gui/gui.cpp
index 8766b5940..c9e6699cf 100644
--- a/libopenage/gui/gui.cpp
+++ b/libopenage/gui/gui.cpp
@@ -83,12 +83,6 @@ GUI::GUI(SDL_Window *window,
 		plaintexture_frag.get()
 	);
 
-	this->textured_screen_quad_shader->link();
-	this->tex_loc = this->textured_screen_quad_shader->get_uniform_id("texture");
-	this->textured_screen_quad_shader->use();
-	glUniform1i(this->tex_loc, 0);
-	this->textured_screen_quad_shader->stopusing();
-
 	const float screen_quad[] = {
 		-1.f, -1.f,
 		1.f, -1.f,
@@ -100,6 +94,13 @@ GUI::GUI(SDL_Window *window,
 
 	glBindBuffer(GL_ARRAY_BUFFER, this->screen_quad_vbo);
 	glBufferData(GL_ARRAY_BUFFER, sizeof(screen_quad), screen_quad, GL_STATIC_DRAW);
+
+	this->textured_screen_quad_shader->link();
+	this->tex_loc = this->textured_screen_quad_shader->get_uniform_id("texture");
+	this->textured_screen_quad_shader->use();
+	glUniform1i(this->tex_loc, 0);
+	this->textured_screen_quad_shader->stopusing();
+
 	glBindBuffer(GL_ARRAY_BUFFER, 0);
 }

TheJJ avatar Dec 21 '19 12:12 TheJJ

I have the same problem with macOS 10.14.6. Patch from https://github.com/SFTtech/openage/issues/1207#issuecomment-568177032 did not help. What can I do else?


[  1%] Automatic MOC for target libopenage
bin/run game
INFO [py] launching openage v0.4.0-116-g4cbc3c0e
INFO [py] compiled by Clang 8.0.1
INFO [py] running in DEVMODE
INFO launching engine with Path(Union(Directory(/Volumes/DATA/Developer/openage/cfg).root @ (b'cfg',), Directory(/Volumes/DATA/Developer/openage/assets).root @ (b'assets',)):) and fps limit 0
INFO SDL audio subsystems initialized
INFO Using audio device: default [freq=48000, format=32784, channels=2, samples=4096]
INFO Initialized SDL video subsystems.
INFO Compiled with Qt 5.14.0 and run with Qt 5.14.0
Traceback (most recent call last):
  File "run.py", line 15, in init run
    main()
  File "/Volumes/DATA/Developer/openage/.bin/clang++-release-Oauto-sanitize-none/openage/__main__.py", line 129, in main
    return args.entrypoint(args, cli.error)
  File "/Volumes/DATA/Developer/openage/.bin/clang++-release-Oauto-sanitize-none/openage/game/main.py", line 78, in main
    return run_game(args, root)
  File "openage/game/main_cpp.pyx", line 47, in openage.game.main_cpp.run_game
    result = run_game_cpp(args_cpp)
  File "", line 0, in __pyx_pw_7openage_4game_8main_cpp_1run_game(_object*, _object*, _object*)+0xd97
  File "", line 0, in openage::run_game(openage::main_arguments const&)+0x184
  File "", line 0, in openage::Engine::Engine(openage::util::Path const&, int, bool, char const*)+0xff6
  File "", line 0, in openage::gui::GUI::GUI(SDL_Window*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, openage::gui::EngineQMLInfo*)+0x664
  File "", line 0, in openage::shader::Program::link()+0x39
  File "", line 0, in openage::shader::Program::check(unsigned int)+0x18d
  File "", line 0, in openage::error::Error::Error(openage::log::message const&, bool, bool)+0x111
  File "libopenage/shader/program.cpp", line 97, in void openage::shader::Program::check(GLenum)
    auto errormsg = MSG(err);
openage.cppinterface.exctranslate.CPPException: Program validation failed
Validation Failed: Current draw framebuffer is invalid.

make: *** [run] Error 1

putvr avatar Jan 19 '20 09:01 putvr

Bump! Same problem here. Exact same stack trace as https://github.com/SFTtech/openage/issues/1207#issuecomment-575983546. MacOS 10.15.1

ericdude4 avatar Mar 24 '20 16:03 ericdude4

This issue has been mentioned on openage Forum. There might be relevant details there:

https://openage.discourse.group/t/macosx-version-available/96/2

SFTbot avatar Mar 30 '20 20:03 SFTbot

I think this should be fixed in the new renderer implementation.

heinezen avatar Sep 04 '23 23:09 heinezen