FS#32671 - [kmod] depmod fails with modules in extramodules

Attached to Project: Arch Linux
Opened by Jonathan Frazier (wide-eye) - Thursday, 15 November 2012, 07:43 GMT
Last edited by Gerardo Exequiel Pozzi (djgera) - Saturday, 17 November 2012, 04:28 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Dave Reisner (falconindy)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

using kmod 11-1, depmod errors with modules in extramodules. it works with kmod 10-2.

depmod: tools/depmod.c:980: mod_free: Assertion `mod->kmod == ((void *)0)' failed.

1. cp /usr/lib/modules/3.6.6-1-ARCH/kernel/drivers/input/mouse/psmouse.ko.gz /usr/lib/modules/extramodules-3.6-ARCH/

2. depmod -vvv gives:
(snip 150k lines)
depmod: DEBUG: try extramodules/psmouse.ko.gz (psmouse)
depmod: DEBUG: comparing priorities of kernel/drivers/input/mouse/psmouse.ko.gz and extramodules/psmouse.ko.gz
depmod: DEBUG: search built-in
depmod: DEBUG: search extramodules
depmod: DEBUG: search updates
depmod: DEBUG: priorities: built-in: 0, old: 1, new: 0
depmod: DEBUG: Replace lower priority kernel/drivers/input/mouse/psmouse.ko.gz with new module extramodules/psmouse.ko.gz
depmod: DEBUG: del 0x1f22980 kmod=0x1f22840, path=/lib/modules/3.6.6-1-ARCH/kernel/drivers/input/mouse/psmouse.ko.gz
depmod: DEBUG: free 0x1f22980 kmod=0x1f22840, path=/lib/modules/3.6.6-1-ARCH/kernel/drivers/input/mouse/psmouse.ko.gz
depmod: tools/depmod.c:980: mod_free: Assertion `mod->kmod == ((void *)0)' failed.
This task depends upon

Closed by  Gerardo Exequiel Pozzi (djgera)
Saturday, 17 November 2012, 04:28 GMT
Reason for closing:  Fixed
Comment by Jonathan Frazier (wide-eye) - Thursday, 15 November 2012, 07:44 GMT
this was tested on i686. - john_f
Comment by Dave Reisner (falconindy) - Thursday, 15 November 2012, 14:24 GMT
Not reproducible on x86_64.
Comment by Sascha (eumel) - Thursday, 15 November 2012, 15:53 GMT
Confirmed on x86_64 with tp_smapi.
depmod: DEBUG: Replace lower priority kernel/drivers/platform/x86/hdaps.ko.gz with new module extramodules/hdaps.ko.gz
depmod: DEBUG: del 0xb83c50 kmod=0xb83b10, path=/lib/modules/3.6.6-1-ARCH/kernel/drivers/platform/x86/hdaps.ko.gz
depmod: DEBUG: free 0xb83c50 kmod=0xb83b10, path=/lib/modules/3.6.6-1-ARCH/kernel/drivers/platform/x86/hdaps.ko.gz
depmod: tools/depmod.c:980: mod_free: Assertion `mod->kmod == ((void *)0)' failed.
Comment by Dave Reisner (falconindy) - Thursday, 15 November 2012, 15:55 GMT
Right, this only happens when there's a module with a duplicate name. It's not about where the module is.

Not really related, but you really should be using updates/ and not extramodules/ if you're rebuilding your own modules to supersede the in tree flavor.
Comment by Dave Reisner (falconindy) - Thursday, 15 November 2012, 18:49 GMT
Also, no idea where you're getting tp_smapi from when you're posting debug output about hdaps... I can't reproduce this on x86_64.
Comment by Sascha (eumel) - Thursday, 15 November 2012, 19:19 GMT
Hi Dave,
this is tp_smapi from [community], version 0.41-11. It fails during installation with the same error, the above output is from depmod -vvv. This did not happen before. I should mention that this is a fresh arch installation.
Comment by Dave Reisner (falconindy) - Thursday, 15 November 2012, 19:44 GMT
And as I stated, your error has nothing to do with tp_smapi. You've copied hdaps.ko.gz into extramodules/ and this is why it's reproducing the same error described in the original bug report.
Comment by Sascha (eumel) - Thursday, 15 November 2012, 20:01 GMT
I did not. It is packaged that way. (See https://www.archlinux.org/packages/community/x86_64/tp_smapi/)
I apologize if I am misunderstanding something here, but installing tp_smapi triggers this bug on all my systems (which did not happen before). It is strange that you cannot reproduce this.
Comment by Jonathan Frazier (wide-eye) - Friday, 16 November 2012, 11:00 GMT
I also have the tp_smapi package installed with its hdaps module in extramodules. bisecting shows this is due to commit e4a7352ad3c16f0b4b658218d9997e3570a70772:

commit e4a7352ad3c16f0b4b658218d9997e3570a70772
Author: Lucas De Marchi <...>
Date: Tue Oct 30 03:46:12 2012 -0200

depmod: unref kmod_module once we don't need it anymore


after reverting this change depmod gets through this section of code but has later memory allocation errors.

example error:

ERROR: failed to load symbols from /lib/modules/3.6.6-1-ARCH/kernel/drivers/ata/pata_opti.ko.gz: Cannot allocate memory

"working" log. identical to kmod 10-2 for this section.

depmod: DEBUG: try extramodules/hdaps.ko.gz (hdaps)
depmod: DEBUG: comparing priorities of kernel/drivers/platform/x86/hdaps.ko.gz and extramodules/hdaps.ko.gz
depmod: DEBUG: search built-in
depmod: DEBUG: search extramodules
depmod: DEBUG: search updates
depmod: DEBUG: priorities: built-in: 0, old: 1, new: 0
depmod: DEBUG: Replace lower priority kernel/drivers/platform/x86/hdaps.ko.gz with new module extramodules/hdaps.ko.gz
depmod: DEBUG: del 0x8d7c5a8 kmod=0x8d7c4f8, path=/lib/modules/3.6.6-1-ARCH/kernel/drivers/platform/x86/hdaps.ko.gz
depmod: DEBUG: free 0x8d7c5a8 kmod=0x8d7c4f8, path=/lib/modules/3.6.6-1-ARCH/kernel/drivers/platform/x86/hdaps.ko.gz
depmod: DEBUG: add 0x8d893e8 kmod=0x8d7c4f8, path=/lib/modules/3.6.6-1-ARCH/extramodules/hdaps.ko.gz

Comment by Gavin Lloyd (gavinhungry) - Friday, 16 November 2012, 22:40 GMT
As part of the tp_smapi package, hdaps.ko.gz should be getting packaged into updates/ and not into extramodules/, as the kernel tree already contains a module with the same name. Manually moving hdaps.ko.gz to updates/ and running depmod (from kmod 11-1) fixes the issue for me.

However, with kmod 10-2, depmod picks up hdaps.ko.gz in extramodules/ just fine, even though the kernel tree module with the same name still exists.
Comment by Dave Reisner (falconindy) - Friday, 16 November 2012, 23:50 GMT
This has nothing to do with where the module is. Upstream has pushed a fix which I'll backport this weekend.

But yes, agree that the module is in the wrong directory. That's a separate bug.
Comment by Dave Reisner (falconindy) - Saturday, 17 November 2012, 02:41 GMT
Pushed kmod 11-2 to testing with patches backported to fix this.
Comment by Gavin Lloyd (gavinhungry) - Saturday, 17 November 2012, 03:32 GMT
11-2 in [testing] resolves the issue for me (x86_64).
Comment by Jonathan Frazier (wide-eye) - Saturday, 17 November 2012, 04:24 GMT
11-2 works for me on i686

Loading...