Summary: | KAlarm crashes during notification test when volume override is activated | ||
---|---|---|---|
Product: | [Applications] kalarm | Reporter: | Herman Tafintsev <germanapps> |
Component: | sound | Assignee: | David Jarvie <djarvie> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | djarvie, myriam, pallaswept, romain.perier, sitter, x123456789fy |
Priority: | NOR | Keywords: | drkonqi |
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Neon | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/pim/kalarm/-/commit/dd4bab1a3642c0ec860ffada450d4d41dd85080f | Version Fixed In: | 24.02.1 |
Sentry Crash Report: |
Description
Herman Tafintsev
2024-02-14 19:08:23 UTC
The crash is in the Pulse Audio libraries. When I try it on my Debian Bookworm system, it doesn't crash. Does this crash depend on which audio file you select? If so, please attach the file (or say which system file it is). Please confirm that you select "New Audio Alarm" to create the alarm. > Please confirm that you select "New Audio Alarm" to create the alarm. Yes, i use audio alarm. > Does this crash depend on which audio file you select? If so, please attach the file (or say which system file it is). It does not matter which file format i choose. I tried wav, ogg, opus, mp3 -- all of them lead to the same result. However, this crash is not as consistent, as i initially thought. I have tested several scenarios. Scenario 1: Editing existing alarm, which has ogg file chosen. - Volume override is set and volume slider is left untouched. - "Try" button pressed. Outcome: Consistent crash. Scenario 2: Editing existing alarm, which has wav file chose. Steps - Volume override is set, but its volume slider is left untouched. - "Try" button pressed. Outcome: Consistent crash. Scenario 3: Editing existing alarm, which has wav file chosen. Steps - New ogg file chosen. - "Try" button pressed. Outcome: Consistent crash. Scenario 4: Editing existing alarm, which has ogg file chosen. - New wav file chosen. - Volume override is set, but its volume slider is left untouched. - "Try" button pressed. Outcome: First test works fine, but repeating it crashes the app consistently. Scenario 5: Editing existing alarm, which has ogg file chosen. - New long mp3 file chosen. - Volume override is set, but its volume slider is left untouched. - "Try" button pressed. - After a few seconds "test" button pressed again to stop the test. - "Try" button pressed again to start the next test. Outcome: Consistent crash. Scenario 6: Editing existing alarm, which has wav file chosen. - Volume override is set to 50% - Alarm saved and reopened for editing. - "Try" button pressed. Outcome: Consistent crash. Scenario 7: Same as scenario 6, but locale is set to "C". Outcome: Consistent crash. The only thing that i noticed is that error is the same (got this when i ran kalarm in konsole): "Assertion 'c->state == PA_CONTEXT_CONNECTING' failed at ../src/pulse/context.c:917, function on_connection(). Aborting." I am 100% sure that: 1. My sound system is works fine (i hear sounds, i didn't change pulseaudio settings much) 2. My sound files are not corrupted -- i can play them in KAlarm. So i am sure the problem is on KAlarm's side. I have no idea how else i can test this app. I have no idea where to get sources for this app version and whether i can compile and test it using QtCreator. I have now managed to reproduce the crash sometimes. Have you ever seen it crash when the volume override is NOT set? I don't know whether KAlarm can be built using QtCreator. The build uses cmake (not qmake). One way of building it is using a KDE Neon developer's edition which contains all (or most of) the developer versions of the KDE, Qt and other libraries needed to build KDE applications including KAlarm. In Neon, the KDE package kdesrc-build can be used to do the build. The crash occurs in Phonon::MediaObject::play(). (This isn't evident from the stack trace, but I've established this using debug statements.) I've seen the same crash (and error message) both when the volume override is used, and when the volume is not set. There have been other crashes in Phonon::MediaObject::play(), which output the following various messages on the terminal. The audio file in every case was the same one (Oxygen-Im-Error-On-Connection.ogg). Assertion 'c->state == PA_CONTEXT_CONNECTING' failed at ../src/pulse/context.c:917, function on_connection(). Aborting. Assertion 'io->ifd >= 0' failed at ../src/pulsecore/iochannel.c:287, function pa_iochannel_creds_supported(). Aborting. ERROR:../src/pulse/glib-mainloop.c:394:glib_defer_enable: assertion failed: (!e->dead) Bail out! ERROR:../src/pulse/glib-mainloop.c:394:glib_defer_enable: assertion failed: (!e->dead) Because all these crashes occur in system libraries, I think the bug must lie in a library, so I'm transferring this bug report to the highest level library involved, i.e. Phonon. The crashes and error messages which I have reported in comment 4 were all on KDE Neon running a nearly up to date Qt6/KF6 system. The Phonon package versions for Qt6 are: libphonon4qt6-dev 4:4.12.0+p22.04+vunstable+git20240123.0113-0 phonon4qt6-backend-vlc 0.12.0+p22.04+vunstable+git20240123.0141-0 qt6-phonon 4:4.12.0+p22.04+vunstable+git20240123.0113-0 qt6-phonon-backend-vlc 0.12.0+p22.04+vunstable+git20240123.0141-0 qt6-phonon-dev 4:4.12.0+p22.04+vunstable+git20240123.0113-0 Kalarm should really use libcanberra. As for the bug, I believe this happens due to the threading kalarm forces onto phonon (phonon is very much not thread safe). You really don't need threading here. As far as I can see, libcanberra can only play from a preset selection of event sounds, and not what KAlarm requires, which is to be able to play any audio file which the user selects. The fact that Phonon is not thread safe might explain why there have always been bug reports about KAlarm audio alarms. This needs investigation. Thank you Harald. Phonon has now been replaced with libcanberra for playing sound files in the thread. This should fix the crash. This fix will be in KAlarm version 3.7.1, which will be released in KDE Gear 24.02.1 (commit dd4bab1a3642c0ec860ffada450d4d41dd85080f). Unfortunately, because the final Qt5 based KDE Gear release (23.08.5) has now been issued, this fix will not be available for Qt5 based versions of KAlarm. *** Bug 480874 has been marked as a duplicate of this bug. *** *** Bug 480789 has been marked as a duplicate of this bug. *** |