Page MenuHomeFreeBSD

Store a 32-bit PT_LWPINFO struct for 32-bit process core dumps.
ClosedPublic

Authored by jhb on Jun 29 2017, 4:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 14 2024, 11:27 AM
Unknown Object (File)
Dec 28 2023, 7:37 AM
Unknown Object (File)
Dec 22 2023, 10:28 PM
Unknown Object (File)
Dec 13 2023, 4:52 PM
Unknown Object (File)
Nov 12 2023, 10:33 PM
Unknown Object (File)
Nov 11 2023, 6:53 PM
Unknown Object (File)
Nov 10 2023, 6:40 PM
Unknown Object (File)
Nov 9 2023, 3:46 PM
Subscribers

Details

Summary

Process core notes for a 32-bit process running on a 64-bit host need to
use 32-bit structures so that the note layout matches the layout of notes
of a core dump of a 32-bit process under a 32-bit kernel.

TODO: This is just the kernel part, I still need to fix gcore, and for
gcore since I need to export ptrace_lwpinfo32 to userland I'm going to
need to move various structures out of compat32-specific headers and
into sys/foo.h headers.

Test Plan
  • Using a patched gdb with support for reading $_siginfo from core dumps I verified $_siginfo is now correct for i386 core dumps on amd64.

Diff Detail

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

Event Timeline

Move structure definitions into sys/ headers.

Patch gcore to store 32-bit lwpinfo notes as well.

This is now ready for review. I've patched gcore and tested it with i386 and amd64 binaries on an amd64 host.

sys/sys/signal.h
179 ↗(On Diff #30219)

This definition pollute user namespace. I suggest you to look at sys/stat.h and use of _WANT_FREEBSD11_STAT as an example of handling similar case.

270 ↗(On Diff #30219)

Same there.

Use _WANT_LWPINFO32 to guard siginfo32 and ptrace_lwpinfo32 declarations.

sys/sys/signal.h
178 ↗(On Diff #30232)

COMPAT_FREEBSD32 is also user symbol. Why not use _KERNEL and _LP64 ?

Replace COMPAT_FREEBSD with _KERNEL && LP64.

This revision is now accepted and ready to land.Jun 29 2017, 9:20 PM
This revision was automatically updated to reflect the committed changes.