Bug 90648 - rpmlib can lock against itself
Summary: rpmlib can lock against itself
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm   
(Show other bugs)
Version: 9
Hardware: i686
OS: Linux
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact: Mike McLean
Depends On:
TreeView+ depends on / blocked
Reported: 2003-05-11 21:51 UTC by Greg Hudson
Modified: 2007-04-18 16:53 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-05-12 14:56:35 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Test program illustrating rpmlib hang (735 bytes, text/plain)
2003-05-11 21:52 UTC, Greg Hudson
no flags Details

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):

How reproducible:

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.

Note You need to log in before you can comment on or make changes to this bug.