308009 |
28-Oct-2016 |
jhb |
MFC 303002: Include process IDs in core dumps.
When threads were added to the kernel, the pr_pid member of the NT_PRSTATUS note was repurposed to store LWP IDs instead of process IDs. However, the process ID was no longer recorded in core dumps. This change adds a pr_pid field to prpsinfo (NT_PRSINFO). Rather than bumping the prpsinfo version number, note parsers can use the note's payload size to determine if pr_pid is present. |
299458 |
11-May-2016 |
cem |
Fix buffer overrun in gcore(1) NT_PRPSINFO
Use size of destination buffer, rather than a constant that may or may not correspond to the source buffer, to restrict the length of copied strings. In particular, pr_fname has 16+1 characters but MAXCOMLEN is 18+1.
Use strlcpy instead of strncpy to ensure the result is nul-terminated. This seems to be what is expected of these fields.
Reported by: Coverity CIDs: 1011302, 1011378 Sponsored by: EMC / Isilon Storage Division
|
281266 |
08-Apr-2015 |
jhb |
Move the 32-bit compatible procfs types from freebsd32.h to <sys/procfs.h> and export them to userland. - Define __HAVE_REG32 on platforms that define a reg32 structure and check for this in <sys/procfs.h> to control when to export prstatus32, etc. - Add prstatus32_t and prpsinfo32_t typedefs for the 32-bit structures. libbfd looks for these types, and having them fixes 'gcore' in gdb of a 32-bit process on a 64-bit platform. - Use the structure definitions from <sys/procfs.h> in gcore's elf32 core dump code instead of duplicating the definitions.
Differential Revision: https://reviews.freebsd.org/D2142 Reviewed by: kib, nathanw (powerpc bits) MFC after: 1 week
|
215679 |
22-Nov-2010 |
attilio |
Add the ability for GDB to printout the thread name along with other thread specific informations.
In order to do that, and in order to avoid KBI breakage with existing infrastructure the following semantic is implemented: - For live programs, a new member to the PT_LWPINFO is added (pl_tdname) - For cores, a new ELF note is added (NT_THRMISC) that can be used for storing thread specific, miscellaneous, informations. Right now it is just popluated with a thread name.
GDB, then, retrieves the correct informations from the corefile via the BFD interface, as it groks the ELF notes and create appropriate pseudo-sections.
Sponsored by: Sandvine Incorporated Tested by: gianni Discussed with: dim, kan, kib MFC after: 2 weeks
|
210063 |
14-Jul-2010 |
attilio |
Fix the way the segments are included in the gcore outputs (with the default invokation): - Right now if segments are not writable are not included. Remove this. - Right now if a segment is mapped with NOCORE the check is not honoured. Change this by checking the newly added flag, from libutil, KVME_FLAG_NOCOREDUMP.
Besides that, add a new flag (-f) that forces a 'full' dump of all the segments excluding just the malformed ones. This might be used very carefully as, among the reported segments, there could be memory mapped areas that could be vital to program execution.
Sponsored by: Sandvine Incorporated Discussed with: kib Reviewed by: emaste Tested by: Sandvine Incorporated MFC after: 2 weeks
|
199805 |
25-Nov-2009 |
attilio |
Change gcore in order to get rid of the procfs accesses and use FreeBSD's specific sysctls and ptrace interfaces. This change switches a bit gcore POLA that is summarized here: - now gcore can recognize threads within the process and handle dumps on thread-scope - the process to be analyzed will be stopped during its gcore run - gcore may not work with processes which are actively being analyzed by gdb or truss - the ptrace interface may cause syscalls to return EINTR, thus interferring with signals handling within the process
Side note: <janitor task> the interface can be further lifted in order to get rid of the very last procfs interfaces remnants and made more suitable for copying with sysctl/ptrace interface </janitor task>.
Obtained from: Sandvine Incorporated Reviewed by: emaste, rwatson Sponsored by: Sandvine Incorporated MFC: 1 month
|
69896 |
12-Dec-2000 |
mckusick |
Change the proc information returned from the kernel so that it no longer contains kernel specific data structures, but rather only scalar values and structures that are already part of the kernel/user interface, specifically rusage and rtprio. It no longer contains proc, session, pcred, ucred, procsig, vmspace, pstats, mtx, sigiolst, klist, callout, pasleep, or mdproc. If any of these changed in size, ps, w, fstat, gcore, systat, and top would all stop working. The new structure has over 200 bytes of unassigned space for future values to be added, yet is nearly 100 bytes smaller per entry than the structure that it replaced.
|
59342 |
18-Apr-2000 |
obrien |
Change our ELF binary branding to something more acceptable to the Binutils maintainers.
After we established our branding method of writing upto 8 characters of the OS name into the ELF header in the padding; the Binutils maintainers and/or SCO (as USL) decided that instead the ELF header should grow two new fields -- EI_OSABI and EI_ABIVERSION. Each of these are an 8-bit unsigned integer. SCO has assigned official values for the EI_OSABI field. In addition to this, the Binutils maintainers and NetBSD decided that a better ELF branding method was to include ABI information in a ".note" ELF section.
With this set of changes, we will now create ELF binaries branded using both "official" methods. Due to the complexity of adding a section to a binary, binaries branded with ``brandelf'' will only brand using the EI_OSABI method. Also due to the complexity of pulling a section out of an ELF file vs. poking around in the ELF header, our image activator only looks at the EI_OSABI header field.
Note that a new kernel can still properly load old binaries except for Linux static binaries branded in our old method.
* * For a short period of time, ``ld'' will also brand ELF binaries * using our old method. This is so people can still use kernel.old * with a new world. This support will be removed before 5.0-RELEASE, * and may not last anywhere upto the actual release. My expiration * time for this is about 6mo. *
|
48792 |
12-Jul-1999 |
nik |
Add $Id$, to make it simpler for members of the translation teams to track.
The $Id$ line is normally at the bottom of the main comment block in the man page, separated from the rest of the manpage by an empty comment, like so;
.\" $Id$ .\"
If the immediately preceding comment is a @(#) format ID marker than the the $Id$ will line up underneath it with no intervening blank lines. Otherwise, an additional blank line is inserted.
Approved by: bde
|
38522 |
24-Aug-1998 |
wosch |
Check the text segment size of the executable and the process. If not equal, the command line arguments are wrong. E.g.:
$./gcore /bin/sh 1761
$ ./gcore /usr/tmp/chroot/bin/sh 1761 gcore: The executable /usr/tmp/chroot/bin/sh does not belong to process 1761! Text segment size (in bytes): executable 303104, process 294912
|