Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jun 1998 12:17:45 +0930
From:      Greg Lehey <grog@lemis.com>
To:        Doug Lo <jwlo@ms11.hinet.net>
Cc:        spork <spork@super-g.com>, freebsd-questions@FreeBSD.ORG
Subject:   Re: HELP! "who" hangs system.
Message-ID:  <19980623121745.A27719@freebie.lemis.com>
In-Reply-To: <358C78E8.4AEEA6B7@ms11.hinet.net>; from Doug Lo on Sun, Jun 21, 1998 at 11:07:20AM %2B0800
References:  <Pine.BSF.3.96.980618025146.21295B-100000@super-g.inch.com> <3588CD5A.51BED253@ms11.hinet.net> <19980618183245.36149@papillon.lemis.com> <358C78E8.4AEEA6B7@ms11.hinet.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 21 June 1998 at 11:07:20 +0800, Doug Lo wrote:
> Greg Lehey wrote:
>
>> On Thu, 18 June 1998 at 16:18:35 +0800, Doug Lo wrote:
>>> spork wrote:
>>>
>>>> Is the system totally hung, or is it just the terminal in which you're
>>>> running 'who'?
>>>
>>> The system is totally hung, I should press "Ctrl-C" to interrupt. :-(
>>
>> You can't get out of a hung system, or even a hung terminal, with ^C.
>> This is just a hung program.
>
> Thanks for the reply. But I have a question what you said:"This is just a hung
> program".
> Would you explain more details, what's a 'humg' program?
> You mean I can't press ^C to terminate the 'who'?

I thought you said you *could* press ^C and terminate the 'who'
process.

Let's get some terminology straight: UNIX is an operating system.  It
consists of a kernel and user programs.  The kernel is started when
you boot and controls execution of programs.  When you start a
program, you create what is called a process.  A process is an
instance of a running program.  You can start the same program more
than once, in which case you have more than one process, but only one
program.  Thus, strictly speaking, you can't stop a program, only a
process.

The kernel runs in a privileged, protected mode.  Ideally, there's no
way to stop it except to shut down the system.  In practice, it's also
possible (though difficult) to either stop it executing with a panic
(a situation in which the kernel finds it can't continue) or a hang (a
situation in which the kernel doesn't continue).  Most kernel hangs
are only partial: processes waiting on particular resources can't
continue, and you may not be able to stop them.  In this case, you
need to reboot, with a shutdown if you can still get a reaction from a
virtual terminal, or forcibly via the reset button if not.  All such
situations represent some kind of bug, though it's not really clear
that it's a kernel bug if the system hangs because you can't access
the (failed) system disk.

If a process doesn't react, on the other hand, this is not necessarily
a bug.  In the case I think you were talking about, it may have been
waiting for some event which would never happen.  In this case, it
should still continue if you send it a signal, such as SIGQUIT, which
you can generate with the ^C key.  If it still reacts to ^C, it's not
a kernel bug, though it could be a program bug.

Looking back over this, I don't know if I have succeeded in making
myself clear.  When I clear out the 1000 mail messages waiting for me,
things might be better.  Ask again if you need any further
clarification.

Greg
--
See complete headers for address and phone numbers
finger grog@lemis.com for PGP public key

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980623121745.A27719>