Bug 206543 - tools/regression/sockets/unix_cmsg:t_cmsg_len doesn't pass on 64-bit archs; likely passes on 32-bit archs by accident
Summary: tools/regression/sockets/unix_cmsg:t_cmsg_len doesn't pass on 64-bit archs; l...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: tests (show other bugs)
Version: 10.2-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-testing mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-23 22:19 UTC by Enji Cooper
Modified: 2019-01-21 18:28 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 Enji Cooper freebsd_committer 2016-01-23 22:19:17 UTC
If I use amd64, the "Check cmsghdr.cmsg_len" (t_cmsg_len) testcase will fail. If I use i386 however, it passes.

I suspect (based on the size discrepancy) that one or more fields are being sized incorrectly (as pointers instead of scalars).

In particular, the amount sent when testing on i386 is 96 bytes, whereas on amd64 it's 104 bytes. The reason why this is happening is the sizes in one of the fields mismatch (another bug is coming soon for this hidden requirement buried in the kernel).

amd64:

$ cd tools/regression/sockets/unix_cmsg
$ make -s clean
$ make -s all
$ ./unix_cmsg
Running tests for SOCK_STREAM sockets:
  1: Sending, receiving cmsgcred
  2: Receiving sockcred (listening socket)
  3: Receiving sockcred (accepted socket)
  4: Sending cmsgcred, receiving sockcred
  5: Sending, receiving timeval
  6: Sending, receiving bintime
  7: Check cmsghdr.cmsg_len
CLIENT: sent message with cmsghdr.cmsg_len 12 < 16
SERVER: client exit status is 1
  8: Check LOCAL_PEERCRED socket option
-- 1 test failed!
Running tests for SOCK_DGRAM sockets:
  1: Sending, receiving cmsgcred
  2: Receiving sockcred
  3: Sending cmsgcred, receiving sockcred
  4: Sending, receiving timeval
  5: Sending, receiving bintime
  6: Check cmsghdr.cmsg_len
CLIENT: sent message with cmsghdr.cmsg_len 12 < 16
SERVER: client exit status is 1
-- 1 test failed!

i386:

$ cd tools/regression/sockets/unix_cmsg
$ make -s clean
$ make -s all
$ ./unix_cmsg
Running tests for SOCK_STREAM sockets:
  1: Sending, receiving cmsgcred
  2: Receiving sockcred (listening socket)
  3: Receiving sockcred (accepted socket)
  4: Sending cmsgcred, receiving sockcred
  5: Sending, receiving timeval
  6: Sending, receiving bintime
  7: Check cmsghdr.cmsg_len
  8: Check LOCAL_PEERCRED socket option
-- all tests passed!
Running tests for SOCK_DGRAM sockets:
  1: Sending, receiving cmsgcred
  2: Receiving sockcred
  3: Sending cmsgcred, receiving sockcred
  4: Sending, receiving timeval
  5: Sending, receiving bintime
  6: Check cmsghdr.cmsg_len
-- all tests passed!
$ uname -a
FreeBSD fbsd11-i386.local 11.0-CURRENT FreeBSD 11.0-CURRENT #1 r293737M: Tue Jan 12 09:48:34 PST 2016     ngie@fbsd11-i386.local:/usr/obj/usr/src/svn/sys/GENERIC-NODEBUG  i386
Comment 1 commit-hook freebsd_committer 2016-01-23 22:26:23 UTC
A commit references this bug:

Author: ngie
Date: Sat Jan 23 22:26:05 UTC 2016
New revision: 294643
URL: https://svnweb.freebsd.org/changeset/base/294643

Log:
  Don't run t_cmsg_len on 64-bit architectures; it always fails when
  trying to send through the sendit(9) KPI in the kernel due to a size
  mismatch between the msghdr and data being sent, that suspiciously
  seems like it's related to sizeof pointers instead of scalars, or
  something of that ilk

  PR: 206543
  Sponsored by: EMC / Isilon Storage Division

Changes:
  user/ngie/socket-tests/tools/regression/sockets/unix_cmsg/unix_cmsg.c
Comment 2 commit-hook freebsd_committer 2016-01-23 22:49:26 UTC
A commit references this bug:

Author: ngie
Date: Sat Jan 23 22:49:14 UTC 2016
New revision: 294646
URL: https://svnweb.freebsd.org/changeset/base/294646

Log:
  Don't run the t_cmsg_len testcase on 64-bit architectures

  It always fails when trying to send through the sendit(9) private KPI in the
  kernel due to a size mismatch between the msghdr and data being sent [*], which
  suspiciously seems like it's related to sizeof pointers instead of scalars, or
  something of that ilk

  MFC after: 1 week
  PR: 206543, 206544 [*]
  Sponsored by: EMC / Isilon Storage Division

Changes:
_U  head/
  head/tools/regression/sockets/unix_cmsg/unix_cmsg.c
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2016-01-25 08:24:13 UTC
Assign to committer as possible MFC reminder.
Comment 4 Enji Cooper freebsd_committer 2017-11-05 21:05:36 UTC
Probably related to (if not a duplicate of) bug 199478.
Comment 5 Oleksandr Tymoshenko freebsd_committer freebsd_triage 2019-01-21 18:08:43 UTC
There is a commit referencing this PR, but it's still not closed and has been inactive for some time. Closing the PR as fixed but feel free to re-open it if the issue hasn't been completely resolved.

Thanks
Comment 6 Enji Cooper freebsd_committer 2019-01-21 18:28:27 UTC
Test hasn't been fixed. Reopening.