Return-To-The-Roots / s25client

Return To The Roots (Settlers II(R) Clone)
http://www.rttr.info
GNU General Public License v2.0
478 stars 77 forks source link

make fails #971

Closed x12r13 closed 5 years ago

x12r13 commented 5 years ago

After the nightly build doesn't work for me (GLXBadContext) I'm trying to build the program from source.

After downloading and creating a sub directory build the setup is done with

$> cmake -DCMAKE_BUILD_TYPE=Nightly ..

This seems to work without problems.

But when calling $> make (even using DESTDIR) an error occures.

-- Creating symlinks in to ease debugging. CMake Error at copyDepsToBuildDir.cmake:41 (file): file problem creating directory: /share/s25rttr

Any ideas?

Operating System: Debian Buster / x64

Flamefire commented 5 years ago

You seem to be a CMake beginner, am I right? In this case I suggest using cmake-gui or ccmake which e.g. shows the available choices. In your case CMAKE_BUILD_TYPE=Nightly is invalid. See the Readme.MD in the repo root: cmake -DCMAKE_BUILD_TYPE=Release ..

DESTDIR is only used during install.

I'll add another check to catch your mistake with a better error message.

x12r13 commented 5 years ago

Stimmt, bin kein cmake Benutzer. Habs nur beim Drüberlesen am Schluss der Datei CMakeLists.txt entdeckt :)

Kompilieren läßt es sich jetzt, mal gucken ob das GLX Problem verschwindet.

Danke fuer deine Hilfe!

x12r13 commented 5 years ago

Compilation works, but the error is still the same:

Starte Spiel Lade "/home/av/games/s25rttr_local/usr/local/share/s25rttr/RTTR/splash.bmp": fertig in 6ms X Error of failed request: GLXBadContextTag Major opcode of failed request: 151 (GLX) Minor opcode of failed request: 16 (X_GLXVendorPrivate) Serial number of failed request: 43 Current serial number in output stream: 44 An error occured: press enter to continue

Flamefire commented 5 years ago

Are other OpenGL applications working? What is the output before this error? Could you debug to see what call produces this error? Could you update all drivers/mesa/xserver related things?

Don't know what it is as it looks like a driver failure.

x12r13 commented 5 years ago

It looks like GLX extensions are available:

$ glxgears

4062 frames in 5.0 seconds = 812.124 FPS 4053 frames in 5.0 seconds = 810.428 FPS ...

E.g. blender also works without problems.

$ LANG=C PULSE_SERVER=10.0.0.11 ./usr/local/bin/rttr.sh

checking for an update ... /tmp/s25update.16540: /usr/lib/x86_64-linux-gnu/libcurl.so.4: version `CURL_OPENSSL_3' not found > (required by /tmp/s25update.16540) Return To The Roots v20181217-b0671d62a81015f7680ed45ea3f6e3f43eddded8 Compiled with Gnu GCC C/C++ (4.6.3) for Linux 64 Bit

Starting in /home/av/games/s25rttr_local/usr/local Searching for drivers in /home/av/games/s25rttr_local/usr/local/lib/driver/video 2 video drivers found! Loaded video driver "(SDL) OpenGL via SDL-Library" OpenGL 3.1 supported Searching for drivers in /home/av/games/s25rttr_local/usr/local/lib/driver/audio 1 audio drivers found! Loaded audio driver "(SDL) Audio via SDL_mixer-Library"

Starting the game Loading "/home/av/games/s25rttr_local/usr/local/share/s25rttr/RTTR/splash.bmp": done in 5ms X Error of failed request: GLXBadContextTag Major opcode of failed request: 151 (GLX) Minor opcode of failed request: 16 (X_GLXVendorPrivate) Serial number of failed request: 43 Current serial number in output stream: 44 An error occured: press enter to continue

Setup: It's a headless machine, CUDA libraries are installed, the 1080TI is not used by X, because I need it for calculations. X11 Programs like rttr are executed on a virtual desktop (tigervncserver) and accessed by a lightweight desktop machine. Audio is streamed to the desktop too. 12 out of 24 CPU Threads and 32 GB RAM are still available.

RTTR Version 0.8.2 works without any problems.

$ glxinfo | grep "OpenGL version" OpenGL version string: 3.1 Mesa 18.2.6

Direct rendering is enabled, so it is not related to the "LIBGL_ALWAYS_INDIRECT=1 " problem.

After the splash screen window is opened the error occurs immediately.

At the ogre developer list they discussed a similar problem. Someone found out, that the error occurs when OpenGL plugin is loaded BEFORE creating SDL Window. Re-arranging the order fixed the issue.

Flamefire commented 5 years ago

At the ogre developer list they discussed a similar problem. Someone found out, that the error occurs when OpenGL plugin is loaded BEFORE creating SDL Window. Re-arranging the order fixed the issue.

I guess you are referring to https://forums.ogre3d.org/viewtopic.php?f=2&t=67851 ?
I have no idea what they are referring to with "OpenGL plugin", but as far as I can tell their error came from using OpenGL before initializing the context. I'm quite sure this is not the case with us. The current control flow is:

I don't see anything wrong here. Your setup is quite particular so it may cause subtile bugs (either in our code or in the setup). 0.8.2 is working right now (without any other changes)?

To go further we need to dig deeper. How familiar are you with debugging (gdb)? Are you able to build in Debug mode and get a backtrace when this error occurs?

x12r13 commented 5 years ago

besides the fact that xorg debugging is always a mess i could give it a try, but i have to install the dev libs at first i guess.

your 0.8.2 stable binary works without any (obvious) problems.

Flamefire commented 5 years ago

You already self-compiled, so there should be no need to install anything additional. Just use -DCMAKE_BUILD_TYPE=Debug and compile as usual

Flamefire commented 5 years ago

Ah I misunderstood. Just check which call of rttr causes the issue. Debugging into xorg is hopefully not required

x12r13 commented 5 years ago

Anbei mal meine erste debug session. Wo soll ich denn die break points setzen, bzw was interessiert dich?

gdb.log

Flamefire commented 5 years ago

I assume there is an opengl call that produces the error. (IMO OpenGL calls into X which fails in this case)

So either catch all exceptions so get stopped at the place where it is thrown and produce a backtrace (calls that lead to that exception) or you single step until you find the call manually. In that case I suggest to set a BP in glArchivItem_Bitmap::Draw and step over till you find the crashing call. Then restart and set a BP in the function with the crashing call. Repeat till you found a non-RTTR function.

Flamefire commented 5 years ago

I close this as the initial issue is resolved. Please open a new one once you get the information which call crashes. Thank you 👍