Bug 2473 - (int-76335) Ctrl-D or exiting shell in X terminal freezes terminals and busyloops
(int-76335)
: Ctrl-D or exiting shell in X terminal freezes terminals and busyloops
Status: RESOLVED FIXED
Product: Utilities
X Terminal
: 4.0
: All Linux
: Low normal with 2 votes (vote)
: 4.1
Assigned To: unassigned
: osso-xterm-bugs
:
:
:
:
  Show dependency tree
 
Reported: 2007-12-04 05:31 UTC by Austin Che
Modified: 2008-12-06 15:07 UTC (History)
5 users (show)

See Also:


Attachments
strace(1) of osso-xterm (31.10 KB, text/plain)
2008-03-24 18:24 UTC, Øyvind Aabling
Details
strace(1) of Xomap (212.81 KB, text/plain)
2008-03-24 18:25 UTC, Øyvind Aabling
Details
strace(1) of hildon-desktop (91.97 KB, text/plain)
2008-03-24 18:25 UTC, Øyvind Aabling
Details


Note

You need to log in before you can comment on or make changes to this bug.


Description Austin Che (reporter) 2007-12-04 05:31:28 UTC
STEPS TO REPRODUCE THE PROBLEM:
In X terminal, type Ctrl-D on bluetooth keyboard.

EXPECTED OUTCOME:
Ctrl-D should exit the shell and quit the X terminal.

ACTUAL OUTCOME:
The X terminal completely freezes. CPU goes up to 100% usage and the only thing
that can be done is to close the X terminal window.

REPRODUCIBILITY:
always
Comment 1 Austin Che (reporter) 2007-12-04 06:14:10 UTC
Actually, exiting the shell with 'exit' also has same freezing symptoms. It's a
problem with the X terminal and not the shell as exiting the shell in any other
case that doesn't involve the X terminal terminating works fine.
Comment 2 Jason Carter 2007-12-05 16:01:20 UTC
Which version of the firmware are you using?
Comment 3 Austin Che (reporter) 2007-12-05 16:23:27 UTC
the OS2008 firmware
(/etc/osso_software_version=RX-34+RX-44_2008SE_1.2007.44-4_PR_MR0) on N800
Comment 4 Marius Gedminas 2007-12-30 01:12:48 UTC
I see the same thing: exiting the shell doesn't close the terminal tab.  Fresh
OS2008 flash on a N800, built-in osso-xterm.
Comment 5 Marius Gedminas 2007-12-30 02:53:49 UTC
Extra info: osso-xterm is version 0.14.mh3, libvte4 is version 1:0.12.2-0mh4
here.

I see "ctrl-d problem fixed." in the subversion history for this branch
(https://garage.maemo.org/svn/osso-xterm/osso-xterm/tags/0.14.mh3).  Apparently
the fix doesn't work?
Comment 6 Neil MacLeod maemo.org 2007-12-30 14:37:03 UTC
(In reply to comment #4)
> I see the same thing: exiting the shell doesn't close the terminal tab.  Fresh
> OS2008 flash on a N800, built-in osso-xterm.
> 

I have opened bug 2678 for this issue which is most likely separate from this
"freezing" bug.
Comment 7 Marius Gedminas 2007-12-30 19:38:26 UTC
I think it's the same bug.  At least when I do it (I've got Ctrl-D as a toolbar
button), I cannot use any other xterm windows until I close the frozen one.
Comment 8 Neil MacLeod maemo.org 2007-12-30 21:14:42 UTC
(In reply to comment #7)
> I think it's the same bug.  At least when I do it (I've got Ctrl-D as a toolbar
> button), I cannot use any other xterm windows until I close the frozen one.
> 

Perhaps xterm is attempting to close the window when the session is terminated
but gets stuck in a CPU bound loop hence the "freezing"? :)

They're definately related issues, and perhaps they're one and the same issue
but I don't know for sure. I'd rather keep them as two distinct issues for now
until we can get further input from someone like Urho Konttori who seems to be
an active (and more importantly vocal/visible) maintainer.
Comment 9 Øyvind Aabling 2008-03-18 17:24:39 UTC
Problem also present on N810 with OS2008 2.2007.50-2
and built-in osso-xterm (0.14.mh3).

top(1) says:

Mem: 122608K used, 4220K free, 0K shrd, 4180K buff, 41208K cached
Load average: 1.17 0.48 0.30
  PID USER     STATUS   VSZ  PPID %CPU %MEM COMMAND
 1456 user     RW     33096  1022 39.4 26.0 maemo-launcher
  813 root     SW<    11128   350 33.0  8.7 Xomap
 1114 user     RW<    32684  1022 24.7 25.7 maemo-launcher
 1694 user     RW      1960  1510  1.1  1.5 top
  857 user     SW<     6520   350  0.5  5.1 matchbox-window
   81 root     SW<        0     6  0.5  0.0 OMAP McSPI/0
 1490 root     SW      5784   800  0.1  4.5 sshd
  415 root     SW<        0     6  0.1  0.0 cx3110x

According to ps(1), pid 1456 is really /usr/bin/osso-xterm,
and pid 1114 is really /usr/bin/hildon-desktop.
The closed shell (bash) that was running in the blank
xterm is gone as it should (verified with ps(1)).

In this state, it is still possible to start new xterm windows, but
the shell prompt doesn't appear (until the blank window is removed,
then it appears immed), and all other xterm windows are also "dead".

The blank window cannot be (un)maximized, but if there are
other (normal) xterm windows, they can be, and react to the
(un)maximize, even if the blank window is the active one.

After pressing 'X' (on window or home button menu), the
blank window disappears, and then the only processes to use
any CPU are top, sshd and cx3110x (top running on remote
PC xterm via ssh), and everything is back to normal.
Comment 10 Øyvind Aabling 2008-03-24 18:24:44 UTC
Created an attachment (id=739) [details]
strace(1) of osso-xterm
Comment 11 Øyvind Aabling 2008-03-24 18:25:11 UTC
Created an attachment (id=740) [details]
strace(1) of Xomap
Comment 12 Øyvind Aabling 2008-03-24 18:25:35 UTC
Created an attachment (id=741) [details]
strace(1) of hildon-desktop
Comment 13 Øyvind Aabling 2008-03-24 18:30:41 UTC
I've run strace(1) on osso-xterm, Xomap and hildon-desktop, see attachments.

It looks like the problem is (mainly/only ?) between osso-xterm and Xomap:

While in the endless loop, osso-xterm only does read(), write() and
ioctl() of FD 3, which is a socket to Xomap's /tmp/.X11-unix/X0.

I've added a few notes to the strace outputs, marking
the various events: Pressing Ctrl-D, xterm looping,
pressing 'X' to get rid of the window, window gone.
Comment 14 Andre Klapper maemo.org 2008-05-30 17:29:31 UTC
We are happy to tell that using "control+d" or typing "exit" in the terminal
application will now close the window. This fix will be included in the
upcoming Diablo (4.1) release.

Can somebody please test this again running Diablo (it will be released soon)
and report back if (s)he can still reproduce the problem of freezing?
Thanks a lot in advance!
Comment 15 Andre Klapper maemo.org 2008-06-04 11:23:19 UTC
Closing as fixed, please do reopen if you still run into problems with Diablo
(4.1). Thanks!