From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050511 Description of problem: Immediately after installing FC4, I logged in as a user, did an sus to root, and tried to execute rpm. Any rpm command would immediately fail as follows: [root@localhost ns7]# rpm -qa rpmdb: unable to initialize mutex: Function not implemented error: cannot open Packages index using db3 - Function not implemented (38) error: cannot open Packages database in /var/lib/rpm I was able to execute unprivileged rpm commands as a user, and I was able to use rpm normally when logged in as root, but not under su. Version-Release number of selected component (if applicable): rpm -qa How reproducible: Always Steps to Reproduce: 1.Log in as normal user 2.su to root 3.execute any rpm command Actual Results: rpmdb: unable to initialize mutex: Function not implemented error: cannot open Packages index using db3 - Function not implemented (38) error: cannot open Packages database in /var/lib/rpm Expected Results: In the case of "rpm -qa", all installed RPMs should have been listed. Additional info:
DO you have NPTL enabled in your kernel and glibc? rpm expects shared posix mutexes.
I have the default FC4 configuration. As noted, rpm works fine under a native login, either as a user or as root, so the kernel and glibc must have the necessary features. It only fails when I su to root.
Only root can create locks because /var/lib/rpm/__db* are usually RDONLY. Change the permissions on /var/lib/rpm files temporarily to permit some user access, and you should see the same problem. Run an strac on the root command that is failing, and I should be able to tell more precisely what is fubar. The fix is gonna be with glibc and/or the kernel I'm almost positive however.
Created attachment 115762 [details] strace output on rpm -qa when executed as "su root"
I had exactly the same problem. Attached is the strace output. How do I know if I am running an NPTL kernel/glibc? I am using the default FC4 configuration.
The strace is not showing a syscall, so I can't pin down details. No matter what, the error message displayed is precise. You are trying to run rpm+db4 which is compiled for an NPTL environment on a non-NPTL system. Default FC4 has NPTL enabled. Something else is misconfigured on your system, like installing "i386" rather than "i686" glibc (i.e. glibc.i386 is compiled w/o NPTL).
I did not have a chance to choose i686/i386 for glibc (or any other packages): it was picked for me automatically by the installer. In any case, my glibc appears to be i686 (the glibc package installed some files under /lib/i686/). I just discovered the problem. In my startup files for my shell, I had LD_ASSUME_KERNEL=2.4.1 because there was some software that required this a long time ago (I have to check if it still does). Once I removed this everything works as expected. My clue was that I can get things to work when I used "su - root" instead of "su root", which pointed me to look at the environment.
Yep, LD_ASSUME_KERNEL explains -NPTL.
That was my problem also. I am setting this to Resolved: NOTABUG.