Bug 585843
Summary: | lsof does not spot files open by a thread which does not share its father's fd table | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Jerome Marchand <jmarchan> | ||||||
Component: | lsof | Assignee: | Peter Schiffer <pschiffe> | ||||||
Status: | CLOSED NEXTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | low | ||||||||
Version: | 14 | CC: | kzak | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2012-05-24 13:24:56 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: |
|
This bug appears to have been reported against 'rawhide' during the Fedora 14 development cycle. Changing version to '14'. More information and reason for this action is here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component. Hi Jerome, I am not able to compile your reproducer on F17 because of the following error: $ gcc clonenofd.c -o clonenofd clonenofd.c: In function ‘main’: clonenofd.c:41:17: error: ‘CLONE_THREAD’ undeclared (first use in this function) clonenofd.c:41:17: note: each undeclared identifier is reported only once for each function it appears in clonenofd.c:41:32: error: ‘CLONE_SIGHAND’ undeclared (first use in this function) clonenofd.c:41:48: error: ‘CLONE_VM’ undeclared (first use in this function) Please, do you know how to fix it? Thanks, peter Created attachment 580218 [details]
Reproducer (fixed)
_GNU_SOURCE should be defined before including the first header. This version of the reproducer corrects that.
Jerome, I've just find out, that if you want to list tasks of processes, you have to use -K option: $ lsof -aK -c clonenofd | grep /tmp clonenofd 23065 23066 schiffer 3u REG 8,3 0 1705804 /tmp/foo.x6fJhf Please, confirm that this is what you need. Thanks, peter Yes this is correct. This -K option has been added to lsof 4.84. Thanks. Since lsof 4.84 is available in F15, I am closing this as NEXTRELEASE. |
Created attachment 409106 [details] Reproducer Description of problem: lsof does not spot files open by a thread which does not share its father's fd table. Version-Release number of selected component (if applicable): How reproducible: Always. Steps to Reproduce: 1. ./clonenofd& 2. lsof -c clonenofd |grep /tmp 3. Actual results: No opened file in /tmp/ directory is displayed by lsof. Expected results: It should displays a line like the following: clonenofd 4985 root 3u REG 253,0 0 144152 /tmp/foo.QPKwSV Additional info: There is a bug in kernel that make /proc/<pid>/task/<tid>/fdinfo/ gives the link to open files, like /proc/<pid>/task/<tid>/fd/. You may have to wait for that to be solved in order to be able to show offsets correctly. I've posted a patch against that recently.