Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
gnowo opened this issue Oct 3, 2024 · 23 comments
Closed

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

gnowo opened this issue Oct 3, 2024 · 23 comments

Comments

@gnowo
Copy link

gnowo commented Oct 3, 2024

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:

  • Install MangoHud from source
  • Run MANGOHUD_CONFIG=fps /usr/local/bin/mangohud glxgears
  • Observe crash with 'std::invalid_argument' exception

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
Copy link
Collaborator

gort818 commented Oct 3, 2024

Can you try MANGOHUD_LOG_LEVEL=debug and post the output

@gnowo
Copy link
Author

gnowo commented Oct 3, 2024

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
Copy link
Owner

Can you get log again with this commit c8cfeb4?

@flightlessmango
Copy link
Owner

updated commit 2732de1

@gnowo
Copy link
Author

gnowo commented Oct 5, 2024

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
Copy link
Collaborator

gort818 commented Oct 5, 2024

can you run it with MANGOHUD_LOG_LEVEL=debug again?

@gnowo
Copy link
Author

gnowo commented Oct 5, 2024

$ 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
Copy link
Owner

it doesn't appear to be on the correct commit

@gnowo
Copy link
Author

gnowo commented Oct 5, 2024

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
Copy link
Owner

So it's not crashing anymore?

@gnowo
Copy link
Author

gnowo commented Oct 8, 2024

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
Copy link
Contributor

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
Copy link
Author

gnowo commented Oct 10, 2024

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
Copy link
Owner

@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
Copy link
Author

gnowo commented Oct 10, 2024

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=, rtld_fini=, stack_end=0x7fffffffde68) at ../csu/libc-start.c:392
#15 0x00005555555572b5 in ?? ()
(gdb)

@Etaash-mathamsetty
Copy link
Contributor

Etaash-mathamsetty commented Oct 10, 2024

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

@gnowo
Copy link
Author

gnowo commented Oct 10, 2024

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

@flightlessmango
Copy link
Owner

Attempted fix: e77ff17

@gnowo
Copy link
Author

gnowo commented Oct 10, 2024

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
Copy link
Collaborator

gort818 commented Oct 14, 2024

Would you mind building the latest and trying again?

@gnowo
Copy link
Author

gnowo commented Oct 15, 2024

Should it be a specific commit?

@flightlessmango
Copy link
Owner

Should it be a specific commit?

Just latest should be fine

@gnowo
Copy link
Author

gnowo commented Oct 16, 2024

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

@gnowo gnowo closed this as completed Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants