nikp123 / xava

X11 Audio Visualizer for ALSA
http://nikp123.github.io/xava
Other
129 stars 14 forks source link

XAVA doesn't start and fails with a memory corruption bug #55

Closed bluebyt closed 9 months ago

bluebyt commented 10 months ago

xava doesn't started, I tried the AppImage and Aur package I have the same error.

realloc(): invalid next size 'xava &' terminated by signal SIGABRT (Abort)

Default config https://pastebin.com/T3cuE1i9

xava -v xava 0.7.1.1

My system: Archlinux, Wayland, Wayfire wlroots 0.16.2-2

nikp123 commented 10 months ago

Thanks for reporting, can you be more specific about what exact machine you're running? As in the packages you have installed on your system and what exact wlroots desktop (sway?).

bluebyt commented 10 months ago

I am running wayfire, maybe I can try gnome and see if I have the same result.

nikp123 commented 10 months ago

I am running wayfire, maybe I can try gnome and see if I have the same result.

gnome wouldn't even work iirc, i didnt test there properly. let me find out whats going on in wayfire

nikp123 commented 10 months ago

Update: I was able to reproduce the problem on wayfire, let's see what broke it

bluebyt commented 10 months ago

Wow thank you for the quick reply

nikp123 commented 10 months ago

Seems that the autogenerated build is broken somehow?????? Can you hit me with your list of packages on your system and the build log. There seems something wrong on arch specifically?

Building under NixOS the bug is avoided.

bluebyt commented 10 months ago

Here the list of package of Arch and aur package https://pastebin.com/uDXjYKKB

But what is the build log, sorry can you be more specific?

nikp123 commented 10 months ago

Here the list of package of Arch and aur package https://pastebin.com/uDXjYKKB

But what is the build log, sorry can you be more specific?

manual rebuilding on arch hides the bug again. try updating the system maybe? some packages tend to grow old.

bluebyt commented 10 months ago

My system is already up to date. So manual rebuilding on arch is working?

nikp123 commented 10 months ago

My system is already up to date. So manual rebuilding on arch is working?

on my system, however its a week out of date. maybe something updated and broke?

Let me try again with an updated system.

nikp123 commented 10 months ago

Nope, it still works.

nikp123 commented 10 months ago

Uh, can you try to run the debugger gdb yourself?

In the command line:

gdb ./xava
r
b

and paste the output.

bluebyt commented 10 months ago

Here you go. gdb xava r b GNU gdb (GDB) 13.2 Copyright (C) 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: https://www.gnu.org/software/gdb/bugs/. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/.

For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from xava... (No debugging symbols found in xava) (gdb)

nikp123 commented 10 months ago

oh sorry, run those in sequence so gdb ./xava first

then once you get the (gdb) prompt type in r<Enter>

once it crashes type b<Enter>

nikp123 commented 10 months ago

also be sure to rebuild xava with debugging symbols by changing the cmake command:

cmake -DCMAKE_BUILD_TYPE=Debug ..
bluebyt commented 10 months ago

Ok! gdb xava
GNU gdb (GDB) 13.2 Copyright (C) 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: https://www.gnu.org/software/gdb/bugs/. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/.

For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from xava... (No debugging symbols found in xava) (gdb) r Starting program: /usr/bin/xava

[Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". [New Thread 0x7ffff6c8f6c0 (LWP 587917)] [New Thread 0x7ffff648e6c0 (LWP 587918)] [New Thread 0x7ffff527e6c0 (LWP 587921)] [New Thread 0x7ffff4a7d6c0 (LWP 587922)] [New Thread 0x7fffe9dff6c0 (LWP 587923)] [New Thread 0x7fffe95fe6c0 (LWP 587924)] [New Thread 0x7fffe8dfd6c0 (LWP 587925)] [New Thread 0x7fffd9bff6c0 (LWP 587926)] [New Thread 0x7fffd93fe6c0 (LWP 587927)] [New Thread 0x7fffd8bfd6c0 (LWP 587928)] realloc(): invalid next size

Thread 1 "xava" received signal SIGABRT, Aborted. 0x00007ffff7d4183c in ?? () from /usr/lib/libc.so.6 (gdb) b Breakpoint 1 at 0x7ffff7d4183c (gdb)

nikp123 commented 10 months ago

Sorry, do bt<enter> after

bluebyt commented 10 months ago

Ok (gdb) bt

0 0x00007ffff7d4183c in ?? () from /usr/lib/libc.so.6

1 0x00007ffff7cf1668 in raise () from /usr/lib/libc.so.6

2 0x00007ffff7cd94b8 in abort () from /usr/lib/libc.so.6

3 0x00007ffff7cda390 in ?? () from /usr/lib/libc.so.6

4 0x00007ffff7d4b7b7 in ?? () from /usr/lib/libc.so.6

5 0x00007ffff7d4f80c in ?? () from /usr/lib/libc.so.6

6 0x00007ffff7d50666 in realloc () from /usr/lib/libc.so.6

7 0x00007ffff7f86f18 in popXAVAEventStack ()

from /usr/lib/libxava-shared.so

8 0x00007ffff7ca09ea in xavaOutputHandleInput ()

from /usr/lib/xava/out_wayland_opengl.so

9 0x000055555555675a in ?? ()

10 0x00007ffff7cdacd0 in ?? () from /usr/lib/libc.so.6

11 0x00007ffff7cdad8a in __libc_start_main () from /usr/lib/libc.so.6

12 0x0000555555556bf5 in ?? ()

(gdb)

nikp123 commented 10 months ago

Seems like a very cursed memory corruption bug, sorry but I don't have the time for this now. Would've gladly fixed it otherwise. Sorry for the hassle

bluebyt commented 10 months ago

Ok thank you!

nikp123 commented 10 months ago

Try using cairo output mode in the meantime or if that doesnt work x11_opengl

The relevant part is:

[output]
method = cairo
bluebyt commented 10 months ago

It's working with both! method = cairo or x11_opengl

nikp123 commented 10 months ago

Nice, but don't close the issue yet. It's not fixed.

bluebyt commented 10 months ago

I used xava with "method = cairo" that work for a while, but eventually it crash with the same message: realloc(): invalid next size

If you want to try something to have more information let me know.

nikp123 commented 10 months ago

Try building now, I might've found whats causing the crash.

detailed video explaining the bug: https://www.youtube.com/watch?v=4SN1YckY-BA (realloc()-ing twice with 0 is undefined behaviour)

bluebyt commented 9 months ago

Hello, yes its work, no more crash!

I can use that setting now method = wayland_opengl

Thank you very much!

nikp123 commented 9 months ago

You're welcome.