8000 Segfault randomly related to wireplumber module · Issue #3974 · Alexays/Waybar · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Segfault randomly related to wireplumber module #3974

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

Open
BBaoVanC opened this issue Mar 8, 2025 · 8 comments
Open

Segfault randomly related to wireplumber module #3974

BBaoVanC opened this issue Mar 8, 2025 · 8 comments

Comments

@BBaoVanC
Copy link
BBaoVanC commented Mar 8, 2025

Sometimes waybar just crashes, not sure of the direct cause. I am running version 0.12.0.

I didn't have log output redirected anywhere so I only have the coredump right now. I'll update if I can get log output of this happening.

Here is the backtrace:

(gdb) bt
#0  0x00005a966b3c292d in waybar::modules::Wireplumber::onMixerApiLoaded (p=<optimized out>, res=<optimized out>, self=0x5a969c558af0)
    at ../src/modules/wireplumber.cpp:282
#1  0x00007388dc5ee8ac in g_task_return_now (task=0x5a969c4b0110) at ../glib/gio/gtask.c:1361
#2  0x00007388dc5ee8f5 in complete_in_idle_cb (task=0x5a969c4b0110) at ../glib/gio/gtask.c:1375
#3  0x00007388dc3f2919 in g_main_dispatch (context=0x5a969bc770b0) at ../glib/glib/gmain.c:3357
#4  0x00007388dc4555d7 in g_main_context_dispatch_unlocked (context=0x5a969bc770b0) at ../glib/glib/gmain.c:4208
#5  g_main_context_iterate_unlocked.isra.0 (context=context@entry=0x5a969bc770b0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at ../glib/glib/gmain.c:4273
#6  0x00007388dc3f1e15 in g_main_context_iteration (context=context@entry=0x5a969bc770b0, may_block=may_block@entry=1) at ../glib/glib/gmain.c:4338
#7  0x00007388dc6240b6 in g_application_run (application=0x5a969bc80a50, argc=<optimized out>, argv=0x7ffc272990b8) at ../glib/gio/gapplication.c:2715
#8  0x00005a966b2eb4fd in waybar::Client::main (this=0x5a969bc43cc0, argc=<optimized out>, argv=<optimized out>)
    at /usr/include/glibmm-2.4/glibmm/refptr.h:259
#9  0x00005a966b2e90f5 in main (argc=3, argv=0x7ffc272990b8) at ../src/main.cpp:107

Code in frame 0:

(gdb) f 0
#0  0x00005a966b3c292d in waybar::modules::Wireplumber::onMixerApiLoaded (p=<optimized out>, res=<optimized out>, self=0x5a969c558af0)
    at ../src/modules/wireplumber.cpp:282
282	   throw std::runtime_error(error->message);
(gdb) l
277	
278	 success = wp_core_load_component_finish(self->wp_core_, res, nullptr);
279	
280	 if (success == FALSE) {
281	   spdlog::error("[{}]: mixer API load failed", self->name_);
282	   throw std::runtime_error(error->message);
283	 }
284	
285	 spdlog::debug("[{}]: loaded mixer API", self->name_);
286	 g_ptr_array_add(self->apis_, ({
@BBaoVanC
Copy link
Author
BBaoVanC commented Mar 8, 2025

It happens reliably immediately after I take a screenshot in Hyprland with grimblast. Not sure of the actual cause. The backtrace might be deceiving because I think there's undefined behavior. All the fields on self in that method are null.

@sayhilel
Copy link

yeah seems like a regression, temp fix is to just use the pulseaudio module and not the wireplumber.

@RobertMueller2
Copy link
Contributor

I think that was introduced here: https://github.com/Alexays/Waybar/pull/2919/files, lines 263-265 (old) and 279-281 (new). If I read this correctly, error is still a NULL pointer when passed to the throw statement.

Perhaps line 277 (new) can be changed to success = wp_core_load_component_finish(self->wp_core_, res, &error);. But I don't know the module, or the API, and I can't reproduce the issue either, and I might just be talking nonsense anyway.

@tokyovigilante can you have a look, please?

@RobertMueller2
Copy link
Contributor

Could anyone who can reproduce the issue test the fix in the linked PR, please?

@BBaoVanC
Copy link
Author
BBaoVanC commented Apr 6, 2025

Testing it now. It hasn't crashed yet but I also couldn't get it to crash reliably before either, so I'll give it more time. Although that fix does make a lot of sense, based on reading alone.

@BBaoVanC
Copy link
Author
BBaoVanC commented Apr 7, 2025

@RobertMueller2 Just got another crash even after adding the PR as a patch to 0.12.0. So the PR doesn't fix my issue unfortunately

@RobertMueller2
Copy link
Contributor

Is the backtrace identical to before? It could be something else now.

@BBaoVanC
Copy link
Author
BBaoVanC commented Apr 7, 2025

Oops, I meant to send the backtrace. I don't have it right now but it showed the segfault happening inside the same function, but this time at line 288 with the for loop at the first iteration. Probably something weird and undefined happening still.

I'll send another backtrace tomorrow when I have time. I might also try enabling some of the sanitizers in GCC.

@Alexays Alexays closed this as completed Apr 24, 2025
@Alexays Alexays reopened this Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
0