Bug 206503 - [exp-run] Correct type of 'ss_sp' in stack_t and struct sigstack
Summary: [exp-run] Correct type of 'ss_sp' in stack_t and struct sigstack
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: John Baldwin
URL: https://github.com/freebsd/freebsd/co...
Keywords: needs-qa, patch
Depends on:
Blocks:
 
Reported: 2016-01-22 19:28 UTC by John Baldwin
Modified: 2016-01-27 19:08 UTC (History)
1 user (show)

See Also:
koobs: exp-run?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Baldwin freebsd_committer freebsd_triage 2016-01-22 19:28:01 UTC
POSIX requires the 'ss_sp' fields in 'stack_t' (used with sigaltstack(2)) and 'struct sigstack' (used with sigstack(2)) to be declared as 'void *':

http://pubs.opengroup.org/onlinepubs/7908799/xsh/signal.h.html

However, FreeBSD defines these as 'char *' (and inherited this from 4BSD).

NetBSD changed their ss_sp to void * back in 1998 (1.27 of signal.h).  OpenBSD followed suit in 1.9 of their signal.h.

I suspect if anything this should reduce breakage in 3rd party software, but an exp-run can't hurt.

The patch is contained in the URL.  The majority of the patch is fixes to the kernel to compile with the change.  Only the change to sys/sys/signal.h is visible to userland, so you only need a new world with the patched signal.h for an exp-run.
Comment 2 commit-hook freebsd_committer freebsd_triage 2016-01-27 17:55:35 UTC
A commit references this bug:

Author: jhb
Date: Wed Jan 27 17:55:03 UTC 2016
New revision: 294930
URL: https://svnweb.freebsd.org/changeset/base/294930

Log:
  Convert ss_sp in stack_t and sigstack to void *.

  POSIX requires these members to be of type void * rather than the
  char * inherited from 4BSD.  NetBSD and OpenBSD both changed their
  fields to void * back in 1998.  No new build failures were reported
  via an exp-run.

  PR:		206503 (exp-run)
  Reviewed by:	kib
  MFC after:	1 week
  Differential Revision:	https://reviews.freebsd.org/D5092

Changes:
  head/sys/amd64/amd64/machdep.c
  head/sys/amd64/ia32/ia32_signal.c
  head/sys/amd64/linux/linux_sysvec.c
  head/sys/amd64/linux32/linux32_sysvec.c
  head/sys/arm/arm/machdep.c
  head/sys/arm64/arm64/machdep.c
  head/sys/arm64/arm64/vm_machdep.c
  head/sys/i386/i386/machdep.c
  head/sys/i386/linux/linux_sysvec.c
  head/sys/i386/svr4/svr4_machdep.c
  head/sys/mips/mips/freebsd32_machdep.c
  head/sys/mips/mips/pm_machdep.c
  head/sys/mips/mips/vm_machdep.c
  head/sys/powerpc/powerpc/exec_machdep.c
  head/sys/sparc64/sparc64/machdep.c
  head/sys/sys/signal.h