Bug 821419

Summary: RFE: Make accessible mapped + deleted files (shared libraries)
Product: [Fedora] Fedora Reporter: Jan Kratochvil <jan.kratochvil>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: gansalmon, itamar, jan.kratochvil, jonathan, kernel-maint, madhu.chinakonda
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-05-14 15:21:26 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 Jan Kratochvil 2012-05-14 12:44:21 UTC
Description of problem:
If a process is running its executable + shared libraries may be already deleted. If that process crashes we can no longer analyse the core file as its shared libraries are no longer available

Currently one has to create whole new chroot with the older libraries installed, this is very time consuming (ABRT Retrace Server).  One could just download the older separate .debug files and using the libraries which were available at the core dumping time.

Version-Release number of selected component (if applicable):
kernel-3.3.5-2.fc16.x86_64

How reproducible:
Always.

Steps to Reproduce:
xz >/dev/null & p=$!; yum some downgrade/update; cat /proc/$p/maps

Actual results:
No way to access /usr/lib64/liblzma.so.5.0.99.
$ cat /proc$p/maps
39cfe00000-39cfe23000 r-xp 00000000 00:11 27528913 /usr/lib64/liblzma.so.5.0.99 (deleted)
39cfe23000-39d0023000 ---p 00023000 00:11 27528913 /usr/lib64/liblzma.so.5.0.99 (deleted)
39d0023000-39d0024000 r--p 00023000 00:11 27528913 /usr/lib64/liblzma.so.5.0.99 (deleted)
39d0024000-39d0025000 rw-p 00024000 00:11 27528913 /usr/lib64/liblzma.so.5.0.99 (deleted)

Expected results:
Make them accessible for example by:
cat /proc/$p/mappedfiles/00:11-27528913 >/tmp/liblzma.so.5.0.99

Additional info:
The executable itself is already accessible as /proc/$p/exe.
One can 'cat' it out even if it is already deleted during core dumping time by /proc/sys/kernel/core_pattern command.

Comment 1 Dave Jones 2012-05-14 15:21:26 UTC
I recommend bringing this up on lkml/linux-mm.