Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Hellzed on August 25, 2018, 04:33:03 pm

Title: Unresponsive menus and dialogs after 3.8 on Linux
Post by: Hellzed on August 25, 2018, 04:33:03 pm
After upgrading fs2 open from 3.7.2 to 3.8 with Knossos, on Ubuntu 18.04, I'm encountering a weird bug:
the game launches just fine, but after I create a pilot and click "select", the main menu appears and just goes unresponsive.
Cursor moves but I can't click on anything and mouseover animations won't appear. To quit, I have to alt-tab out of the game and kill it.

Sometimes, the main menu will work properly, until I bring up a dialog (like restart mission, quit game), then it will go unresponsive.
The behaviour is identical on retail and MediaVPs.

In fast debug mode, the debug log will remain empty.

I thought maybe that was a library issue with the AppImage used by Knossos and built the game myself from the master branch available on GitHub, but the issue is the same with that build.

Reverting to 3.7.2, the menu and dialogs work again. I have no idea what could be wrong here...
Title: Re: Unresponsive menus and dialogs after 3.8 on Linux
Post by: m!m on August 25, 2018, 04:37:05 pm
What happens when you use 3.7.4? Can you determine when this started happening by using the nightly builds?
Title: Re: Unresponsive menus and dialogs after 3.8 on Linux
Post by: Hellzed on August 25, 2018, 04:50:47 pm
I can't find a 3.7.4 tag on git, which commit should I checkout?
Title: Re: Unresponsive menus and dialogs after 3.8 on Linux
Post by: m!m on August 25, 2018, 04:57:45 pm
I think 3.7.4 was released before we used tags in git. You can use the source code package from the release post though.
Title: Re: Unresponsive menus and dialogs after 3.8 on Linux
Post by: Hellzed on August 25, 2018, 05:25:45 pm
I just tried with 3.7.4, all good. I'm not encountering the issue on this build.

Going to bisect it right now.
Title: Re: Unresponsive menus and dialogs after 3.8 on Linux
Post by: Hellzed on August 25, 2018, 10:47:00 pm
Something happened after 3.7.3 or 3.7.4... As soon as builds are tagged 3.7.5, the bug appears.
Bisecting didn't help much, since fso didn't build on linux for a long time, and I had to skip some big antipodes merge with 100k+ changes.
Title: Re: Unresponsive menus and dialogs after 3.8 on Linux
Post by: m!m on August 26, 2018, 10:01:16 am
That is the SDL2 merge and I suspected that it was an issue with that. This must be something specific to your installation or distribution since I don't have such an issue on my Linux system. Have you tried running FSO in a window?

Also, it is weird that the log is staying empty since at least something should be written to it even before the first window appears. Are you sure that you are looking at the right log in the right location? You can find more information on where the right log file will be located here: https://www.hard-light.net/forums/index.php?topic=56279.msg1180359#msg1180359
Title: Re: Unresponsive menus and dialogs after 3.8 on Linux
Post by: Hellzed on August 26, 2018, 11:53:34 am
Indeed, no bug in windowed mode.

Now, here's a fullscreen debug log:
https://fsnebula.org/log/5b828d14cb0d331d2b549753
Title: Re: Unresponsive menus and dialogs after 3.8 on Linux
Post by: m!m on August 26, 2018, 11:59:03 am
There are some weird log entries that show some weird behavior:
Code: [Select]
OpenGL Debug: Source:OpenGL Type:Performance ID:18 Severity:Medium Message:Stalling on the GPU for mapping a busy buffer object

OpenGL Debug: Source:OpenGL Type:Performance ID:19 Severity:Medium Message:CPU mapping a busy "bufferobj" BO stalled and took 2.026 ms.

Frame  0 too long!!: frametime = 1.670 (1.670)
Frame  0 too long!!: frametime = 1.391 (1.391)
Frame  0 too long!!: frametime = 4.590 (4.590)
Frame  0 too long!!: frametime = 1.019 (1.019)
Frame  0 too long!!: frametime = 2.105 (2.105)
Frame  0 too long!!: frametime = 0.936 (0.936)
Frame  0 too long!!: frametime = 1.520 (1.520)
Frame  0 too long!!: frametime = 4.164 (4.164)

Do you know how to use gdb for debugging a program? I would like to know where that GPU warning came from but that requires running the game in a debugger.
Title: Re: Unresponsive menus and dialogs after 3.8 on Linux
Post by: Hellzed on August 26, 2018, 12:39:32 pm
Yeah, after reading that log about the GPU I switched on my nvidia card (same laptop), tried again: no bug.
So that's likely an issue with mesa/xorg-video-intel.

I know some gdb basics, but the bigger issue is that I can't remember how to launch fs open whithout knossos :p
Title: Re: Unresponsive menus and dialogs after 3.8 on Linux
Post by: m!m on August 26, 2018, 12:43:14 pm
Hmm, I can't help you with Knossos unfortunately...

If you find a way to get it to work then the relevant function is debug_callback in gropengl.cpp. Just set a breakpoint in that function and post the backtrace here. Maybe that will shed some light on why this issue might be occurring.
Title: Re: Unresponsive menus and dialogs after 3.8 on Linux
Post by: niffiwan on August 26, 2018, 12:54:13 pm
I know some gdb basics, but the bigger issue is that I can't remember how to launch fs open whithout knossos :p

It should be as simple as:

Code: (in a terminal) [Select]
cd KNOSSOS_DIR/FS2
/path/to/your/git/clone/build/bin/fs2_open_3_8_1_x64
Title: Re: Unresponsive menus and dialogs after 3.8 on Linux
Post by: Hellzed on August 26, 2018, 01:22:35 pm
That works, but now I can't use my build with the breakpoint in gdb because it has no debug symbols... What option do I use cmake with to generate a debug build?
Title: Re: Unresponsive menus and dialogs after 3.8 on Linux
Post by: m!m on August 26, 2018, 01:23:33 pm
You need to use -DCMAKE_BUILD_TYPE=Debug.
Title: Re: Unresponsive menus and dialogs after 3.8 on Linux
Post by: Hellzed on August 26, 2018, 01:41:15 pm
Done. Now i load fs2_open_3_8_1_x64-DEBUG with gdb, but immediately bet a black screen. How do I reach the function that interests us?
I used:
Code: [Select]
break debug_callback
Title: Re: Unresponsive menus and dialogs after 3.8 on Linux
Post by: m!m on August 26, 2018, 01:43:57 pm
The OpenGL output from your log is generated by that function so it should be called when the window freezes. I don't know why you only see a black screen. Maybe there is a warning dialog you are not seeing? Running the game in fullscreen and gdb can be a bit tricky some times.
Title: Re: Unresponsive menus and dialogs after 3.8 on Linux
Post by: Hellzed on August 26, 2018, 02:06:38 pm
Actually the black screen is caused by a bunch of shader issues that trigger debug_callback first, when the program starts
Code: [Select]
OpenGL Debug: Source:Shader Compiler Type:Other ID:6 Severity:UnknownMessage:FS SIMD16 shader: 2 inst, 0 loops, 0 cycles, 0:0 spills:fills, Promoted 0 constants, compacted 32 to 32 bytes.
Btw, the errors really come from the Intel driver: https://github.com/skeggsb/Mesa/blob/master/src/mesa/drivers/dri/i965/intel_buffer_objects.c