Opened 3 years ago

Last modified 6 months ago

#17130 new bug

The computer hangs, when shutting down system

Reported by: huh20 Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: - General Version: R1/beta3
Keywords: Shutdown Cc:
Blocked By: Blocking:
Platform: x86-64

Description (last modified by huh20)

Hi, I have such a problem. Almost every time when I shut down the system, Haiku hangs up with the Shutdown… window, the mouse doesn’t respond.

The key for the Kernel debug console alt + print screen + d does not work. The disk light is off, the keyboard is not responding, and the lights on the keyboard are off. Sometimes the computer shuts down, but it rarely does. The Restart System option works normally. Haiku is the R1/beta3 hrev55181 + 52 x86_64, but it was same also with previous versions.

It works with Windows, which I have on the second disk, shutdown PC works every time.

The hardware is:
Core 2 Quad Q6600, 4GB RAM DDR2, Nvidia Geforce 6200 128MB, motherboard MSI P35 Neo (https://us.msi.com/Motherboard/P35_Neo/Specification), HDD WDC WD2500AAKS-00B3A0 250GB 7200 RPM SATA.

If more information is needed, I will supply it.

Attachments (6)

shutdown.jpg (1.6 MB ) - added by huh20 3 years ago.
Picture
syslog.7z (22.9 KB ) - added by huh20 3 years ago.
syslogs
syslog (360.3 KB ) - added by huh20 3 years ago.
syslog1
syslog.old (512.1 KB ) - added by huh20 3 years ago.
syslogold
syslogreboot (107.9 KB ) - added by huh20 3 years ago.
syslog after system restart (restart works well compared to shutdown) I don't know if it's important.
screenshot1.png (65.2 KB ) - added by vidrep 3 years ago.

Change History (19)

by huh20, 3 years ago

Attachment: shutdown.jpg added

Picture

by huh20, 3 years ago

Attachment: syslog.7z added

syslogs

comment:1 by korli, 3 years ago

Please only attach the syslog as a text file.

by huh20, 3 years ago

Attachment: syslog added

syslog1

by huh20, 3 years ago

Attachment: syslog.old added

syslogold

comment:2 by diver, 3 years ago

Description: modified (diff)

by huh20, 3 years ago

Attachment: syslogreboot added

syslog after system restart (restart works well compared to shutdown) I don't know if it's important.

comment:3 by huh20, 3 years ago

Description: modified (diff)

comment:4 by tqh, 3 years ago

As I understand it you are on x86_64.

For rebooting we try very old way of rebooting as a last try: https://github.com/haiku/haiku/blob/8f16317a5b6db5c672f331814273e5857555020f/src/system/kernel/arch/x86/arch_cpu.cpp#L1662

Another interesting thing is that for some reason we kill teams when rebooting, which we don't do for shutdown. The code is so old there is no commit message why it is done that way. To me it seems it should be done in both or neither case. Killing the teams first may also be what makes reboot work: https://github.com/haiku/haiku/blob/8f16317a5b6db5c672f331814273e5857555020f/src/system/kernel/shutdown.cpp#L13

comment:5 by vidrep, 3 years ago

If you could provide a patch for me to test (based upon the last comments) I would try it on my own system with the same issue.

comment:6 by tqh, 3 years ago

Id just remove https://github.com/haiku/haiku/blob/8f16317a5b6db5c672f331814273e5857555020f/src/system/kernel/shutdown.cpp#L23 and its corresponding end bracket, so that teams are killed on shutdown as well.

Last edited 3 years ago by tqh (previous) (diff)

comment:7 by vidrep, 3 years ago

I removed the lines and built an image, which I installed on the PC (hrev55269 dirty). It still hangs as before.

comment:8 by tqh, 3 years ago

Ok, and this is still there?:

while (get_next_team_info(&cookie, &info) == B_OK) {
  if (info.team == B_SYSTEM_TEAM)
    continue;
  kill_team(info.team);
}

Can you add a return B_NOT_SUPPORTED here: https://github.com/haiku/haiku/blob/8f16317a5b6db5c672f331814273e5857555020f/src/system/kernel/arch/x86/arch_cpu.cpp#L1666

If reboot stops working after this we know that the ACPI shutdown call returns an error and reboot used the fallback shutdown method.

comment:9 by vidrep, 3 years ago

Correct. See attached screenshot. So as not to mix up tickets, lets move any further discussion for my system to my existing ticket for this issue. https://dev.haiku-os.org/ticket/14205

Last edited 3 years ago by vidrep (previous) (diff)

by vidrep, 3 years ago

Attachment: screenshot1.png added

comment:10 by vidrep, 3 years ago

System shuts down cleanly when “shutdown” is invoked from the terminal.

comment:11 by tqh, 3 years ago

Have you tried several times, so it is not just a fluke? Then it looks like it is not ACPI related but app or driver hang.

in reply to:  4 comment:12 by Anarchos, 7 months ago

Replying to tqh:

Maybe it is related to this commit ?

commit e18d4a2d065fbf99191879fcac134475e991fbed Author: Stephan Aßmus <superstippi@…> Date: Sun Apr 5 19:04:25 2009 +0000

Patch by Olivier Coursiere: When rebooting, shutdown all the system teams, most importantly input_server, which then closes the drivers for input devices. This in turn will do some cleanup. The touch pad driver will then be reset to act as normal PS/2 mouse, so that OS like BeOS can use it again.

Another interesting thing is that for some reason we kill teams when rebooting, which we don't do for shutdown. The code is so old there is no commit message why it is done that way. To me it seems it should be done in both or neither case. Killing the teams first may also be what makes reboot work: https://github.com/haiku/haiku/blob/8f16317a5b6db5c672f331814273e5857555020f/src/system/kernel/shutdown.cpp#L13

comment:13 by waddlesplash, 6 months ago

I think we don't kill all teams if not rebooting in order so that the "It's now safe to turn off your computer" message displays if shutdown fails.

Note: See TracTickets for help on using tickets.