Bug 230175 - sched_rr_get_interval(9) fails in 32-bit emulation
Summary: sched_rr_get_interval(9) fails in 32-bit emulation
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Konstantin Belousov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-30 01:57 UTC by Alan Somers
Modified: 2018-11-13 16:30 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Somers freebsd_committer freebsd_triage 2018-07-30 01:57:01 UTC
sched_rr_get_interval fails in 32-bit emulation.  It's supposed to fetch a timespec from kernelspace to userspace.  But it fetches the seconds value into the nanoseconds field.  To reproduce, run the i386 build of lib/librt/sched_test:sched_rr_get_interval_2 on a system with an amd64 kernel.  For example:

$ sudo chroot /root32 /bin/sh
# cd /usr/tests/lib/librt
# kyua debug sched_test:sched_rr_get_interval_2
sched_test:sched_rr_get_interval_2  ->  failed: /usr/home/somers/freebsd/base/head/contrib/netbsd-tests/lib/librt/t_sched.c:237: tv1.tv_sec == tv2.tv_sec not met
Comment 1 commit-hook freebsd_committer freebsd_triage 2018-07-31 17:15:48 UTC
A commit references this bug:

Author: kib
Date: Tue Jul 31 17:15:32 UTC 2018
New revision: 336980
URL: https://svnweb.freebsd.org/changeset/base/336980

Log:
  Provide compat32 shims for sched_rr_get_interval(2).

  The interface uses struct timespec, which needs a translation.

  Reported and reviewed by:	asomers
  PR:	230175
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week
  Differential revision:	https://reviews.freebsd.org/D16525

Changes:
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/compat/freebsd32/syscalls.master
Comment 2 commit-hook freebsd_committer freebsd_triage 2018-08-07 17:45:15 UTC
A commit references this bug:

Author: kib
Date: Tue Aug  7 17:44:14 UTC 2018
New revision: 337427
URL: https://svnweb.freebsd.org/changeset/base/337427

Log:
  MFC r336980:
  Provide compat32 shims for sched_rr_get_interval(2).

  PR:	230175

Changes:
_U  stable/11/
  stable/11/sys/compat/freebsd32/freebsd32_misc.c
  stable/11/sys/compat/freebsd32/syscalls.master