Bug 877742

Summary: rpm --verify coredumps on read error in files verified
Product: [Fedora] Fedora Reporter: Stuart D Gathman <stuart>
Component: rpmAssignee: Fedora Packaging Toolset Team <packaging-team>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 16CC: ffesti, jnovy, jzeleny, packaging-team, pknirsch, pmatilai
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-11-19 12:03:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Stuart D Gathman 2012-11-18 13:24:45 UTC
Description of problem:
When verifying an RPM on a disk with media errors, rpm gets Bus Error (core dump) if it encounters an IO error while reading a file to compute the checksum.

Version-Release number of selected component (if applicable):
rpm-4.9.1.3-1.fc16.i686

How reproducible:
Always

Steps to Reproduce:
1. Use a disk with real errors, or error simulating block device for filesystem.
2. Install package foo, create IO error in a file belonging to foo
3. Do stuff to drop files of foo from block cache.  Run rpm -V foo
  
Actual results:
Bus Error (core dumped)

Expected results:
At the very least, something like "read: IO Error".  Ideally, the error message should mention which file it was reading!  

Additional info:
I'm guessing that verify uses mmap instead of read, complicating error handling.

Comment 1 Stuart D Gathman 2012-11-18 13:31:06 UTC
It would be super handy, when dealing with disk errors in the field in places with no electronics store handy, if rpm would not only report the file with an error, but flag it with an E (for Error) it its report and keep processing.  It would be acceptable if this required a command line option to use read() instead of mmap() to simplify error handling (at the cost of performance).

Current procedure is to tail /var/log/messages to find block # of failure, run lbatofile.py to discover filename.  Rename file, rerun rpm -V (which now reports the file as "missing" - much better than a core dump).

Comment 2 Panu Matilainen 2012-11-19 12:03:13 UTC

*** This bug has been marked as a duplicate of bug 854798 ***