From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030108 Description of problem: Using the attached sample program to erase the ash rpm, I get an odd inconsistency from "rpm -q ash": -bash-2.05b# cc -static -I/usr/include/rpm sample.c -o sample -lrpm -lrpmio -lrpmdb -lpopt -lz -lbz2 -lpthread -lelf -bash-2.05b# rpm -i ash-0.3.8-8.i386.rpm warning: ash-0.3.8-8.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e -bash-2.05b# rpm -q ash ash-0.3.8-8 -bash-2.05b# ./sample -bash-2.05b# rpm -q ash ash-0.3.8-8 -bash-2.05b# su daemon -c 'rpm -q ash' package ash is not installed -bash-2.05b# rpm -q ash ash-0.3.8-8 -bash-2.05b# rpm -qa | grep '^ash' -bash-2.05b# rpm -q ash package ash is not installed This behavior seems eminently reproducible. I can get it with either rpm-4.2-1 or Red Hat 9's native rpm-4.2-0.69. "rpm -e ash" does not seem to cause the same problem, even though it makes a very similar series of rpmts calls. I have seen the problem on two different machines, and starting with "rpm --rebuilddb" doesn't change anything, so I don't think this is a problem specific to borked databases. Occasionally the rpm -qa command will produce an error message like: error: rpmdbNextIterator: skipping h# 809 region trailer: BAD, tag 1650864740 type 1664692837 offset -858995046 count 909456944 but usually it does not. Version-Release number of selected component (if applicable): rpm-4.2-1 How reproducible: Always Steps to Reproduce: 1. Compile attached sample program against rpm-4.2-0.69 or rpm-4.2-1. 2. Run it on a machine with the ash rpm installed. 3. Note that "rpm -q ash" run as root still reports the ash rpm. 4. Note that "rpm -q ash" run as non-root does not report the ash rpm. 5. Note that "rpm -qa | grep '^ash'" does not report the ash rpm. 6. Note that after step 5, "rpm -q ash" run as root no longer reports the ash rpm. Additional info:
Created attachment 91651 [details] Test program to cause rpm -q inconsistency
I believe you need -L/usr/lib/nptl when linking statically with posix mutexes in libpthread. Alternatively (and the pathway rpm has chosen, there are many reasons) is to abandon static linking until the NPTL transition is over. I don't think I have a prayer of reproducing this problem locally, so I'm gonna close. Feel free to reopen if you need more help.
BTW, the cryptic error message is an indication of data inconsistency. If you choose a package that has a header SHA1 (i.e. a package built with rpm-4.1 or later) tag, you will get a stronger test of header data consistency than the sanity check on values, which, of necessity, cannot ever be perfect. Any package displayed by rpm -qavv 2>&1 | grep OK | grep -v sanity has a header SHA1 digest.