Bug 306430

Summary: KNotify crashes after using 360% CPU - according to "top"
Product: [Unmaintained] phonon-backend-gstreamer Reporter: Andrei ILIE <andrei.ilie>
Component: generalAssignee: Harald Sitter <sitter>
Status: RESOLVED NOT A BUG    
Severity: critical CC: cfeck, myriam, romain.perier, tdfischer
Priority: NOR    
Version: 4.6.2   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: empty
global shortcut plays a sound
knotify eating 360% CPU
The big Backtrace - contains over 500 Threads

Description Andrei ILIE 2012-09-07 23:58:28 UTC
Application: knotify4 (4.0)
KDE Platform Version: 4.8.5 (4.8.5)
Qt Version: 4.8.2
Operating System: Linux 3.5.3-1.fc17.x86_64 x86_64
Distribution (Platform): Fedora RPMs

Reproducible: Always

Steps to Reproduce:
1. I set up a sound to be played whenever a global keyboard shortcut gets pressed; please see the first attachment.

2. I kept Ctrl+F1 (goto vDesktop 1) shortcut pressed for a few seconds; as a cosequence of this, the process of knotify ate aprox 360% of the CPU; please see the second attachment.

3. After a few seconds of this abuse, knotify simply seg-faulted...




Attached you find the Backtrace, as it was longer that 65000 characters and couldn't be directly posted here.
Comment 1 Andrei ILIE 2012-09-07 23:59:10 UTC
Created attachment 73733 [details]
empty
Comment 2 Andrei ILIE 2012-09-08 00:00:43 UTC
Created attachment 73734 [details]
global shortcut plays a sound
Comment 3 Andrei ILIE 2012-09-08 00:01:26 UTC
Created attachment 73735 [details]
knotify eating 360% CPU
Comment 4 Andrei ILIE 2012-09-08 00:17:18 UTC
These bugs seem related to the current report:
   Bug 197315 - knotify4 slows down when flooding with messages 
   Bug 195691 - Knotify can easily get flooded up to 800MB and more by remote.... 
   Bug 142438 - should have flood prevention
Comment 5 Andrei ILIE 2012-09-08 00:22:48 UTC
Created attachment 73736 [details]
The big Backtrace - contains over 500 Threads
Comment 6 Andrei ILIE 2012-09-08 01:33:39 UTC
A possible solution: Knotify should STOP collecting and start dropping notifications requests from PID xyz, if that PID has too many (eg 100) not settled notification requests.

That should be a simple anti flooding mechanism...
Comment 7 Christoph Feck 2012-09-08 10:03:39 UTC
The crash is a phonon/gstreamer issue. Please try newest phonon with different backends (e.g. phonon-vlc backend).
Comment 8 Andrei ILIE 2012-09-08 17:00:11 UTC
<rocks> phonon --> phonon-backend-vlc v0.6.0 --> ALSA
                 ~ excellent audio quality
                 ~ low CPU

<works> phonon --> phonon-backend-gstreamer v4.6.2 --> pulseaudio v1.1 --> ALSA
                 ~ good audio quality
                 ~ high CPU

<sucks> phonon --> phonon-backend-gstreamer v4.6.2 --> ALSA
                 ~ poor audio quality
                 ~ crashes knotify
                 ~ extremely high CPU

Now I have a millon dollars question: why "phonon-backend-vlc" (the best phonon backend) is not in the __official__ Fedora Repos ?! I had tu use rpmfusion to install it...
Comment 9 Christoph Feck 2012-09-08 17:09:55 UTC
Because of software patents.
Comment 10 Harald Sitter 2012-09-08 17:14:29 UTC
Hum, only 4.6.2 without PA causes the crash? Because then the backtrace seems wrong... unless something in gstreamer's alsa output is memleaking/corrupting as clearly something went astray with malloc there.
Comment 11 Andrei ILIE 2012-09-08 17:23:24 UTC
@Christoph: Ok, I understand that VLC includes some patents and cannot be included in the official Fedora repos, but I wasn't talking about VLC, I was talking about phonon-backend-vlc wich is merely a middleware and is free of patents. Isn't it ?
Comment 12 Andrei ILIE 2012-09-09 16:20:22 UTC
I switched to phonon-backend-vlc, btw :)