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)
Tue, Dec 10, 12:54 PM
Unknown Object (File)
Fri, Nov 29, 4:31 AM
Unknown Object (File)
Oct 27 2024, 11:06 AM
Unknown Object (File)
Oct 17 2024, 2:27 AM
Unknown Object (File)
Oct 4 2024, 7:51 AM
Unknown Object (File)
Oct 2 2024, 6:41 PM
Unknown Object (File)
Oct 2 2024, 4:43 AM
Unknown Object (File)
Oct 1 2024, 11:28 PM
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 Passed
Unit
No Test Coverage
Build Status
Buildable 4432
Build 4482: arc lint + arc unit

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

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

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.