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

Segfault randomly related to wireplumber module #3974

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

Segfault randomly related to wireplumber module #3974

BBaoVanC opened this issue Mar 8, 2025 · 3 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?

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

3 participants