screen's 'power detach' (ctrl+a DD) causes Warning: Program '/bin/bash' crashed error, and bash does indeed crash

Bug #254943 reported by bascule
2
Affects Status Importance Assigned to Milestone
KDE Base
Unknown
Medium
kdebase (Ubuntu)
Invalid
Low
Unassigned

Bug Description

I think the summary tells the whole story, this does not happen in any other X terminal emulator, so I am sure it is konsole-kde4 and not screen. To recreate this bug, open a kde4 konsole run screen, then apply the key combination ctrl+a DD (this invokes screen's power detach function) and the error will appear, the tab is then useless. However the screen session does successfully detach so there is no data loss, even within bash sub-shells, i.e. running bash within bash and starting screen on that shell.

This only affects bash; zsh,csh and ksh all function correctly on a power detach.

Revision history for this message
Harald Sitter (apachelogger) wrote :

Seems to be working for me.

What version of KDE are you using?

Changed in kdebase-kde4:
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
bascule (kennym-safe-mail) wrote :

I forgot the most basic thing :) I am using kubuntu 8.04 with KDE4.1 from the ppa launchpad packages.

kdebase-bin-kde4:
  Installed: 4:4.1.0-0ubuntu1~hardy1~ppa2
  Candidate: 4:4.1.0-0ubuntu1~hardy1~ppa2
  Version table:
 *** 4:4.1.0-0ubuntu1~hardy1~ppa2 0
        500 http://ppa.launchpad.net hardy/main Packages
        100 /var/lib/dpkg/status
     4:4.0.5-0ubuntu1~hardy1 0
        500 http://ubuntu.intergenia.de hardy-backports/main Packages
     4:4.0.3-0ubuntu2 0
        500 http://ubuntu.intergenia.de hardy/universe Packages

To add some more detail, it is fine from remote logins (as far as I can tell) There is no crash, nicely logs out on the DD as expected. I have supplied a screenshot.

Revision history for this message
Harald Sitter (apachelogger) wrote :

Please forward this report to http://bugs.kde.org and post it's URL here.

Thank you.

Changed in kdebase-kde4:
status: Incomplete → Confirmed
Revision history for this message
bascule (kennym-safe-mail) wrote :
Revision history for this message
In , bascule (kennym-safe-mail) wrote :

Version: 2.1 (using KDE 4.1.0)
Installed from: Ubuntu Packages
OS: Linux

Running KDE4.1 on kubuntu 8.04 from the ppa packages.

To recreate this bug, open a kde4 konsole run screen, then apply the key combination ctrl+a DD (this invokes screen's power detach function) and the error will appear, the tab is then useless. However the screen session does successfully detach so there is no data loss, even within bash sub-shells, i.e. running bash within bash and starting screen on that shell.
This only affects bash; zsh,csh and ksh all function correctly on a power detach.

Logged into a remote machine is not a problem, the session logs out as expected, but on local sessions bash always crashes.

see also launchpad bug:

https://bugs.launchpad.net/ubuntu/+source/kdebase-kde4/+bug/254943
(screenshot attatchment on the launchpad report)

Changed in kdebase:
status: Unknown → New
Revision history for this message
In , Kurt Hindenburg (kurt-hindenburg) wrote :

Confirmed on trunk

[power detached]
Screen session of $LOGNAME $:cr:$:nl:ended.

Warning: Program '/bin/bash' crashed.

From some searches on the web:
---
  - Command: pow_detach
      (`C-a D D')
      Mainly the same as `detach', but also sends a HANGUP signal to the
      parent process of `screen'.
      _Caution_: This will result in a logout if `screen' was started
      from your login shell.
---
In a power detach (C-a D D), the screen session is detached and the user is logged out of the calling shell.

Changed in kdebase:
status: New → Confirmed
Revision history for this message
Jonathan Thomas (echidnaman) wrote :

KDE4 stuff lives in their normal packages in Intrepid, so moving to kdebase.

Changed in kdebase:
status: Confirmed → Triaged
Revision history for this message
In , FiNeX (finex) wrote :

Changed severity to "crash". I hope to have selected only the right bugs (>100) :-)

Revision history for this message
Jonathan Thomas (echidnaman) wrote :

Hi there!

Thanks for reporting this bug! Your bug seems to be a problem with the KDE program itself, and not with our KDE packages. But don't worry! This issue is being tracked by the KDE developers at: http://bugs.kde.org/show_bug.cgi?id=168539
Once fixed in KDE, it will be included in Kubuntu once the KDE version the fix is in in reaches Kubuntu.

Thanks!

Changed in kdebase (Ubuntu):
status: Triaged → Invalid
Revision history for this message
In , bugfoot (tobimensch) wrote :

This Bug/Crash is still valid in KDE4.4.0.

Revision history for this message
In , Marcel Partap (empee584) wrote :

...and it of course also occurs in yakuake which embeds konsole kparts...
> [remote power detached]
> Screen session of $LOGNAME $:cr:$:nl:ended.
> Could not write /var/run/utmp: No such process
>
> Warning: Program '/bin/bash' crashed.
...Is this "irrelevant" piece of KDE maintained by anyone?...

Revision history for this message
In , Shlomi Fish (shlomif-gmail) wrote :

I can reproduce this problem but it is not konsole-specific as it also happens with xterm and gnome-terminal - and they both close the tab/window. Seems like a bash bug.

(Mandriva Cooker / Pentium 4)

Revision history for this message
In , Shlomi Fish (shlomif-gmail) wrote :

(In reply to comment #5)
> I can reproduce this problem but it is not konsole-specific as it also happens
> with xterm and gnome-terminal - and they both close the tab/window. Seems like
> a bash bug.
>
> (Mandriva Cooker / Pentium 4)

Shouldn't this bug be closed?

Revision history for this message
In , B-kde-bugs-3 (b-kde-bugs-3) wrote :

i created a test script run this from your konsole
#!/bin/bash
kill -HUP $PPID

ok first thing firs SIGHUP is a signal that modems used to send(when looing connecion)
many applications do this also for the same purpose(sshd,screen, screenwrappers)
if the shell receives SIGHUP it will exit(nothing crashes afaik)(it will return 129 (128 + 1(hup) ,maybe this is what make konsole notify me)

for some reason konsole sees this as a crash of bash

as a final note:
this is just gesswork experianced when wrapping screen (i must trap and forward sighup to kill the last shell(yes i have to manny)
i have never looked in the code of konsole or bash

Revision history for this message
In , Marcel Partap (empee584) wrote :

Rejoice, oh plagued ones! Honestly think this has been fixed as it can't be reproduced since a while...

Revision history for this message
In , B-kde-bugs-3 (b-kde-bugs-3) wrote :

hi i have a sipmle patch could somebody fix and commit for me?

see: https://projects.kde.org/projects/kde/kdebase/konsole/repository/revisions/master/entry/src/Session.cpp#L777

org
---8<----
  if (!_wantedClose || exitStatus != 0)
  {
    if (_shellProcess->exitStatus() == QProcess::NormalExit)
        message = i18n("Program '%1' exited with status %2.", _program, _shellProcess->exitStatus());
    elseif (_shellProcess->exitStatus() > 127)
        message = i18n("Program '%1' receved signal '%2', _program, convertToSignalName(exitStatus-128);
        //according to man bash
    else
        message = i18n("Program '%1' crashed.", _program);

    //FIXME: See comments in Session::monitorTimerDone()
    KNotification::event("Finished", message , QPixmap(),
                         QApplication::activeWindow(),
                         KNotification::CloseWhenWidgetActivated);
  }
  if ( !_wantedClose && _shellProcess->exitStatus() != QProcess::NormalExit && _shellProcess->exitStatus() !> 127)
      terminalWarning(message);
  else
        emit finished();
}
--->8---
ok convertToSignalName() is a non exisitant function but should do the same as kill -l $num
i am unsure if i need to use _shellProcess->exitStatus() or exitStatus

b.t.w. i have verified (see link) that konsole source is the problem of this message and my previus message is true

Changed in kdebase:
importance: Unknown → High
Revision history for this message
In , 3-dedel-2 (3-dedel-2) wrote :

Confirmed for konsole 2.5.4 in KDE 4.5.5 on Fedora 13 x86 and on Fedora 14 x86_64.
It is not screen specific, just type
kill -HUP $$
at a Bash prompt in console and the session crashes.
Xterm and gnome-terminal just close the current tab/session with exitcode 0.

Revision history for this message
In , B-kde-bugs-3 (b-kde-bugs-3) wrote :

is there not a sigele kde programmer here ?

(look at my previus comment)

Revision history for this message
In , adaptee (adaptee) wrote :

The reason why konsole think bash has crashed is not hard to figure out. If you invoke bash from zsh then kill bash with SIGHUP, running 'echo $?' from zsh will print 129. When bash is killed like that in konsole, konsole will get 2 related
information about bash: exitCode is 0, and exitStatus is 1(actually, QProcess::CrashExit). That QProcess::CrashExit will make konsole believe bash has crashed, as its name implies.

The hard question is should konsole add extra code to deal with this case? .

Revision history for this message
In , adaptee (adaptee) wrote :

*** Bug 249546 has been marked as a duplicate of this bug. ***

Revision history for this message
In , B-kde-bugs-3 (b-kde-bugs-3) wrote :

a message telling me a program has crashed when it is not is a bug

 think the console(-tab?) should be closed(like ^d) or there should be a notification telling me what happens
hanks

Changed in kde-baseapps:
importance: High → Medium
Revision history for this message
In , Adrián Chaves (gallaecio) wrote :

Any news regarding this?

Michel, you should use the ReviewBoard for patches: https://git.reviewboard.kde.org/

Changed in kde-baseapps:
status: Confirmed → Unknown
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.