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)
Fri, May 3, 5:17 AM
Unknown Object (File)
Fri, May 3, 5:17 AM
Unknown Object (File)
Fri, May 3, 5:17 AM
Unknown Object (File)
Fri, May 3, 5:16 AM
Unknown Object (File)
Fri, May 3, 5:16 AM
Unknown Object (File)
Fri, May 3, 5:16 AM
Unknown Object (File)
Fri, May 3, 5:16 AM
Unknown Object (File)
Thu, May 2, 10:54 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 Passed
Unit
No Test Coverage
Build Status
Buildable 10203
Build 10624: arc lint + arc unit

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

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

Same there.

Use _WANT_LWPINFO32 to guard siginfo32 and ptrace_lwpinfo32 declarations.

sys/sys/signal.h
178

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.