[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: (longish) tcsh should be removed from hamm



Steve Dunham <dunham@cps.msu.edu> writes:
>Hamish Moffatt <hamish@debian.org> writes:
>> Strange. It's the default shell on the Solaris box at uni (and has
>> been for years) and I don't think this has ever caused much of a problem.
>> Actually, we have a newer version there than on Debian, because our
>> system admin has added some new features -- but these have been
>> contributed upstream too I'm told, so ours may be out of date.
>
>> I run it as my shell on all my accounts and I've never noticed this.
>
>I've noticed it on Linux boxes but not on Solaris.
>
>It has something to do with dead/stale connections, but it hasn't
>happened frequently enough for me to nail it down.

I've been doing a bit of experimenting with it, and I think I at least
have nailed down when it happens (and thus how to tickle it). tcsh
doesn't seem to like not being able to write to stdout. I've been able
to reproduce the bug successfully with putting an echo into my ~/.logout,
starting an xterm -ls, and then kill -9 the xterm. Here is a commented
strace:

--- SIGHUP (Hangup) ---
sigprocmask(SIG_BLOCK, [HUP], [HUP])    = 0

    xterm goes away...
    the shell then proceedes to read .logout, run some other commands,
    and eventually gets here, my echo...

alarm(0)                                = 0
sigprocmask(SIG_BLOCK, [INT], [HUP])    = 0
close(0)                                = -1 EBADF (Bad file descriptor)
dup(19)                                 = 0
fcntl(0, F_SETFD, 0)                    = 0
close(1)                                = -1 EBADF (Bad file descriptor)
dup(17)                                 = 1
fcntl(1, F_SETFD, 0)                    = 0
close(2)                                = -1 EBADF (Bad file descriptor)
dup(18)                                 = 2
fcntl(2, F_SETFD, 0)                    = 0
sigprocmask(SIG_BLOCK, [], [HUP INT])   = 0
sigprocmask(SIG_SETMASK, [HUP], [HUP INT]) = 0
write(1, "*wave*\n", 7)                 = -1 EIO (Input/output error)

    Now, you can't write to a pseudo-tty that noone listens to... So
    the echo fails. (And thus my .logout fails, apparently...)

lseek(3, 0, SEEK_END)                   = 36
ioctl(15, TIOCSPGRP, [6877])            = -1 ENOTTY (Inappropriate ioctl for device)
sigprocmask(SIG_BLOCK, [], [HUP])       = 0
sigprocmask(SIG_SETMASK, [HUP], [HUP])  = 0
sigprocmask(SIG_SETMASK, [HUP], [HUP])  = 0
close(3)                                = 0
lseek(16, 0, SEEK_END)                  = -1 ESPIPE (Illegal seek)
ioctl(15, TIOCSPGRP, [6877])            = -1 ENOTTY (Inappropriate ioctl for device)
sigprocmask(SIG_BLOCK, [], [HUP])       = 0
sigprocmask(SIG_SETMASK, [HUP], [HUP])  = 0
close(0)                                = 0
...
close(14)                               = -1 EBADF (Bad file descriptor)
close(20)                               = -1 EBADF (Bad file descriptor)
...
close(255)                              = -1 EBADF (Bad file descriptor)
sigprocmask(SIG_BLOCK, [], [HUP])       = 0
sigprocmask(SIG_SETMASK, [HUP], [HUP])  = 0
time([891370584])                       = 891370584
stat("/home/Staff/iko/Mail/drafts/.", {st_mode=0, st_size=0, ...}) = 0
stat("/home/Staff/iko/Mail/inbox/.", {st_mode=0, st_size=0, ...}) = 0
stat("/home/Staff/iko/Mail/linux/.", {st_mode=0, st_size=0, ...}) = 0
stat("/home/Staff/iko/Mail/misc/.", {st_mode=0, st_size=0, ...}) = 0
stat("/home/Staff/iko/Mail/news/.", {st_mode=0, st_size=0, ...}) = 0
stat("/home/Staff/iko/Mail/save/.", {st_mode=0, st_size=0, ...}) = 0
sigprocmask(SIG_BLOCK, [INT], [HUP])    = 0
time([891370584])                       = 891370584
stat("/var/run/utmp", {st_mode=0, st_size=0, ...}) = 0
sigprocmask(SIG_SETMASK, [HUP], [HUP INT]) = 0
sigprocmask(SIG_BLOCK, [INT], [HUP])    = 0
time([891370584])                       = 891370584
sigprocmask(SIG_SETMASK, [HUP], [HUP INT]) = 0
sigprocmask(SIG_BLOCK, [INT], [HUP])    = 0
sigprocmask(SIG_SETMASK, [HUP], [HUP INT]) = 0
sigprocmask(SIG_BLOCK, [INT], [HUP])    = 0
sigprocmask(SIG_SETMASK, [HUP], [HUP INT]) = 0
time(NULL)                              = 891370584
alarm(0)                                = 0
write(17, "\33[4miko\33[m@valdez:ttypd[\33["..., 40) = -1 EIO (Input/output error)

    For here it tries to write a prompt(!) which of course fails, so
    what to do? Well, let's try again...

lseek(16, 0, SEEK_END)                  = -1 ESPIPE (Illegal seek)
ioctl(15, TIOCSPGRP, [6877])            = -1 ENOTTY (Inappropriate ioctl for device)
sigprocmask(SIG_BLOCK, [], [HUP])       = 0
sigprocmask(SIG_SETMASK, [HUP], [HUP])  = 0
close(0)                                = -1 EBADF (Bad file descriptor)
...
close(14)                               = -1 EBADF (Bad file descriptor)
close(20)                               = -1 EBADF (Bad file descriptor)
...
close(255)                              = -1 EBADF (Bad file descriptor)
sigprocmask(SIG_BLOCK, [], [HUP])       = 0
sigprocmask(SIG_SETMASK, [HUP], [HUP])  = 0
time([891370585])                       = 891370585
sigprocmask(SIG_BLOCK, [INT], [HUP])    = 0
time([891370585])                       = 891370585
stat("/var/run/utmp", {st_mode=0, st_size=0, ...}) = 0
sigprocmask(SIG_SETMASK, [HUP], [HUP INT]) = 0
sigprocmask(SIG_BLOCK, [INT], [HUP])    = 0
time([891370585])                       = 891370585
sigprocmask(SIG_SETMASK, [HUP], [HUP INT]) = 0
sigprocmask(SIG_BLOCK, [INT], [HUP])    = 0
sigprocmask(SIG_SETMASK, [HUP], [HUP INT]) = 0
sigprocmask(SIG_BLOCK, [INT], [HUP])    = 0
sigprocmask(SIG_SETMASK, [HUP], [HUP INT]) = 0
time(NULL)                              = 891370585
alarm(0)                                = 0
write(17, "\33[4miko\33[m@valdez:ttypd[\33["..., 40) = -1 EIO (Input/output error)
lseek(16, 0, SEEK_END)                  = -1 ESPIPE (Illegal seek)
ioctl(15, TIOCSPGRP, [6877])            = -1 ENOTTY (Inappropriate ioctl for device)
sigprocmask(SIG_BLOCK, [], [HUP])       = 0
sigprocmask(SIG_SETMASK, [HUP], [HUP])  = 0
close(0)                                = -1 EBADF (Bad file descriptor)

And like this it continues...

Regards,
/Anders

-- 
 -- Of course I'm crazy, but that doesn't mean I'm wrong.
Anders Hammarquist   |       Mud at Kingdoms        | iko@netg.se
NetGuide Scandinavia |   telnet kingdoms.se 1812    | Fax: +46 31 50 79 39
http://www.netg.se   |                              | Tel: +46 31 50 79 40


--
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: