flightlessmango / MangoHud

A Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more. Discord: https://discordapp.com/invite/Gj5YmBb
MIT License
6.54k stars 291 forks source link

MangoHud crashes with 'std::invalid_argument' exception #1451

Closed gnowo closed 1 month ago

gnowo commented 1 month ago

MangoHud crashes with a 'std::invalid_argument' exception related to 'stoul'. It runs without crashing when using the 'no_display' option, but fails to create any log files in either case.

Linux Distribution: Pop!_OS (up to date for stable) MangoHud version: crash on v0.7.2-57-g77b3f36 built from source GPU: NVIDIA GeForce RTX 4070 TI Super NVIDIA Driver Version: 560.35.03

Steps to reproduce:

MangoHud should run without crashing and display FPS information when using glxgears or other OpenGL applications. Also, Debugging flags (MANGOHUD_LOG=1, MANGOHUD_DEBUG=1) don't produce expected log files.

gort818 commented 1 month ago

Can you try MANGOHUD_LOG_LEVEL=debug and post the output

gnowo commented 1 month ago

Running the following command: :~$ MANGOHUD_CONFIG=fps,gpu_stats MANGOHUD_LOG_LEVEL=debug mangohud glxgears 2>&1 | tee mangohud_debug_2.log

:~$ tail mangohud_debug2.log [2024-10-03 19:03:54.349] [MANGOHUD] [debug] [cpu.cpp:644] hwmon: sensor name: mt7921_phy0 [2024-10-03 19:03:54.349] [MANGOHUD] [debug] [cpu.cpp:644] hwmon: sensor name: amdgpu [2024-10-03 19:03:54.350] [MANGOHUD] [debug] [gl_hud.cpp:132] vendor: NVIDIA Corporation, deviceName: NVIDIA GeForce RTX 4070 Ti SUPER/PCIe/SSE2 [2024-10-03 19:03:54.350] [MANGOHUD] [debug] [gl_hud.cpp:154] GL device id: 0000 [2024-10-03 19:03:54.350] [MANGOHUD] [debug] [gl_hud.cpp:156] gpu: NVIDIA GeForce RTX 4070 Ti SUPER/PCIe/SSE2 [2024-10-03 19:03:54.351] [MANGOHUD] [info] [gl_renderer.cpp:422] GL version: 4.6 [2024-10-03 19:03:54.364] [MANGOHUD] [debug] [inject_glx.cpp:115] GL ref count: 1 [2024-10-03 19:03:54.374] [MANGOHUD] [debug] [gl_renderer.cpp:296] glsl_version: 410 terminate called after throwing an instance of 'std::invalid_argument' what(): stoul

Let me know if you need a more verbose output.

flightlessmango commented 1 month ago

Can you get log again with this commit c8cfeb4b4c3bd193c0f678cb875618442df8e502?

flightlessmango commented 1 month ago

updated commit 2732de1

gnowo commented 1 month ago

removed MangoHud, updated to requested commit and rebuilt: :~$ git clone https://github.com/flightlessmango/MangoHud.git cd MangoHud :~/MangoHud$ git checkout 2732de1 :~/MangoHud$ ./build.sh build ./build.sh package ./build.sh install

ran, logged and output afterward: :~/MangoHud$ mangohud --dlsym glxgears &> mangohud_log.txt Aborted (core dumped) :~/MangoHud$ cat mangohud_log.txt terminate called after throwing an instance of 'std::invalid_argument' what(): stoul

gort818 commented 1 month ago

can you run it with MANGOHUD_LOG_LEVEL=debug again?

gnowo commented 1 month ago

$ MANGOHUD_LOG_LEVEL=debug mangohud glxgears &> mangohud_log.txt Aborted (core dumped)

$ cat mangohud_log.txt [2024-10-04 21:25:00.006] [MANGOHUD] [debug] [config.cpp:117] skipping config: '/usr/bin/MangoHud.conf' [ not found ] [2024-10-04 21:25:00.006] [MANGOHUD] [debug] [config.cpp:117] skipping config: '/home/gzeronone/.config/MangoHud/glxgears.x86_64-linux-gnu.conf' [ not found ] [2024-10-04 21:25:00.006] [MANGOHUD] [debug] [config.cpp:117] skipping config: '/etc/MangoHud.conf' [ not found ] [2024-10-04 21:25:00.006] [MANGOHUD] [debug] [config.cpp:117] skipping config: '/home/gzeronone/.config/MangoHud/MangoHud.conf' [ not found ] [2024-10-04 21:25:00.006] [MANGOHUD] [debug] [overlay_params.cpp:1001] Failed to read presets file: '/home/gzeronone/.config/MangoHud/presets.conf'. Falling back to default presets [2024-10-04 21:25:00.006] [MANGOHUD] [debug] [config.cpp:117] skipping config: '/usr/bin/MangoHud.conf' [ not found ] [2024-10-04 21:25:00.006] [MANGOHUD] [debug] [config.cpp:117] skipping config: '/home/gzeronone/.config/MangoHud/glxgears.x86_64-linux-gnu.conf' [ not found ] [2024-10-04 21:25:00.006] [MANGOHUD] [debug] [config.cpp:117] skipping config: '/etc/MangoHud.conf' [ not found ] [2024-10-04 21:25:00.006] [MANGOHUD] [debug] [config.cpp:117] skipping config: '/home/gzeronone/.config/MangoHud/MangoHud.conf' [ not found ] [2024-10-04 21:25:00.006] [MANGOHUD] [debug] [logging.cpp:244] Logger constructed! [2024-10-04 21:25:00.015] [MANGOHUD] [debug] [overlay.cpp:845] Ram:31910060 [2024-10-04 21:25:00.015] [MANGOHUD] [debug] [overlay.cpp:846] Cpu:AMD Ryzen 7 7700X 8-Core Processor [2024-10-04 21:25:00.015] [MANGOHUD] [debug] [overlay.cpp:847] Kernel:6.9.3-76060903-generic [2024-10-04 21:25:00.015] [MANGOHUD] [debug] [overlay.cpp:848] Os:Pop!_OS 22.04 LTS [2024-10-04 21:25:00.015] [MANGOHUD] [debug] [overlay.cpp:849] Driver: [2024-10-04 21:25:00.015] [MANGOHUD] [debug] [overlay.cpp:850] CPU Scheduler:performance [2024-10-04 21:25:00.015] [MANGOHUD] [debug] [cpu.cpp:518] hwmon: sensor name: k10temp [2024-10-04 21:25:00.015] [MANGOHUD] [debug] [cpu.cpp:551] hwmon: using input: /sys/class/hwmon/hwmon2/temp1_input [2024-10-04 21:25:00.015] [MANGOHUD] [debug] [cpu.cpp:644] hwmon: sensor name: k10temp [2024-10-04 21:25:00.015] [MANGOHUD] [debug] [cpu.cpp:644] hwmon: sensor name: nvme [2024-10-04 21:25:00.015] [MANGOHUD] [debug] [cpu.cpp:644] hwmon: sensor name: mt7921_phy0 [2024-10-04 21:25:00.015] [MANGOHUD] [debug] [cpu.cpp:644] hwmon: sensor name: amdgpu [2024-10-04 21:25:00.016] [MANGOHUD] [debug] [gl_hud.cpp:132] vendor: NVIDIA Corporation, deviceName: NVIDIA GeForce RTX 4070 Ti SUPER/PCIe/SSE2 [2024-10-04 21:25:00.016] [MANGOHUD] [debug] [gl_hud.cpp:154] GL device id: 0000 [2024-10-04 21:25:00.016] [MANGOHUD] [debug] [gl_hud.cpp:156] gpu: NVIDIA GeForce RTX 4070 Ti SUPER/PCIe/SSE2 [2024-10-04 21:25:00.016] [MANGOHUD] [info] [gl_renderer.cpp:422] GL version: 4.6 [2024-10-04 21:25:00.031] [MANGOHUD] [debug] [inject_glx.cpp:115] GL ref count: 1 [2024-10-04 21:25:00.041] [MANGOHUD] [debug] [gl_renderer.cpp:296] glsl_version: 410 terminate called after throwing an instance of 'std::invalid_argument' what(): stoul

flightlessmango commented 1 month ago

it doesn't appear to be on the correct commit

gnowo commented 1 month ago

okay, I had to wipe and rebuild. here's the correct version and debug output:

:~/MangoHud$ mangohud --version v0.7.2-62-g2732de1 :~/MangoHud$ cd ~ :~$ MANGOHUD_LOG_LEVEL=debug mangohud glxgears &> mangohud_log_2732de1.txt Segmentation fault (core dumped) :~$ cat mangohud_log_2732de1.txt [2024-10-05 10:18:40.633] [MANGOHUD] [debug] [overlay_params.cpp:762] Version: v0.7.2-62-g2732de1 [2024-10-05 10:18:40.633] [MANGOHUD] [debug] [config.cpp:117] skipping config: '/usr/bin/MangoHud.conf' [ not found ] [2024-10-05 10:18:40.634] [MANGOHUD] [debug] [config.cpp:117] skipping config: '/home/gzeronone/.config/MangoHud/glxgears.x86_64-linux-gnu.conf' [ not found ] [2024-10-05 10:18:40.634] [MANGOHUD] [debug] [config.cpp:117] skipping config: '/etc/MangoHud.conf' [ not found ] [2024-10-05 10:18:40.634] [MANGOHUD] [debug] [config.cpp:117] skipping config: '/home/gzeronone/.config/MangoHud/MangoHud.conf' [ not found ] [2024-10-05 10:18:40.634] [MANGOHUD] [debug] [overlay_params.cpp:1003] Failed to read presets file: '/home/gzeronone/.config/MangoHud/presets.conf'. Falling back to default presets [2024-10-05 10:18:40.634] [MANGOHUD] [debug] [config.cpp:117] skipping config: '/usr/bin/MangoHud.conf' [ not found ] [2024-10-05 10:18:40.634] [MANGOHUD] [debug] [config.cpp:117] skipping config: '/home/gzeronone/.config/MangoHud/glxgears.x86_64-linux-gnu.conf' [ not found ] [2024-10-05 10:18:40.634] [MANGOHUD] [debug] [config.cpp:117] skipping config: '/etc/MangoHud.conf' [ not found ] [2024-10-05 10:18:40.634] [MANGOHUD] [debug] [config.cpp:117] skipping config: '/home/gzeronone/.config/MangoHud/MangoHud.conf' [ not found ] [2024-10-05 10:18:40.634] [MANGOHUD] [debug] [logging.cpp:244] Logger constructed! [2024-10-05 10:18:40.642] [MANGOHUD] [debug] [overlay.cpp:845] Ram:31910060 [2024-10-05 10:18:40.642] [MANGOHUD] [debug] [overlay.cpp:846] Cpu:AMD Ryzen 7 7700X 8-Core Processor [2024-10-05 10:18:40.642] [MANGOHUD] [debug] [overlay.cpp:847] Kernel:6.9.3-76060903-generic [2024-10-05 10:18:40.642] [MANGOHUD] [debug] [overlay.cpp:848] Os:Pop!_OS 22.04 LTS [2024-10-05 10:18:40.642] [MANGOHUD] [debug] [overlay.cpp:849] Driver: [2024-10-05 10:18:40.642] [MANGOHUD] [debug] [overlay.cpp:850] CPU Scheduler:performance [2024-10-05 10:18:40.642] [MANGOHUD] [debug] [cpu.cpp:515] hwmon: sensor name: k10temp [2024-10-05 10:18:40.642] [MANGOHUD] [debug] [cpu.cpp:548] hwmon: using input: /sys/class/hwmon/hwmon2/temp1_input [2024-10-05 10:18:40.642] [MANGOHUD] [debug] [cpu.cpp:641] hwmon: sensor name: k10temp [2024-10-05 10:18:40.642] [MANGOHUD] [debug] [cpu.cpp:641] hwmon: sensor name: nvme [2024-10-05 10:18:40.642] [MANGOHUD] [debug] [cpu.cpp:641] hwmon: sensor name: mt7921_phy0 [2024-10-05 10:18:40.642] [MANGOHUD] [debug] [cpu.cpp:641] hwmon: sensor name: amdgpu [2024-10-05 10:18:40.643] [MANGOHUD] [debug] [gl_hud.cpp:132] vendor: NVIDIA Corporation, deviceName: NVIDIA GeForce RTX 4070 Ti SUPER/PCIe/SSE2 [2024-10-05 10:18:40.643] [MANGOHUD] [debug] [gl_hud.cpp:154] GL device id: 0000 [2024-10-05 10:18:40.644] [MANGOHUD] [debug] [gl_hud.cpp:156] gpu: NVIDIA GeForce RTX 4070 Ti SUPER/PCIe/SSE2 [2024-10-05 10:18:40.644] [MANGOHUD] [info] [gl_renderer.cpp:422] GL version: 4.6 [2024-10-05 10:18:40.658] [MANGOHUD] [debug] [inject_glx.cpp:115] GL ref count: 1 [2024-10-05 10:18:40.662] [MANGOHUD] [debug] [gl_renderer.cpp:296] glsl_version: 410 [2024-10-05 10:18:40.677] [MANGOHUD] [debug] [nvidia.cpp:290] XNVCtrl is using display

flightlessmango commented 1 month ago

So it's not crashing anymore?

gnowo commented 1 month ago

I am still experiencing crashing.

:~$ mangohud glxgears Running synchronized to the vertical refresh. The framerate should be approximately the same as the monitor refresh rate. Segmentation fault (core dumped)

Etaash-mathamsetty commented 1 month ago

I am still experiencing crashing.

:~$ mangohud glxgears Running synchronized to the vertical refresh. The framerate should be approximately the same as the monitor refresh rate. Segmentation fault (core dumped)

try rebuilding from latest, all crashes I know of are fixed now

gnowo commented 1 month ago

Rebuilt from the most recent version and I am crashing still.

gzeronone@pop-os:~/MangoHud/build$ mangohud --version v0.7.2-64-g7b2dea5 gzeronone@pop-os:~/MangoHud/build$ mangohud glxgears Running synchronized to the vertical refresh. The framerate should be approximately the same as the monitor refresh rate. Segmentation fault (core dumped)

flightlessmango commented 1 month ago

@gnowo can you build with debug and get gdb backtrace?

./build.sh clean build_dbg install
mangohud gdb glxgears
type r
wait for crash
type bt
gnowo commented 1 month ago

Here's the bt output:

Thread 1 "glxgears" received signal SIGSEGV, Segmentation fault. 0x00007ffff778aab4 in XQueryExtension () from /lib/x86_64-linux-gnu/libX11.so.6 (gdb) bt

0 0x00007ffff778aab4 in XQueryExtension () from /lib/x86_64-linux-gnu/libX11.so.6

1 0x00007ffff777e977 in XInitExtension () from /lib/x86_64-linux-gnu/libX11.so.6

2 0x00007ffff71a1821 in XextAddDisplay () from /lib/x86_64-linux-gnu/libXext.so.6

3 0x00007ffff4e3e4ef in ?? () from /lib/x86_64-linux-gnu/libXNVCtrl.so.0

4 0x00007ffff4e3ea8f in XNVCTRLQueryTargetCount () from /lib/x86_64-linux-gnu/libXNVCtrl.so.0

5 0x00007ffff7abd8b1 in NVIDIA::NVIDIA(char const*) () from /usr/local/lib/x86_64-linux-gnu/mangohud/libMangoHud_opengl.so

6 0x00007ffff7aa0b4c in GPUS::GPUS() () from /usr/local/lib/x86_64-linux-gnu/mangohud/libMangoHud_opengl.so

7 0x00007ffff7a58478 in HudElements::gpu_stats() () from /usr/local/lib/x86_64-linux-gnu/mangohud/libMangoHud_opengl.so

8 0x00007ffff7a695e5 in render_imgui(swapchain_stats&, overlay_params&, ImVec2&, bool) ()

from /usr/local/lib/x86_64-linux-gnu/mangohud/libMangoHud_opengl.so

9 0x00007ffff7a4a387 in MangoHud::GL::imgui_render(unsigned int, unsigned int) ()

from /usr/local/lib/x86_64-linux-gnu/mangohud/libMangoHud_opengl.so

10 0x00007ffff7a4ca97 in do_imgui_swap(void, void) () from /usr/local/lib/x86_64-linux-gnu/mangohud/libMangoHud_opengl.so

11 0x00007ffff7a4cc75 in glXSwapBuffers () from /usr/local/lib/x86_64-linux-gnu/mangohud/libMangoHud_opengl.so

12 0x0000555555556dee in ?? ()

13 0x00007ffff7429d90 in __libc_start_call_main (main=main@entry=0x555555556800, argc=argc@entry=1, argv=argv@entry=0x7fffffffde78)

at ../sysdeps/nptl/libc_start_call_main.h:58

14 0x00007ffff7429e40 in __libc_start_main_impl (main=0x555555556800, argc=1, argv=0x7fffffffde78, init=,

fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffde68) at ../csu/libc-start.c:392

15 0x00005555555572b5 in ?? ()

(gdb)

Etaash-mathamsetty commented 1 month ago

Looks like an issue with your Nvidia drivers , but since it's (probably) a regression might also be something in mangohud

gnowo commented 1 month ago

Ah, okay. I ended up refreshing drivers and still crashes. -.-

flightlessmango commented 1 month ago

Attempted fix: e77ff17cf5d0bf986015129a0046c4c0fc91d492

gnowo commented 1 month ago

Still crashing:

gzeronone@pop-os:~/MangoHud/build$ mangohud --version v0.7.2-65-ge77ff17 gzeronone@pop-os:~/MangoHud/build$ mangohud glxgears Running synchronized to the vertical refresh. The framerate should be approximately the same as the monitor refresh rate. Segmentation fault (core dumped)

gort818 commented 1 month ago

Would you mind building the latest and trying again?

gnowo commented 1 month ago

Should it be a specific commit?

flightlessmango commented 1 month ago

Should it be a specific commit?

Just latest should be fine

gnowo commented 1 month ago

Rebuilt with latest and look at that, it works! Thank you everyone. (: +1: