Bug 90648

Summary: rpmlib can lock against itself
Product: [Retired] Red Hat Linux Reporter: Greg Hudson <ghudson>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED NOTABUG QA Contact: Mike McLean <mikem>
Severity: low Docs Contact:
Priority: medium    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-05-12 14:56:35 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:
Attachments:
Description Flags
Test program illustrating rpmlib hang none

Description Greg Hudson 2003-05-11 21:51:47 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030406

Description of problem:
If you create an rpm iterator with rpmtsInitIterator() and don't free it before
running rpmtsRun() or possibly other things, rpmlib will hang in futex() trying
to lock against itself.

This is arguably a programmer error (though I'm not aware of any documentation
saying that you can't do this), but some assertions seem warranted if so.

I will attached a test program illustrating the hang.


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

How reproducible:
Always

Steps to Reproduce:
1. Build the attached test program with:
   cc -I/usr/include/rpm rpmtest.c -o rpmtest -lrpm
2. Run it on a system with the ash rpm installed.


Additional info:

Comment 1 Greg Hudson 2003-05-11 21:52:34 UTC
Created attachment 91611 [details]
Test program illustrating rpmlib hang

Comment 2 Jeff Johnson 2003-05-12 14:56:35 UTC
Yup, a (shared) read lock will prevent an (exclusive) write lock
on the same object.

"Don't do that" is a bit nicer than "Programmer error.", as concurrent
access works just fine in Berkeley DB used by rpm-4.2-1.