mumble-voip / mumble

Mumble is an open-source, low-latency, high quality voice chat software.
https://www.mumble.info
Other
6.22k stars 1.1k forks source link

pipewire audio source change lead to SIGSEGV #6507

Closed iacore closed 4 days ago

iacore commented 1 month ago

Description

Whenever I plug in or unplug a headphone jack, Mumble crashes.

Steps to reproduce

  1. setup pipewire as the sound server
  2. setup pipewire-pulseaudio
  3. choose "Pulseaudio" in the Mumble settings as both input and output [Interface > System]
  4. plug in or pull out a wired headphone

Mumble version

1.6.0

Mumble component

Client

OS

Linux

Reproducible?

Yes

Additional information

I changed the Input System to "Pipewire", Program still crashes. Then, I changed the Output System to "Pipewire", Program crashes no more.

Relevant log output

(lldb output)

<W>2024-07-12 15:08:55.068 QObject: Cannot create children for a parent that is in a different thread.
(Parent is LogDocument(0x555556a9fc70), parent's thread is QThread(0x555555f83b70), current thread is QThread(0x7fffc8064460)
Process 3031949 stopped
* thread #7, name = 'threaded-ml', stop reason = signal SIGSEGV: address not mapped to object (fault address: 0x8)
    frame #0: 0x00007ffff603fce4 libQt5Gui.so.5`QTextDocument::docHandle() const + 4
libQt5Gui.so.5`QTextDocument::docHandle:
->  0x7ffff603fce4 <+4>: movq   0x8(%rdi), %rax
    0x7ffff603fce8 <+8>: retq   
    0x7ffff603fce9:      nop    
    0x7ffff603fcea:      nopw   (%rax,%rax)
(lldb) bt
* thread #7, name = 'threaded-ml', stop reason = signal SIGSEGV: address not mapped to object (fault address: 0x8)
  * frame #0: 0x00007ffff603fce4 libQt5Gui.so.5`QTextDocument::docHandle() const + 4
    frame #1: 0x00007ffff602fbed libQt5Gui.so.5`QTextFrame::begin() const + 29
    frame #2: 0x00007ffff60771f9 libQt5Gui.so.5`___lldb_unnamed_symbol11846 + 1337
    frame #3: 0x00007ffff6077864 libQt5Gui.so.5`___lldb_unnamed_symbol11847 + 452
    frame #4: 0x00007ffff60756c8 libQt5Gui.so.5`___lldb_unnamed_symbol11845 + 7480
    frame #5: 0x00007ffff6077221 libQt5Gui.so.5`___lldb_unnamed_symbol11846 + 1377
    frame #6: 0x00007ffff6077864 libQt5Gui.so.5`___lldb_unnamed_symbol11847 + 452
    frame #7: 0x00007ffff6079db8 libQt5Gui.so.5`QTextDocumentLayout::doLayout(int, int, int) + 232
    frame #8: 0x00007ffff607a273 libQt5Gui.so.5`QTextDocumentLayout::documentChanged(int, int, int) + 563
    frame #9: 0x00007ffff6058470 libQt5Gui.so.5`QTextDocumentPrivate::finishEdit() + 128
    frame #10: 0x00007ffff6058cb8 libQt5Gui.so.5`QTextDocumentPrivate::insertFrame(int, int, QTextFrameFormat const&) + 424
    frame #11: 0x0000555555736cc9 mumble`___lldb_unnamed_symbol6792 + 5001
    frame #12: 0x000055555586922b mumble`___lldb_unnamed_symbol8801 + 91
    frame #13: 0x0000555555624efb mumble`___lldb_unnamed_symbol4529 + 199
    frame #14: 0x0000555555834837 mumble`___lldb_unnamed_symbol8203 + 999
    frame #15: 0x00007fffe80e9cde libpulse.so.0`___lldb_unnamed_symbol743 + 990
    frame #16: 0x00007fffe8074322 libpulsecommon-17.0.so`___lldb_unnamed_symbol1211 + 82
    frame #17: 0x00007fffe807557c libpulsecommon-17.0.so`pa_pdispatch_run + 348
    frame #18: 0x00007fffe80cb254 libpulse.so.0`___lldb_unnamed_symbol667 + 68
    frame #19: 0x00007fffe807a3f5 libpulsecommon-17.0.so`___lldb_unnamed_symbol1225 + 421
    frame #20: 0x00007fffe807b28f libpulsecommon-17.0.so`___lldb_unnamed_symbol1226 + 319
    frame #21: 0x00007fffe80defc8 libpulse.so.0`pa_mainloop_dispatch + 440
    frame #22: 0x00007fffe80df62b libpulse.so.0`pa_mainloop_iterate + 59
    frame #23: 0x00007fffe80df6d1 libpulse.so.0`pa_mainloop_run + 33
    frame #24: 0x00007fffe80efbf2 libpulse.so.0`___lldb_unnamed_symbol761 + 114
    frame #25: 0x00007fffe808e0d7 libpulsecommon-17.0.so`___lldb_unnamed_symbol1268 + 87
    frame #26: 0x00007ffff4ca955a libc.so.6`___lldb_unnamed_symbol3677 + 890
    frame #27: 0x00007ffff4d26a5c libc.so.6`___lldb_unnamed_symbol4112 + 7

Screenshots

No response

davidebeatrici commented 1 month ago

To be clear: is the crash resolved ONLY when you select set both input and output to PipeWire?

iacore commented 1 month ago

To be clear: is the crash resolved ONLY when you select set both input and output to PipeWire?

Yes.

davidebeatrici commented 1 month ago

Alright, thank you for confirming.

Could you paste here the backtrace of each running thread at the time of crashing, please?

iacore commented 1 month ago

Here's the lldb log with backtrace.

I compiled mumble with debug info, and here's the log.

Hartmnt commented 1 month ago

I can reproduce this bug by compiling Mumble to always use the path of the log warning. Most likely Qt does not like it that a QObject/QWidget is created from the audio thread to produce a chat log entry.

Hartmnt commented 1 month ago

This is the offending code: https://github.com/mumble-voip/mumble/blob/b75fe546ab6e5f32204e20df7ee3ceb8ce70262c/src/mumble/AudioOutput.cpp#L417-L419

Hartmnt commented 1 month ago

@iacore Thanks for your backtrace. Without it, it would probably have taken ages to figure out :)

Anyway, would you mind checking if #6510 fixes the issue for you?

iacore commented 1 month ago

Anyway, would you mind checking if #6510 fixes the issue for you?

The crash is fixed. It says, "Positional Audio does not work for mono output device." My output device before or after are both stereo.

It's ok I guess. I don't use the setting anyway.

Hartmnt commented 1 month ago

"Positional Audio does not work for mono output device." My output device before or after are both stereo.

Yes, that's what I figured but that is out of the scope of the issue at hand