Bug 206544 - sendmsg(2) (sendto(2) too?) can fail with EINVAL; isn't documented in manpage
Summary: sendmsg(2) (sendto(2) too?) can fail with EINVAL; isn't documented in manpage
Status: Open
Alias: None
Product: Documentation
Classification: Unclassified
Component: Manual Pages (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-doc (Nobody)
Depends on:
Reported: 2016-01-23 22:33 UTC by Enji Cooper
Modified: 2019-06-25 23:46 UTC (History)
3 users (show)

See Also:


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:33:03 UTC
769 static int
 770 sendit(td, s, mp, flags)
 771         struct thread *td;
 772         int s;
 773         struct msghdr *mp;
 774         int flags;
 775 {
 796         if (mp->msg_control) {
 797                 if (mp->msg_controllen < sizeof(struct cmsghdr)
 798 #ifdef COMPAT_OLDSOCK
 799                     && mp->msg_flags != MSG_COMPAT
 800 #endif
 801                 ) {
 802                         error = EINVAL;
 803                         goto bad;
 804                 }

The behavior on line 802 is not documented anywhere in send(2). It was driving me nuts trying to figure out what was going on in tools/regression/unix_cmsg:t_cmsg_len because the test fails on amd64 because that conditional is tripped -_-...
Comment 1 commit-hook freebsd_committer 2016-01-23 22:49:28 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

  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

_U  head/
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2016-01-23 22:53:36 UTC
Reporter is Committer, assign accordingly.

@Ngie, please set mfc-* flags to + once they are committed in those branches. Don't forget to include the relevant PR: line :)
Comment 3 Enji Cooper freebsd_committer 2016-01-23 22:55:51 UTC
(In reply to Kubilay Kocak from comment #2)

Hi koobs@!

The change I proposed isn't going to fix the missing documentation. I can add it later (will remain CCed on the bug), but I want to start a quick discussion first with appropriate parties.

Reassigning to freebsd-net and removing "In Progress" :).
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2016-01-23 23:32:14 UTC
(In reply to NGie Cooper from comment #3)

Ah thanks. Could you then update (terse'ify) the summary to describe either:

* A summary of the 'issue', OR
* A summary of the action/fix/change that is needed

That way we can annotate/classify the issue accordingly.

Am I understanding correctly that r294646 referenced in comment 1 was to temporarily disable a test due to the issue described here, until its resolved, by a change (patch) that will be added here in due course?
Comment 5 Enji Cooper freebsd_committer 2016-01-23 23:34:56 UTC
Bug 206543 is tracking the test issue. I've updated the description to be more terse :).
Comment 6 Munna 2019-06-25 18:45:08 UTC