View Issue Details

IDProjectCategoryView StatusLast Update
0004813CentOS-5kudzupublic2011-05-04 21:21
Reporterpapadopoulos 
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Product Version5.6 
Target VersionFixed in Version 
Summary0004813: Probe using libkudzu fails in pci_scan_bus
DescriptionThe following code segfaults on Centos 5.6 but works on Centos 5.5.
compiled with
gcc -o usbtest usbtest.c /usr/lib64/libkudzu.a /usr/lib64/libpci.a -l z -l resolv

#include <alloca.h>
#include <errno.h>
#include <fcntl.h>
#include <kudzu/kudzu.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>


int main(char **argv, int argc)
{
    struct device ** devices;

    fprintf(stderr, "looking for usb controllers ... ");

    devices = probeDevices(CLASS_USB, BUS_PCI, 0);

    if (!devices) {
        fprintf(stderr, "no usb controller found \n");
        return 0;
    }

    fprintf(stderr, "controller found \n");

    return 0;
}

Additional InformationOn failing system (x86_64, CentOS 5.6)
rpm -qa | grep kudzu
kudzu-devel-1.2.57.1.26-1.el5.centos
kudzu-devel-1.2.57.1.26-1.el5.centos
kudzu-1.2.57.1.26-1.el5.centos
# rpm -qa | grep pciutils
pciutils-devel-3.1.7-3.el5
pciutils-3.1.7-3.el5
pciutils-devel-3.1.7-3.el5

On good system (CentOS 5.5)
rpm -qa | grep kudzu
kudzu-1.2.57.1.24-1.el5.centos
kudzu-devel-1.2.57.1.24-1.el5.centos
kudzu-devel-1.2.57.1.24-1.el5.centos
[root@devel-server-0-0 ~]# rpm -qa | grep pciutils
pciutils-2.2.3-8.el5_4
pciutils-devel-2.2.3-8.el5_4
pciutils-devel-2.2.3-8.el5_4

Good output:
./usbtest
looking for usb controllers ... controller found
Bad Output:
./usbtest
looking for usb controllers ... Segmentation fault



TagsNo tags attached.

Activities

papadopoulos

papadopoulos

2011-04-14 18:08

reporter   ~0012625

It seems that a local rebuild of the kudzu-devel RPM solves this problem. e.g
I downloaded the kudzu.src.rpm from ftp.redhat.com and rebuilt with rpmbuild --rebuild. Perhaps one could look at the build history of kudzu RPM?

--> Rebuilt RPM
# md5sum $LOCALDIR/kudzu-devel-1.2.57.1.26-1.x86_64.rpm 10bc1e89e5fb05f269b27b364e1afab0 /usr/src/redhat/RPMS/x86_64//kudzu-devel-1.2.57.1.26-1.x86_64.rpm

--> 5.6 Distro RPM
# md5sum $DISTDIR/kudzu-devel-1.2.57.1.26-1.el5.centos.x86_64.rpm
7a956c285f308225c37dc6286a9dc6ee /export/rocks/install/rolls/CentOS/5.6/x86_64/RedHat/RPMS//kudzu-devel-1.2.57.1.26-1.el5.centos.x86_64.rpm

-- Install rpm from distro
# rpm -Uvh --force $DISTDIR/kudzu-devel-1.2.57.1.26-1.el5.centos.x86_64.rpm
Preparing... ########################################### [100%]
   1:kudzu-devel ########################################### [100%]
-- Compile, run. FAIL
# gcc -o usbtest usb1.c /usr/lib64/libkudzu.a /usr/lib64/libpci.a -l resolv -l z
# ./usbtest
looking for usb controllers ... Segmentation fault

-- Install locally rebuilt rpm from srpm.
# rpm -Uvh --force $LOCALDIR/kudzu-devel-1.2.57.1.26-1.x86_64.rpm
Preparing... ########################################### [100%]
   1:kudzu-devel ########################################### [100%]

-- Compile, run. SUCCEED
# gcc -o usbtest usb1.c /usr/lib64/libkudzu.a /usr/lib64/libpci.a -l resolv -l z
# ./usbtest
looking for usb controllers ... controller found
#
Charlie Brady

Charlie Brady

2011-04-20 23:19

reporter   ~0012659

I can confirm the same issue with 32bit build.

Perhaps CentOS's kudzu is linked with older pcilib:

http://www.rhn.redhat.com/errata/RHBA-2011-0133.html

An updated kudzu package is available that fixes an incompatibility with the
current version of pciutils.

pciutils has been upgraded to version 3.1.7 in Red Hat Enterprise Linux 5.6.
This update changed the ABI of the static libpci library. Any application that
links against the new libpci and the older libkudzu would crash.
Charlie Brady

Charlie Brady

2011-04-20 23:30

reporter   ~0012660

Could this explain this message from Karanbir:

http://osdir.com/ml/centos-devel/2011-04/msg00118.html

 We had quite a lot of issues getting anaconda to
 build and the final builds were actually done by hand.
Charlie Brady

Charlie Brady

2011-04-20 23:33

reporter   ~0012661

Can we have:

kudzu-1.2.57.1.26-1.el5.centos.src.rpm

please? I'd like to know whether this is a build problem or a patch problem.
Charlie Brady

Charlie Brady

2011-04-20 23:43

reporter   ~0012662

> I'd like to know whether this is a build problem or a patch problem.

There's also a validation problem here - how was kudzu-devel validated against upstread?
cheath

cheath

2011-05-03 02:45

reporter   ~0012700

We now have kudzu-1.2.57.1.26-1.el5.centos.src.rpm, and I found that a local rebuild fixes it. Please can you rebuild, test, and release?

I can see how the problem was not caught by validation: because all files in kudzu and kudzu-devel are linked statically with libpci, no mismatched symbols were found.
toracat

toracat

2011-05-03 16:27

manager   ~0012701

It looks like the same issue exists in RHEL 5.6. Therefore, this needs to be reported upstream as, being a bug-for-bug clone, CentOS cannot fix it.
Charlie Brady

Charlie Brady

2011-05-03 16:44

reporter   ~0012702

> It looks like the same issue exists in RHEL 5.6.

Really? I don't have RHEL 5.6 binary, so I have no evidence that it exists upstream. If you do have evidence, then you should report the problem upstream.

Why do you say "It looks like the same issue exists in RHEL 5.6"? What have you seen?
toracat

toracat

2011-05-03 16:59

manager   ~0012703

Maybe I spoke too soon :-( [thus the term "looks like"]

This is what I saw:

- compiled usbtest on CentOS 5.6. It yielded segfault on both CentOS 5.6 and RHEL 5.6.

- compiled usbtest on RHEL 5.6. It did not cause segfault.
toracat

toracat

2011-05-04 01:02

manager   ~0012704

Last edited: 2011-05-04 21:03

To summarize the situation ...

As has already been pointed out in this bug report, the root cause of the issue is that CentOS kudzu[-devel] was not built with the current / latest version of libpci-devel in place.

According to http://www.rhn.redhat.com/errata/RHBA-2011-0133.html
( kudzu bug fix update )

"This update rebuilds kudzu to match the current libpci. (BZ#663395)"

CentOS pciutils-devel ( 3.1.7-3.el5 ) has: Build Date: Sun 20 Feb 2011 02:06:16 PM PST

CentOS kudzu-devel ( 1.2.57.1.26-1.el5.centos ) has: Build Date: Mon 31 Jan 2011 03:25:43 PM PST

It is likely that kudzu-devel was built with an earlier version of pciutils-devel, thus the mismatch issue.

JohnnyHughes

JohnnyHughes

2011-05-04 20:47

administrator   ~0012715

Please check these RPMs and make sure they work and I will sign and release them:

http://people.centos.org/hughesjr/kudzu/
toracat

toracat

2011-05-04 21:02

manager   ~0012716

I confirm that the revised version fixes the issue.
JohnnyHughes

JohnnyHughes

2011-05-04 21:21

administrator   ~0012717

The new packages created from kudzu-1.2.57.1.26-1.el5.centos.1.src.rpm have been released, this issue has been resolved.

Issue History

Date Modified Username Field Change
2011-04-14 05:23 papadopoulos New Issue
2011-04-14 18:08 papadopoulos Note Added: 0012625
2011-04-20 23:19 Charlie Brady Note Added: 0012659
2011-04-20 23:30 Charlie Brady Note Added: 0012660
2011-04-20 23:33 Charlie Brady Note Added: 0012661
2011-04-20 23:43 Charlie Brady Note Added: 0012662
2011-05-03 02:45 cheath Note Added: 0012700
2011-05-03 16:27 toracat Note Added: 0012701
2011-05-03 16:44 Charlie Brady Note Added: 0012702
2011-05-03 16:59 toracat Note Added: 0012703
2011-05-04 01:02 toracat Note Added: 0012704
2011-05-04 01:10 toracat Status new => acknowledged
2011-05-04 20:47 JohnnyHughes Note Added: 0012715
2011-05-04 20:55 toracat Status acknowledged => assigned
2011-05-04 21:02 toracat Note Added: 0012716
2011-05-04 21:03 toracat Note Edited: 0012704
2011-05-04 21:21 JohnnyHughes Note Added: 0012717
2011-05-04 21:21 JohnnyHughes Status assigned => closed
2011-05-04 21:21 JohnnyHughes Resolution open => fixed