My computer reboots instead of shutting down

Bug #1618001 reported by luvr
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Expired
Medium
Unassigned

Bug Description

See also: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1579542

When I try to shutdown my computer, it seems as though it is trying to power off, but it immediately reboots instead.

I can circumvent the problem by unbinding the EHCI drivers right before power off. I created a systemd service to do this automatically. First, I created a script, '/usr/local/sbin/unbind-ehci-drivers' that the service will execute:

-----</usr/local/sbin/unbind-ehci-drivers>-----
#!/bin/sh

DRIVER_DIRECTORY='/sys/bus/pci/drivers/ehci-pci'

cd "${DRIVER_DIRECTORY}"
find -mindepth 1 -maxdepth 1 -name '*:*:*.*' -type l -printf '%f\0' | xargs -I '{}' --null echo '{}' > unbind
-----<srevird-iche-dnibnu/nibs/lacol/rsu/>-----

Next, the '/etc/systemd/system/unbind-ehci-drivers.service' systemd service file:

-----</etc/systemd/system/unbind-ehci-drivers.service>-----
[Unit]
Description=Unbind EHCI drivers upon system shutdown
DefaultDependencies=no
Before=halt.target

[Service]
Type=oneshot
ExecStart=/usr/local/sbin/unbind-ehci-drivers

[Install]
WantedBy=shutdown.target
-----<ecivres.srevird-iche-dnibnu/metsys/dmetsys/cte/>-----

With these files in place, the following command will enable the service:
root@localhost# systemctl enable unbind-ehci-drivers

Shutdown works now.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: linux-image-4.4.0-34-generic 4.4.0-34.53
ProcVersionSignature: Ubuntu 4.4.0-34.53-generic 4.4.15
Uname: Linux 4.4.0-34-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: luvr 2872 F.... pulseaudio
 /dev/snd/controlC1: luvr 2872 F.... pulseaudio
CurrentDesktop: XFCE
Date: Mon Aug 29 14:04:15 2016
HibernationDevice: RESUME=UUID=d7daa6c6-cf48-4498-8abf-144837e1a26b
InstallationDate: Installed on 2016-08-09 (19 days ago)
InstallationMedia: Xubuntu 16.04.1 LTS "Xenial Xerus" - Release amd64 (20160719)
IwConfig:
 enp2s0 no wireless extensions.

 lo no wireless extensions.
MachineType: Gigabyte Technology Co., Ltd. GA-MA78G-DS3H
ProcFB: 0 radeondrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.4.0-34-generic root=UUID=4b189e9a-d377-49c2-a527-2fc432a51f4f ro quiet splash vt.handoff=7
RelatedPackageVersions:
 linux-restricted-modules-4.4.0-34-generic N/A
 linux-backports-modules-4.4.0-34-generic N/A
 linux-firmware 1.157.3
RfKill:

SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 04/03/2008
dmi.bios.vendor: Award Software International, Inc.
dmi.bios.version: F2
dmi.board.name: GA-MA78G-DS3H
dmi.board.vendor: Gigabyte Technology Co., Ltd.
dmi.board.version: x.x
dmi.chassis.type: 3
dmi.chassis.vendor: Gigabyte Technology Co., Ltd.
dmi.modalias: dmi:bvnAwardSoftwareInternational,Inc.:bvrF2:bd04/03/2008:svnGigabyteTechnologyCo.,Ltd.:pnGA-MA78G-DS3H:pvr:rvnGigabyteTechnologyCo.,Ltd.:rnGA-MA78G-DS3H:rvrx.x:cvnGigabyteTechnologyCo.,Ltd.:ct3:cvr:
dmi.product.name: GA-MA78G-DS3H
dmi.sys.vendor: Gigabyte Technology Co., Ltd.

Revision history for this message
luvr (luc-vanrompaey) wrote :
Revision history for this message
Brad Figg (brad-figg) wrote : Status changed to Confirmed

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Did this issue start happening after an update/upgrade? Was there a prior kernel version where you were not having this particular problem?

Would it be possible for you to test the latest upstream kernel? Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Please test the latest v4.8 kernel[0].

If this bug is fixed in the mainline kernel, please add the following tag 'kernel-fixed-upstream'.

If the mainline kernel does not fix this bug, please add the tag: 'kernel-bug-exists-upstream'.

Once testing of the upstream kernel is complete, please mark this bug as "Confirmed".

Thanks in advance.

[0] http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.8-rc3

Changed in linux (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Incomplete
penalvch (penalvch)
tags: added: bios-outdated-f9
Revision history for this message
luvr (luc-vanrompaey) wrote :

The problem started happening as soon as I did the (fresh) Ubuntu 16.04 install.

Previously, the computer had been running 14.04, and the computer would properly shut down as long as no USB medium (stick or disk) was connected when I initiated the shutdown. I got into the habit of disconnecting all USB media before shutting down, and never paid further attention to the issue. I saw this very same behaviour under a Debian release (could be 7 or 8) that was installed on the computer for a short while.

Before 14.04, the computer had 10.04, and I don't remember having seen the problem in those days.

I have already tested with v4.8-rc2 mainline build, and the problem persisted.
Will try '-rc3' when I find the time.

Revision history for this message
luvr (luc-vanrompaey) wrote :

Just tested with v4.8-rc3:

$ uname -a
Linux wkst1 4.8.0-040800rc3-generic #201608212032 SMP Mon Aug 22 00:34:39 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

The problem persists.

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
penalvch (penalvch) wrote :

luvr, to clarify, when you were using 14.04, what kernel version specifically were you using?

tags: added: needs-bisect regression-release
Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
luvr (luc-vanrompaey) wrote :

I installed updates to my 14.04 system about once a week, including any new kernel versions that came along (I always did "apt-get dist-upgrade"). In other words, there wasn't really one specific kernel version that I was using.

My dad's computer, which has pretty much the same hardware as mine (same model motherboard and CPU, I even bought the hardware for both computers at the same time), is still running 14.04 ("Ubuntu 14.04.5 LTS", according to the 'lsb_release' command). The kernel version that it currently reports (with 'uname -a') is:

Linux wkst0 3.13.0-93-generic #140-Ubuntu SMP Mon Jul 18 21:21:05 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

As far as I can remember, his computer has been having the issue ever since I first installed 14.04 on it: if there are no USB media present upon shutdown, then the computer will successfully power off, but if any USB medium is still connected, then it will reboot.

I refrained from upgrading his computer to 16.04 because under that release, the computer will reboot, instead of powering off, even without any USB media present. Now that I have at least a workaround for this issue, I was considering upgrading his computer after all, but I hadn't gotten around to it just yet.

Revision history for this message
penalvch (penalvch) wrote :

luvr, to clarify, was there a release newer than 10.04, but older than 14.04 where you could shutdown with or without USB devices attached?

Revision history for this message
luvr (luc-vanrompaey) wrote :

Don't know about any releases between 10.04 and 14.04, since I have never run any of these.
I have just downloaded the 'ubuntu-12.04-desktop-amd64.iso' image, to test it.

I have also downloaded the original 14.04 image, since I don't know if the issue was present in the initial 14.04 release (I immediately installed updates after install, and I seem to remember that a new kernel got installed at that point, so I have never run the initial 14.04 kernel).

Revision history for this message
penalvch (penalvch) wrote :

luvr, once you have the 12.04 results, please advise in order to narrow down the regression point.

Revision history for this message
luvr (luc-vanrompaey) wrote :

I have just tested 12.04, installed from the 'ubuntu-12.04-desktop-amd64.iso' image, without updates.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04
Codename: precise
$ uname -a
Linux wkst1 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

It behaves exactly like 14.04: With no USB media attached, shutdown works. If there's a USB medium connected, then the computer reboots instead.

Revision history for this message
luvr (luc-vanrompaey) wrote :

A few other quick tests:
- When booting from the 11.10 ISO, 'ubuntu-11.10-desktop-amd64.iso', shutdown works correctly.
- When booting from the 12.04 ISO, 'ubuntu-12.04-desktop-amd64.iso', shutdown works only if no USB media are attached (not really surprising, since that's the same behaviour as when running 12.04 after installation).

Revision history for this message
penalvch (penalvch) wrote :

luvr, to clarify, if you install a Lucid kernel in either Precise/Trusty/Xenial following https://wiki.ubuntu.com/Kernel/KernelBisection#Bisecting_Ubuntu_kernel_versions, are you able to then reboot with USB devices attached?

tags: added: kernel-bug-exists-upstream kernel-bug-exists-upstream-4.8-rc3
Revision history for this message
penalvch (penalvch) wrote :

luvr, 10.04 or 11.10 kernel is fine for testing.

Revision history for this message
luvr (luc-vanrompaey) wrote :

One further observation: I'm noticing that some USB sticks will not properly 'Eject' on those releases that present the problem; whether I select the 'Eject' or 'Unmount' option on the menu of such a device, does not make a difference, in that the device does get unmounted, but the icon will remain visible (in the 'unmounted' state).

On those releases that do properly shut down, 'Eject' on such a device will not only unmount the device, but will also remove its icon from display.

One device that shows such errant behaviour, is my 'Alcor Micro Corp. Flash Drive', of which I attach the 'lsusb' details (file 'lsusb_flash.txt').

Revision history for this message
luvr (luc-vanrompaey) wrote :

I will review the kernel bisection later on.

Revision history for this message
luvr (luc-vanrompaey) wrote :

I installed the 3.0.0-12 kernel under Ubuntu 12.04 ("precise"), as per the KernelBisection instructions.

(I did, however, run into a dependency problem, in that the 'linux-headers-3.0.0-12-generic' package depended on 'linux-headers-3.0.0-12', which wasn't listed on the 'https://launchpad.net/ubuntu/oneiric/+source/linux' page to which the bisection page referred me. I therefore went looking for the missing package in the old oneiric repository, and found it at 'http://old-releases.ubuntu.com/ubuntu/pool/main/l/linux/linux-headers-3.0.0-12_3.0.0-12.20_all.deb'.)

When I subsequently booted Ubuntu 12.04 with this kernel, my computer successfully shut down, even with a USB medium attached. (In other words, same behaviour as Ubuntu 11.10 with this kernel version.

So:
o The 3.0.0-12 kernel is OK;
o The 3.2.0-23 kernel is NOT OK.

Guess it's time to start bisecting the kernel versions now?

Revision history for this message
penalvch (penalvch) wrote :

luvr, yes, a bisect would be most helpful.

Revision history for this message
luvr (luc-vanrompaey) wrote :

Hmmm.. I'm getting inconsistent results.
Here's what I have tested so far:

3.0.0-12.20: OK.
[3.0.0-13.21 through 3.0.0-32.50: 29 entries not tested]
3.0.0-32.51: NOK.
3.1.0-1.1: OK.
3.1.0-2.2: OK.
3.1.0-2.3: OK.
3.2.0-1.1: OK.
[3.2.0-1.2 through 3.2.0-22.35: 34 entries not tested]
3.2.0-23.36: NOK.

So, it went from GOOD to BAD, then back to GOOD and back to BAD.

Revision history for this message
penalvch (penalvch) wrote :

luvr, that can happen due to fast changing kernel development.

You would want to focus on the most recent version of kernel that went from GOOD to BAD for the bisect.

Revision history for this message
luvr (luc-vanrompaey) wrote :

Further testing reveals that:

3.2.0-1.3 is the last version that is GOOD.
3.2.0-2.4 is the most recent version that went from GOOD to BAD.

In other words, the regression happened between 3.2.0-1.3 and 3.2.0-2.4.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for linux (Ubuntu) because there has been no activity for 60 days.]

Changed in linux (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.