FS#71420 - [polyphone] polyphone 2.2.0 segfaults

Attached to Project: Community Packages
Opened by edes (LudwigJ) - Friday, 02 July 2021, 19:59 GMT
Last edited by Toolybird (Toolybird) - Thursday, 11 May 2023, 03:28 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To David Runge (dvzrv)
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

Polyphone 2.2.0 segfaults as soon as I try to open a soundfont for editing.

I installed the flatpack and it works fine. I built from sources, and it also works fine.

Apparently, there's something wrong with the package distributed by Arch.

I attach the core dump.
This task depends upon

Closed by  Toolybird (Toolybird)
Thursday, 11 May 2023, 03:28 GMT
Reason for closing:  Fixed
Additional comments about closing:  Assuming fixed by polyphone 2.3.0-1
Comment by David Runge (dvzrv) - Monday, 05 July 2021, 16:30 GMT
@LudwigJ: Thanks for the report!

It's not unlikely that the current version of qcustomplot silently broke ABI.
I'll rebuild the package. Please let me know whether 2.2.0-3 fixes the issue for you!
Comment by David Runge (dvzrv) - Monday, 05 July 2021, 16:34 GMT
Ah nevermind. Just rebuilt and have the same breakage (which even takes jack with it and crashes the audio driver...):

```
PID: 1355505 (polyphone)
UID: 1000 (dave)
GID: 1000 (dave)
Signal: 11 (SEGV)
Timestamp: Mon 2021-07-05 18:30:59 CEST (1min 25s ago)
Command Line: polyphone
Executable: /usr/bin/polyphone
Control Group: /user.slice/user-1000.slice/session-2.scope
Unit: session-2.scope
Slice: user-1000.slice
Session: 2
Owner UID: 1000 (dave)
Boot ID: 0a1d5f7556384ec4911dbc23ada5f9ad
Machine ID: a5640b7a4f7946aa8d2d075962e96526
Hostname: hmbx
Storage: /var/lib/systemd/coredump/core.polyphone.1000.0a1d5f7556384ec4911dbc23ada5f9ad.1355505.1625502659000000.zst (present)
Disk Size: 826.9K
Message: Process 1355505 (polyphone) of user 1000 dumped core.

Stack trace of thread 1355505:
#0 0x00006fbb7809a693 __memmove_avx_unaligned_erms (libc.so.6 + 0x163693)
#1 0x00006fbb785ebda8 _ZN7QString6appendERKS_ (libQt5Core.so.5 + 0x150da8)
#2 0x000008fc0cafde85 n/a (polyphone + 0x114e85)
#3 0x000008fc0caa1c62 n/a (polyphone + 0xb8c62)
#4 0x000008fc0ca93272 n/a (polyphone + 0xaa272)
#5 0x00006fbb77f5eb25 __libc_start_main (libc.so.6 + 0x27b25)
#6 0x000008fc0ca95a5e n/a (polyphone + 0xaca5e)

Stack trace of thread 1355510:
#0 0x00006fbb7803018d syscall (libc.so.6 + 0xf918d)
#1 0x00006fbb78569346 _ZN11QBasicMutex12lockInternalEv (libQt5Core.so.5 + 0xce346)
#2 0x000008fc0cb8619f n/a (polyphone + 0x19d19f)
#3 0x00006fbb787814ff _ZN7QObject5eventEP6QEvent (libQt5Core.so.5 + 0x2e64ff)
#4 0x00006fbb793cdd62 _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent (libQt5Widgets.so.5 + 0x15ad62)
#5 0x00006fbb787543aa _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent (libQt5Core.so.5 + 0x2b93aa)
#6 0x00006fbb787574a9 _ZN23QCoreApplicationPrivate16sendPostedEventsEP7QObjectiP11QThreadData (libQt5Core.so.5 + 0x2bc4a9)
#7 0x00006fbb787ad9a4 n/a (libQt5Core.so.5 + 0x3129a4)
#8 0x00006fbb7711010c g_main_context_dispatch (libglib-2.0.so.0 + 0x5410c)
#9 0x00006fbb77163b99 n/a (libglib-2.0.so.0 + 0xa7b99)
#10 0x00006fbb7710d871 g_main_context_iteration (libglib-2.0.so.0 + 0x51871)
#11 0x00006fbb787acfd6 _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Core.so.5 + 0x311fd6)
#12 0x00006fbb78752d1c _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5 + 0x2b7d1c)
#13 0x00006fbb78567e12 _ZN7QThread4execEv (libQt5Core.so.5 + 0xcce12)
#14 0x00006fbb78568fef n/a (libQt5Core.so.5 + 0xcdfef)
#15 0x00006fbb78483259 start_thread (libpthread.so.0 + 0x9259)
#16 0x00006fbb780355e3 __clone (libc.so.6 + 0xfe5e3)

Stack trace of thread 1355508:
#0 0x00006fbb7803018d syscall (libc.so.6 + 0xf918d)
#1 0x00006fbb78569346 _ZN11QBasicMutex12lockInternalEv (libQt5Core.so.5 + 0xce346)
#2 0x000008fc0cb8619f n/a (polyphone + 0x19d19f)
#3 0x00006fbb787814ff _ZN7QObject5eventEP6QEvent (libQt5Core.so.5 + 0x2e64ff)
#4 0x00006fbb793cdd62 _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent (libQt5Widgets.so.5 + 0x15ad62)
#5 0x00006fbb787543aa _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent (libQt5Core.so.5 + 0x2b93aa)
#6 0x00006fbb787574a9 _ZN23QCoreApplicationPrivate16sendPostedEventsEP7QObjectiP11QThreadData (libQt5Core.so.5 + 0x2bc4a9)
#7 0x00006fbb787ad9a4 n/a (libQt5Core.so.5 + 0x3129a4)
#8 0x00006fbb7711010c g_main_context_dispatch (libglib-2.0.so.0 + 0x5410c)
#9 0x00006fbb77163b99 n/a (libglib-2.0.so.0 + 0xa7b99)
#10 0x00006fbb7710d871 g_main_context_iteration (libglib-2.0.so.0 + 0x51871)
#11 0x00006fbb787acfd6 _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Core.so.5 + 0x311fd6)
#12 0x00006fbb78752d1c _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5 + 0x2b7d1c)
#13 0x00006fbb78567e12 _ZN7QThread4execEv (libQt5Core.so.5 + 0xcce12)
#14 0x00006fbb78568fef n/a (libQt5Core.so.5 + 0xcdfef)
#15 0x00006fbb78483259 start_thread (libpthread.so.0 + 0x9259)
#16 0x00006fbb780355e3 __clone (libc.so.6 + 0xfe5e3)

Stack trace of thread 1355509:
#0 0x00006fbb7803018d syscall (libc.so.6 + 0xf918d)
#1 0x00006fbb78569346 _ZN11QBasicMutex12lockInternalEv (libQt5Core.so.5 + 0xce346)
#2 0x000008fc0cb8619f n/a (polyphone + 0x19d19f)
#3 0x00006fbb787814ff _ZN7QObject5eventEP6QEvent (libQt5Core.so.5 + 0x2e64ff)
#4 0x00006fbb793cdd62 _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent (libQt5Widgets.so.5 + 0x15ad62)
#5 0x00006fbb787543aa _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent (libQt5Core.so.5 + 0x2b93aa)
#6 0x00006fbb787574a9 _ZN23QCoreApplicationPrivate16sendPostedEventsEP7QObjectiP11QThreadData (libQt5Core.so.5 + 0x2bc4a9)
#7 0x00006fbb787ad9a4 n/a (libQt5Core.so.5 + 0x3129a4)
#8 0x00006fbb7711010c g_main_context_dispatch (libglib-2.0.so.0 + 0x5410c)
#9 0x00006fbb77163b99 n/a (lib
```
Comment by David Runge (dvzrv) - Monday, 05 July 2021, 17:19 GMT
Building the latest commit from the upstream repository I don't get any crashes.
I assume that additional to the qt5 fixes something else was added that fixes the crash as well.

I have opened an upstream ticket in the hopes that a new release will fix this (although I'm still experiencing hard crashes upon exit): https://github.com/davy7125/polyphone/issues/144
Comment by edes (LudwigJ) - Tuesday, 06 July 2021, 00:20 GMT
Thanks for looking at this, David.
It's funny, I built from the sources in the 2.2 zip file, and it works perfectly here.
I only had to modify a bit the polyphone.pro file, and add a missing #include <QPainterPath> in editor/tree/treeitemdelegate.cpp to get it to build. But once it compiled, it works like a charm.
Comment by edes (LudwigJ) - Tuesday, 06 July 2021, 01:17 GMT
Well, works like a charm with one caveat: sound randomly stops, throwing these messages to the console:

Expression 'framesAvail' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 3629
Expression 'PaAlsaStreamComponent_GetAvailableFrames( self, &framesAvail, xrun )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 3989
Expression 'PaAlsaStreamComponent_RegisterChannels( &self->playback, &self->bufferProcessor, &playbackFrames, &xrun )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 4118
Expression 'PaAlsaStream_SetUpBuffers( stream, &framesGot, &xrun )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 4359

After restarting, sound returns. This is, I repeat, with a build from upstream sources 2.2.
FWIW, I'm not running Jack, just plain alsa.
Comment by nyanpasu64 (nyanpasu64) - Saturday, 23 October 2021, 04:29 GMT
Just pushed https://aur.archlinux.org/packages/polyphone-git/, which should avoid the file-open crashes (and when upstream releases a new stable version, this should hopefully be a reasonable template for updating the polyphone package).

I can't reproduce hard crashes on exit. However, when I start the program or change buffer settings, I get "ALSA lib pcm.c:8559:(snd_pcm_recover) underrun occurred" spam for random periods of time (briefly to several seconds), during which no audio plays (and I think Polyphone's audio thread fast-forwards). I think this is due to PortAudio's ALSA backend losing sync (I've seen the same thing in my own PortAudio ALSA app, but not RtAudio ALSA/PulseAudio apps). Either way it's not related to this bug.

Loading...