On Sat, 18 Apr 2020 03:08:46 -0400 Michael Shell <[email protected]> wrote:

> On Wed, 15 Apr 2020 10:41:27 +0200
> Stephen Berman <[email protected]> wrote:
>
>> But if I run another program before shutdown (the two cases I've tried
>> are startx and emacs in the tty), then shutdown does not power off
>> the machine.
>
>
> This is a most perplexing problem!
>
> I found this:
>
> https://forums.developer.nvidia.com/t/system-seems-locked-while-rebooting-with-linux-5-2-1-and-nvidia-drivers-430-34-or-430-26/78262
>
> which may, or may not, be related to your problem. However, it does
> demonstrate that video driver bugs (in the kernel) can cause
> such a problem.

Thanks for the pointer.  This computer doesn't have an Nvidia card and I
believe it doesn't use any Nvidia driver (though the kernel config does
have CONFIG_NET_VENDOR_NVIDIA=y, probably a default I didn't change).

What may be related, though, is that the post in that forum says the
problem happens in kernel 5.2.1 but not in 5.1.16.  I have now tested
with kernels 5.3.0, 5.2.0 and 5.1.0 from the mainline repository and the
computer does not power off (after normal use) with 5.3.0 or 5.2.0 but
does with 5.1.0.  So I can use the latter two as bad and good commits
for git bisect.

> Now, clearly there will be many other processes running on your
> system even after a cold start. Even a bash prompt is a running
> process.
>
> Emacs might not be as clean a "console"" test as you might think - it
> might trigger the starting of some video related kernel functions even
> when running outside of X.
>
> Try something like
>
> more text_file.txt
>
> so that you get a more prompt in that tty. Can you shutdown
> with something as simple as more running?

Do you mean run `more' in one tty and while it's running do `shutdown -h
now' in another tty?

> If *any* running command, which was started by you, triggers the
> problem, then perhaps it could be some type of permissions/user
> issue related to a kernel bug. Namely, if your username starts
> a process (perhaps anything other than a shell), then the kernel
> seems to be unable to kill that process, and most strangely, all
> this seems to be linked to the CDROM.
>
> Another angle is that emacs (and Xorg) "look" at the CDROM
> and that is what triggers it. If the more test allows for
> a clean shutdown, than what about commands that try to
> access the cdrom:
>
> dd count=10 bs=1k if=/dev/cdrom of=/dev/null
>
> Does running that result in shutdown failures (even after
> the the dd command finishes/fails)?
>
> What if your emacs process is then killed *before* you try to
> shutdown, can you shutdown then? If not, my guess is that any
> process that ever "looks" at the cdrom triggers the problem.

I always do `shutdown -h now' from a tty after quitting all programs
I've started, including Emacs, Firefox and X.

> Another thing to try - does the problem persist if the CDROM is
> physically disconnected from the system (e.g., its SATA cable
> disconnected and then the system powered up)? If the system
> just hangs at some other point, then that is good evidence that
> something other than the CDROM driver/SCSI system is to blame.

Thanks for the feedback.  I see if I can try your suggestions and see
what happens.

Steve Berman
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style

Reply via email to