Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Nov 2012 16:50:45 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/173723: Add file descriptor information to process core dumps
Message-ID:  <201211191650.qAJGojuv019260@red.freebsd.org>
Resent-Message-ID: <201211191700.qAJH00UK033572@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         173723
>Category:       kern
>Synopsis:       Add file descriptor information to process core dumps
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 19 17:00:00 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     John Baldwin
>Release:        
>Organization:
>Environment:
>Description:
ELF core files already include metadata about processes including notes with the context of each running thread.  Occasionally I have wanted to examine the open fd's associated with a process while debugging.  With the advent of 'procstat -f' we now have a useful structure that holds file descriptor info in a somewhat abstract manner.  It seems possible that we could add a new set of notes to a core dump listing the various file descriptors associated with the process at the time of exit storing 'kinfo_file' objects in the relevant notes.  It is probably worth including additional notes for other "files" such as the working directory, etc. as show in 'procstat -f' output of a running process.

Once this is present there should be ways to extract the information from a core. One would be to teach libprocstat how to look for data from a core file (and thus procstat).  Another useful thing to do would be to add a new custom command to gdb to dump this table from within gdb.  Said command could use libprocstat to work against both coredumps and running processes.
>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211191650.qAJGojuv019260>