Parallel depmod failure with dkms autoinstall

Bug #1608499 reported by Julien Floret on 2016-08-01
22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
dkms (Ubuntu)
High
Robert Hooker
Trusty
High
Robert Hooker
Xenial
High
Robert Hooker

Bug Description

Description of problem
----------------------

"dkms autoinstall" installs DKMS modules in parallel, potentially executing
several depmod instances in parallel.

The resulting race condition causes depmod to fail and dkms install as well.

This problem is critical because some DKMS modules can be left in "built"
state after a kernel upgrade, thus the kernel modules will not be re-installed
in /lib/modules/.

Ubuntu release
--------------
# lsb_release -rd
Description: Ubuntu 16.04 LTS
Release: 16.04

DKMS package version
--------------------

# apt-cache policy dkms
dkms:
  Installed: 2.2.0.3-2ubuntu11
  Candidate: 2.2.0.3-2ubuntu11
  Version table:
 *** 2.2.0.3-2ubuntu11 500
        500 http://fr.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
        500 http://fr.archive.ubuntu.com/ubuntu xenial/main i386 Packages
        100 /var/lib/dpkg/status

Steps to reproduce
------------------

Add 2 simple DKMS modules, mod1 and mod2 (test case in attachment) with
"dkms add", then run "dkms autoinstall".

# dkms add mod1 ; dkms add mod2

Creating symlink /var/lib/dkms/mod1/1.0/source ->
                 /usr/src/mod1-1.0

DKMS: add completed.

Creating symlink /var/lib/dkms/mod2/1.0/source ->
                 /usr/src/mod2-1.0

DKMS: add completed.

# dkms autoinstall

Kernel preparation unnecessary for this kernel. Skipping...

Building module:
cleaning build area...
Kernel preparation unnecessary for this kernel. Skipping...

Building module:
cleaning build area....
.make KERNELRELEASE=4.4.0-28-generic -C /lib/modules/4.4.0-28-generic/build SUBDIRS=/var/lib/dkms/mod2/1.0/build S=/var/lib/dkms/mod2/1.0/build modules...
make KERNELRELEASE=4.4.0-28-generic -C /lib/modules/4.4.0-28-generic/build SUBDIRS=/var/lib/dkms/mod1/1.0/build S=/var/lib/dkms/mod1/1.0/build modules.....

cleaning build area...cleaning build area.....

DKMS: build completed.

DKMS: build completed.

mod2.ko:
Running module version sanity check.

mod1.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.4.0-28-generic/updates/dkms/
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.4.0-28-generic/updates/dkms/

depmod...depmod.......(bad exit status: 1)

-------- Uninstall Beginning --------
Module: mod2
Version: 1.0
Kernel: 4.4.0-28-generic (x86_64)
-------------------------------------

DKMS: install completed.

Status: Before uninstall, this module version was ACTIVE on this kernel.

mod2.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.4.0-28-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod....

DKMS: uninstall completed.
Error! Problems with depmod detected. Automatically uninstalling this module.
DKMS: Install Failed (depmod problems). Module rolled back to built state.

root@ubuntu1604:~/dkms-depmod# dkms status
mod1, 1.0, 4.4.0-28-generic, x86_64: installed
mod2, 1.0, 4.4.0-28-generic, x86_64: built

=> mod2 should be in "installed" state as well.

# modinfo mod1
filename: /lib/modules/4.4.0-28-generic/updates/dkms/mod1.ko
author: 6WIND
license: GPL
srcversion: 8D30BAE7A8F4D38F20AEB57
depends:
vermagic: 4.4.0-28-generic SMP mod_unload modversions

# modinfo mod2
modinfo: ERROR: Module mod2 not found.

Solution
--------

The problem is fixed in dkms official repository by commit
https://github.com/dell-oss/dkms/commit/00114cbc0a1f8c0aa5143808205d1a7cc9e58d3b
(also in attachment).

Julien Floret (julien-floret) wrote :
Julien Floret (julien-floret) wrote :

The attachment "0001-Parallel-depmod-failure.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
tags: added: 6wind
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in dkms (Ubuntu):
status: New → Confirmed
Julien Floret (julien-floret) wrote :

This fix is needed in Ubuntu 14.04 too.

Robert Hooker (sarvatt) wrote :

Attaching debdiffs with fixed packages for yakkety, xenial, and trusty but they need sponsoring. All of the packages are available in https://launchpad.net/~sarvatt/+archive/ubuntu/green

Robert Hooker (sarvatt) wrote :
Robert Hooker (sarvatt) wrote :
Changed in dkms (Ubuntu):
assignee: nobody → Robert Hooker (sarvatt)
Changed in dkms (Ubuntu):
importance: Undecided → High
Julien Floret (julien-floret) wrote :

Hello Robert,
Your patches are ok for me. Thanks!

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package dkms - 2.2.0.3-2ubuntu13

---------------
dkms (2.2.0.3-2ubuntu13) yakkety; urgency=medium

  * debian/patches/Parallel-depmod-failure.patch: (LP: #1608499)
    - Backport fix from 2.3 to fix a race condition in dkms autoinstall

 -- Robert Hooker <email address hidden> Thu, 08 Sep 2016 16:43:56 -0400

Changed in dkms (Ubuntu):
status: Confirmed → Fix Released
Robert Hooker (sarvatt) on 2016-09-09
Changed in dkms (Ubuntu Xenial):
assignee: nobody → Robert Hooker (sarvatt)
Changed in dkms (Ubuntu Trusty):
assignee: nobody → Robert Hooker (sarvatt)

Hello Julien, or anyone else affected,

Accepted dkms into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/dkms/2.2.0.3-2ubuntu11.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in dkms (Ubuntu Xenial):
status: New → Fix Committed
tags: added: verification-needed
Changed in dkms (Ubuntu Trusty):
status: New → Fix Committed
Timo Aaltonen (tjaalton) wrote :

Hello Julien, or anyone else affected,

Accepted dkms into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/dkms/2.2.0.3-1.1ubuntu5.14.04.8 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in dkms (Ubuntu Trusty):
importance: Undecided → High
Changed in dkms (Ubuntu Xenial):
importance: Undecided → High
Julien Floret (julien-floret) wrote :

Hello,

I have tested 2.2.0.3-2ubuntu11.2 from xenial-proposed and
2.2.0.3-1.1ubuntu5.14.04.8 from trusty-proposed.

Both packages fix the problem.

Thanks!

tags: added: verification-done
removed: 6wind verification-needed

please, once we have verified the *-proposed packages, when can it move to the available package tree?

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package dkms - 2.2.0.3-1.1ubuntu5.14.04.8

---------------
dkms (2.2.0.3-1.1ubuntu5.14.04.8) trusty; urgency=medium

  * debian/patches/Parallel-depmod-failure.patch: (LP: #1608499)
    - Backport fix from 2.3 to fix a race condition in dkms autoinstall

 -- Robert Hooker <email address hidden> Thu, 08 Sep 2016 16:47:45 -0400

Changed in dkms (Ubuntu Trusty):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for dkms has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package dkms - 2.2.0.3-2ubuntu11.2

---------------
dkms (2.2.0.3-2ubuntu11.2) xenial; urgency=medium

  * debian/patches/Parallel-depmod-failure.patch: (LP: #1608499)
     - Backport fix from 2.3 to fix a race condition in dkms autoinstall

 -- Robert Hooker <email address hidden> Thu, 08 Sep 2016 15:38:21 -0400

Changed in dkms (Ubuntu Xenial):
status: Fix Committed → Fix Released

thank you

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers