Page MenuHomeFreeBSD

Include command line arguments in core dump process info.
ClosedPublic

Authored by jhb on Jul 5 2016, 7:37 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 29, 7:15 PM
Unknown Object (File)
Mon, Apr 29, 6:23 PM
Unknown Object (File)
Tue, Apr 23, 3:14 PM
Unknown Object (File)
Apr 2 2024, 11:09 PM
Unknown Object (File)
Feb 9 2024, 1:21 PM
Unknown Object (File)
Feb 2 2024, 7:16 PM
Unknown Object (File)
Dec 20 2023, 12:14 AM
Unknown Object (File)
Dec 19 2023, 9:10 AM
Subscribers

Details

Summary

Include command line arguments in core dump process info.

Fill in pr_psargs in the NT_PRSINFO ELF core dump note with command
line arguments.

Test Plan
  • generate core dumps with the change and open them in gdb
  • was not able to test lldb as lldb doesn't examine NT_PRSINFO on FreeBSD at all (and it uses the Linux PRSTATUS parser on FreeBSD cores which is wrong. Fixing lldb means writing ELF core note parsers for the FreeBSD core notes).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb retitled this revision from to Include command line arguments in core dump process info..
jhb updated this object.
jhb edited the test plan for this revision. (Show Details)
jhb added reviewers: kib, emaste.
sys/kern/imgact_elf.c
1851 ↗(On Diff #18158)

I think this is too limiting. If p_args is NULL, you should use proc_getargv() to read the arguments from the process UVA directly. p_args is not guaranteed to exist.

sys/kern/imgact_elf.c
1851 ↗(On Diff #18158)

Humm, I guess I could do that. Note that pr_psargs is only 80 chars long. One thing that is annoying about proc_get_argv() is that I'll need to change it to take a maxlength, but I can do that. (I guess I had assumed that this is less useful if you have a really long command line and that any short command lines should have a valid p_args)

  • Use proc_getargv() if p_args is NULL.
  • Set len in the proc_getargv() case to avoid trashing random memory.
  • Fix 'len' when the sbuf overflows.
kib edited edge metadata.
This revision is now accepted and ready to land.Jul 9 2016, 3:20 PM
This revision was automatically updated to reflect the committed changes.