Bug 767738

Summary: redhat-rpm-config-9.0.3-34.el6 in RHEL-6.2 introduces bogus ksym Requires when building some packages on RHEL-6.2
Product: Red Hat Enterprise Linux 6 Reporter: Phil Perry <phil>
Component: redhat-rpm-configAssignee: Jon Masters <jcm>
Status: CLOSED ERRATA QA Contact: Patrik Kis <pkis>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.2CC: ajb, dag, fabian.arrotin, jcm, ksrot, phil, pkis, toracat
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 800582 (view as bug list) Environment:
Last Closed: 2012-06-20 14:24:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 725987, 800582    
Attachments:
Description Flags
fix sort ordering for ksyms none

Description Phil Perry 2011-12-14 19:02:08 UTC
Description of problem:

Since redhat-rpm-config was updated in RHEL-6.2 (version 9.0.3-34.el6), some packages built on RHEL-6.2 exhibit bogus ksym() Requires. For example:

$ rpm -qp --requires kmod-fglrx-11.12-1.el6.elrepo.x86_64.rpm | grep free_pages
kernel(__free_pages) = 0xffd35acd
kernel(__get_free_pages) = 0x93fca811
ksym(free_pages) = 0x4302d0eb

Downgrading to redhat-rpm-config-9.0.3-33.el6 and rebuilding the package fixes the issue:

$ rpm -qp --requires kmod-fglrx-11.12-2.el6.elrepo.x86_64.rpm | grep free_pages
kernel(free_pages) = 0x4302d0eb
kernel(__free_pages) = 0xffd35acd
kernel(__get_free_pages) = 0x93fca811

It would appear that this bugzilla has introduced the problem:

https://bugzilla.redhat.com/show_bug.cgi?id=642768

Version-Release number of selected component (if applicable):

redhat-rpm-config.noarch 0:9.0.3-34.el6

How reproducible:

Occasional. This does not affect every package built (some are OK) nor does it affect every symbol. So far I have identified 2 affected packages. Another example is:

http://elrepo.org/linux/testing/el6/x86_64/RPMS/kmod-ndiswrapper-1.57-0.1.rc1.el6.elrepo.x86_64.rpm

$ rpm -qp --requires kmod-ndiswrapper-1.57-0.1.rc1.el6.elrepo.x86_64.rpm | grep ksym
ksym(__vmalloc) = 0xa9bd2676


Steps to Reproduce:
1. On a RHEL-6.2 build system with redhat-rpm-config-9.0.3-34.el6, rebuild the following SRPM:

http://elrepo.org/linux/testing/el6/SRPMS/ndiswrapper-kmod-1.57-0.1.rc1.el6.elrepo.src.rpm

Actual results:
$ rpm -qp --requires kmod-ndiswrapper-1.57-0.1.rc1.el6.elrepo.x86_64.rpm | grep vmalloc
kernel(vmalloc) = 0xd6ee688f
ksym(__vmalloc) = 0xa9bd2676


Expected results:
$ rpm -qp --requires kmod-ndiswrapper-1.57-0.1.rc1.el6.elrepo.x86_64.rpm | grep vmalloc
kernel(vmalloc) = 0xd6ee688f
kernel(__vmalloc) = 0xa9bd2676


Additional info:
Severity is low as downgrading redhat-rpm-config fixes the issue.

Comment 2 Phil Perry 2011-12-14 19:08:22 UTC
Original bug reported here:

http://elrepo.org/bugs/view.php?id=211

Comment 3 Jon Masters 2011-12-14 21:19:23 UTC
Ok. This is obviously not supposed to be happening :) It ought to be that a ksym() dep is generated for dependencies upon other modules, whereas a kernel() dep is generated for core kernel deps. I'll dig into this. I suspect one of these symbols is not being provided by the kernel itself, and is not satisfied by another driver RPM.

Comment 4 Phil Perry 2011-12-14 22:22:16 UTC
As far as I can see, in each case the symbol in question is provided by the kernel, just for some reason it's been incorrectly generated as a ksym() dep rather than kernel() dependency.

Comment 5 Phil Perry 2011-12-30 14:34:46 UTC
Hi Jon,

Just to note I now also have an example package that suffers from the bug this fix was intended to fix - that is a kmod that should generate ksym() deps for symbols provided by other kmods, but actually generates them as kernel() deps with the old redhat-rpm-config-9.0.3-33.el6.noarch package:

$ rpm -qp --requires kmod-asus-wmi-0.0-1.el6.elrepo.i686.rpm | grep sparse
sparse-keymap-kmod
kernel(sparse_keymap_free) = 0x6c72ec05
kernel(sparse_keymap_report_event) = 0x07743244
kernel(sparse_keymap_setup) = 0x4ef28aa7 

instead of:

$ rpm -qp --requires kmod-asus-wmi-0.0-1.el6.elrepo.x86_64.rpm | grep sparse
sparse-keymap-kmod
ksym(sparse_keymap_free) = 0x10229b46
ksym(sparse_keymap_report_event) = 0x8679b20e
ksym(sparse_keymap_setup) = 0x5f5161bb

with the latest redhat-rpm-config-9.0.3-34.el6.noarch

So I now have example packages for both test cases :-)

Comment 10 Alan Bartlett 2012-02-29 20:16:02 UTC
Jon,

We (the ELRepo Project) are unable to view https://bugzilla.redhat.com/show_bug.cgi?id=725987 and so are completely in the dark.

Alan.

Comment 11 Jon Masters 2012-03-05 03:28:34 UTC
Ah :) Alan, that is an internal "tracking" bug. I can probably open it up but it has no bearing on this. I am working on getting a fix into 6.3.

Comment 12 Jon Masters 2012-03-05 05:50:01 UTC
I am attaching a patch that I believe will correct the problem. It is caused by a missing "-k1,1" on a sort. The affected script uses sort to produce an ordered list of all kernel symbol deps for a given kernel. Unfortunately, the data is ordered such that symbols for which an internal-only kernel symbol (prefixed with "__") also exists - such as is the case with "kmalloc" and "__kmalloc" - the subsequent attempt to join with other ordered data fails due to the ordering being incorrect. Further, join requires that "LANG=C" be set in order to ensure it will correctly process data that has been sorted (also forced to "LANG=C" for safety) so that it won't regard the data as being incorrectly ordered. I know this isn't a great explanation, but the patch is simple so I hope it makes more sense than this brief explanation.

Comment 13 Jon Masters 2012-03-05 05:50:38 UTC
Created attachment 567474 [details]
fix sort ordering for ksyms

Comment 14 Jon Masters 2012-03-05 05:52:03 UTC
Using this patch I am correctly able to generate "ksym" deps on the asus-wmi driver, and not on the fglrx or ndiswrapper drivers :)

Comment 15 Jon Masters 2012-03-05 09:35:35 UTC
I wonder if either of you wonderful gentlemen could try testing this patch for me today? You can just apply it against /usr/lib/rpm/redhat on a test system, etc.

Comment 16 Akemi Yagi 2012-03-05 14:09:02 UTC
I've patched find-requires.ksyms, so can do the test.

Comment 17 Phil Perry 2012-03-05 16:11:33 UTC
Many thanks Jon.

Akemi is performing the test builds right now for you :-)

Comment 18 Akemi Yagi 2012-03-05 16:43:19 UTC
Jon,

I'm happy to report that your patch works fine for all fglrx-kmod, ndiswrapper-kmod and asus-wmi-kmod.

Comment 19 Alan Bartlett 2012-03-05 17:50:11 UTC
(In reply to comment #11)
> Ah :) Alan, that is an internal "tracking" bug. I can probably open it up but
> it has no bearing on this. I am working on getting a fix into 6.3.

Thanks, Jon. I just wasn't sure of the relevance. As you say it has none, I'm happy to accept that. :)

Seems like I'm the latecomer today . . . best to let Akemi and Ned continue without any assistance from me!

Comment 22 Jon Masters 2012-03-06 07:31:34 UTC
A fix for this bug has been submitted to RHEL6.3.

Comment 23 Alan Bartlett 2012-03-06 18:32:12 UTC
(In reply to comment #22)
> A fix for this bug has been submitted to RHEL6.3.

Thank you, Jon. Will the bug-fix be fast-tracked, by any chance?

Comment 24 Jon Masters 2012-03-06 19:01:52 UTC
I've gone through the motions of requesting for 6.2...we'll see what can be done :)

Comment 25 Alan Bartlett 2012-03-06 19:16:06 UTC
(In reply to comment #24)
> I've gone through the motions of requesting for 6.2...we'll see what can be
> done :)

Appreciated. Thank you. ;)

Comment 27 Eduard Benes 2012-03-07 17:54:15 UTC
*** Bug 800582 has been marked as a duplicate of this bug. ***

Comment 28 Phil Perry 2012-04-24 16:38:27 UTC
Confirmed this patch has made it into RHEL-6.3 beta:

redhat-rpm-config-9.0.3-39.el6

Not re-tested yet, but assume it's fixed given the included patch is identical to the patch we tested above.

Many thanks Jon.

Comment 29 Patrik Kis 2012-05-09 13:41:24 UTC
Hi Jon,

I managed to verify this bug only with ndiswrapper-kmod-1.57-0.1.rc1.el6.elrepo.src.rpm reproducer, but that is tight to x86_64 and i386 architectures.

Don't you have by the chance an universal reproducer that could be used for automated tests? Or it would be great if you could help with creation of a simple spec file that could be used architecture independently.

Comment 31 errata-xmlrpc 2012-06-20 14:24:14 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0911.html