Summary: | zsh crash in dolphin (konsole part) leads to all processes in X getting killed | ||
---|---|---|---|
Product: | [Applications] konsole | Reporter: | aditsu <aditsu> |
Component: | kpart | Assignee: | Konsole Developer <konsole-devel> |
Status: | VERIFIED FIXED | ||
Severity: | normal | CC: | 0inkane, adaptee, dilfridge, peter.penz19 |
Priority: | NOR | ||
Version: | 2.7.3 | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: |
The drkonqi backtrace
The emerging window with the error message. |
Description
aditsu
2011-11-11 20:53:34 UTC
Interesting and mysterious. I do not see how zsh might crash due to konsole kpart and how that crash can cause that serious damage. So is that zsh a login zsh(run as zsh -l) or a non-login zsh? And, if all customized configuration of zsh(for example, ~/.zprofile and ~/.zshrc) are removed, does the crash still happen? And, does the crash also happen in standalone konsole ? Does it happen in other KDE apps which embed konsole kpart, such as kate and okteta? Hi, if you think this is not about konsole, feel free to modify it. I didn't know where else to file it. I'm not sure about the login vs non-login zsh, it's just my shell (set with chsh to /bin/zsh). Anyway, I pressed F4 in dolphin and then ran "ps -p $$ -o cmd", it printed "/bin/zsh". I'm not very eager to test this actively, since it is quite disruptive, but I'll try to find some time for it. The crash never happened in the standalone konsole. I've never seen konsole embedded in apps other than dolphin; I don't have kate, but I can install it or check in okteta. I can reproduce this bug on Chakra Linux with KDE 4.7.4 quite reliably when opening a folder by clicking on a it in the folder view plasmoid. I also got some Kate crashes.zsh is my login shell. (In reply to comment #3) > I can reproduce this bug on Chakra Linux with KDE 4.7.4 quite reliably when > opening a folder by clicking on a it in the folder view plasmoid. I also got > some Kate crashes.zsh is my login shell. Thanks for your information, although I can't reproduce the crash either. Since you can reproduce the crash quite reliably when opening folder from the folder view plasmoid, could you post the backtrace(of dolphin) when it happens next time? That would help to see whether the crash happens in konsolepart or other components. And could you give one by one steps for the kate crash? I have some problems getting the backtrace. I've attached the backtrace from drkonqi, but I think that it doesn't trace the the initial error. I might have some useful information, though: I have that autocd feature enabled (when you click on a folder, it does cd to its location). Furthermore, when I get the red error message, kde does not crash immediately. In fact, if I close the window or just the konsole kpart, everything keeps working. However, when I do any other action like opening a file, I get a crash. Sometimes it crashes instantly and I'm back at the kdm login screen, sometimes only plasma-desktop crashes and a window emerges, claiming "Could not start ksmserver. Check you installation." If I click on OK, I'll get the crash, else it doesn't crash and I can even restart kwin. Unfortunately, I have not found a pattern which circumstances lead to a kate crash. Created attachment 68063 [details]
The drkonqi backtrace
Created attachment 68064 [details]
The emerging window with the error message.
(In reply to comment #5 and comment #7) Hi Fabian, thanks for your feedback. Now I can reproduce the problem and get the error message as shown in comment #7 from startkde: "Could not start ksmserver. Check your installation." Here is the steps for reproducing: 1. open dolphin and show the terminal panel 2. find some way to crash the zsh running in the terminal panel, so that konsolepart display the warning messaged in red: "Warning: Program 'zsh' crashed." 3. click some folder in dolphin so that it sends "cd /path/to/some/folder" into the terminal panel where zsh has just crashed. 4. Both plasma-desktop and kwin are killed, only leaving the error message "Could not start ksmserver. Check your installation." from startkde in the screen. The tricky step is how to make zsh crash. My method of crashing zsh is quite complex and seems highly dependent upon my various customized settings :(. Although I'm still confused by its disastrous damage, there is clearly a problem in the code of konsolepart: it does not check whether the underlying program(zsh in this case) is still available before sending input into it. Well, I get some clue for the disastrous damage. It is in the code of terminal panel of dolphin. void TerminalPanel::sendCdToTerminal(const QString& dir) { if (!m_clearTerminal) { // The TerminalV2 interface does not provide a way to delete the // current line before sending a new input. This is mandatory, // otherwise sending a 'cd x' to a existing 'rm -rf *' might // result in data loss. As workaround SIGINT is send. kill(m_terminal->terminalProcessId(), SIGINT); } ... } When zsh crashes, 'm_terminal->terminalProcessId()' returns 0 since that is what QProcess::pid() returns in that situation. So that line becomes 'kill(0, SIGINT)' and it causes big problem. @Peter: I think this is firstly a problem of konsolepart. But I currently have no clear idea about what konsole and konsolepart should do and return in this case. Could you add some safeguard for pid being 0 ? Thanks Jekyll for finding out what goes wrong here. Of course I'll add a check regarding the "PID is 0" and will push the patch during this week. Git commit 7dfe3632f52d30f79f1c21c9acbaf68c05d63006 by Peter Penz. Committed on 25/01/2012 at 15:18. Pushed by ppenz into branch 'KDE/4.8'. Terminal: only consider process IDs > 0 Thanks to Jekyll Wu for the analyses. M +4 -1 dolphin/src/panels/terminal/terminalpanel.cpp http://commits.kde.org/kde-baseapps/7dfe3632f52d30f79f1c21c9acbaf68c05d63006 Git commit f68956e63c93c7d6eac20e1cc9557a59e14f9502 by Peter Penz. Committed on 25/01/2012 at 15:18. Pushed by ppenz into branch 'master'. Terminal: only consider process IDs > 0 Thanks to Jekyll Wu for the analyses. M +4 -1 dolphin/src/panels/terminal/terminalpanel.cpp http://commits.kde.org/kde-baseapps/f68956e63c93c7d6eac20e1cc9557a59e14f9502 Just got a zsh crash in dolphin (first one in a long time) and everything else keeps working normally. kde 4.8.3 |