Bug 221820 - [exp-run] Identify 'struct socket' and 'struct sockbuf' consumers in ports
Summary: [exp-run] Identify 'struct socket' and 'struct sockbuf' consumers in ports
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: Gleb Smirnoff
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-25 23:01 UTC by Gleb Smirnoff
Modified: 2017-10-02 23:32 UTC (History)
2 users (show)

See Also:
glebius: exp-run+


Attachments
we need patched headers in /usr/include (13.81 KB, patch)
2017-08-25 23:01 UTC, Gleb Smirnoff
no flags Details | Diff
we need patched headers in /usr/include, and delete sockstate.h (21.14 KB, patch)
2017-09-18 23:42 UTC, Gleb Smirnoff
no flags Details | Diff
patch for lsof (1.01 KB, patch)
2017-09-18 23:43 UTC, Gleb Smirnoff
no flags Details | Diff
we need patched headers in /usr/include, and delete sockstate.h (21.32 KB, patch)
2017-09-25 19:57 UTC, Gleb Smirnoff
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gleb Smirnoff freebsd_committer freebsd_triage 2017-08-25 23:01:37 UTC
Created attachment 185772 [details]
we need patched headers in /usr/include

I'd like to know ports, which need to know kernel structures for socket and sockbuf.

Please report all new build failures with attached patch. Thanks!
Comment 1 Antoine Brodin freebsd_committer freebsd_triage 2017-08-31 05:30:27 UTC
New failures on amd64:

+ {"origin"=>"mail/thunderbird", "phase"=>"build", "errortype"=>"gcc4_error"}
+ {"origin"=>"security/sslsplit", "phase"=>"build", "errortype"=>"clang"}
+ {"origin"=>"sysutils/lsof", "phase"=>"build", "errortype"=>"gcc4_error"}
+ {"origin"=>"sysutils/py-psutil", "phase"=>"build", "errortype"=>"gcc4_error"}
+ {"origin"=>"www/firefox", "phase"=>"build", "errortype"=>"gcc4_error"}
+ {"origin"=>"www/firefox-esr", "phase"=>"build", "errortype"=>"gcc4_error"}
+ {"origin"=>"www/libxul", "phase"=>"build", "errortype"=>"gcc4_error"}
+ {"origin"=>"www/seamonkey", "phase"=>"build", "errortype"=>"gcc4_error"}

New failures logs on amd64:

http://package18.nyi.freebsd.org/data/headamd64PR221820-default/2017-08-30_13h02m18s/logs/errors/thunderbird-52.3.0_1.log
http://package18.nyi.freebsd.org/data/headamd64PR221820-default/2017-08-30_13h02m18s/logs/errors/sslsplit-0.5.0_4.log
http://package18.nyi.freebsd.org/data/headamd64PR221820-default/2017-08-30_13h02m18s/logs/errors/lsof-4.90.m,8.log
http://package18.nyi.freebsd.org/data/headamd64PR221820-default/2017-08-30_13h02m18s/logs/errors/py27-psutil-5.2.2.log
http://package18.nyi.freebsd.org/data/headamd64PR221820-default/2017-08-30_13h02m18s/logs/errors/firefox-55.0.3_1,1.log
http://package18.nyi.freebsd.org/data/headamd64PR221820-default/2017-08-30_13h02m18s/logs/errors/firefox-esr-52.3.0_1,1.log
http://package18.nyi.freebsd.org/data/headamd64PR221820-default/2017-08-30_13h02m18s/logs/errors/libxul-45.9.0_3.log
http://package18.nyi.freebsd.org/data/headamd64PR221820-default/2017-08-30_13h02m18s/logs/errors/seamonkey-2.48_1.log

Around 40 ports were skipped due to those failures.
Comment 2 Antoine Brodin freebsd_committer freebsd_triage 2017-09-02 06:02:18 UTC
New failures on i386:

+ {"origin"=>"mail/thunderbird", "phase"=>"build", "errortype"=>"gcc4_error"}
+ {"origin"=>"security/sslsplit", "phase"=>"build", "errortype"=>"clang"}
+ {"origin"=>"sysutils/lsof", "phase"=>"build", "errortype"=>"gcc4_error"}
+ {"origin"=>"sysutils/py-psutil", "phase"=>"build", "errortype"=>"gcc4_error"}
+ {"origin"=>"www/firefox", "phase"=>"build", "errortype"=>"gcc4_error"}
+ {"origin"=>"www/firefox-esr", "phase"=>"build", "errortype"=>"gcc4_error"}
+ {"origin"=>"www/libxul", "phase"=>"build", "errortype"=>"gcc4_error"}
+ {"origin"=>"www/seamonkey", "phase"=>"build", "errortype"=>"gcc4_error"}

New failure logs on i386:

http://package18.nyi.freebsd.org/data/headi386PR221820-default/2017-09-01_18h02m52s/logs/errors/thunderbird-52.3.0_1.log
http://package18.nyi.freebsd.org/data/headi386PR221820-default/2017-09-01_18h02m52s/logs/errors/sslsplit-0.5.0_4.log
http://package18.nyi.freebsd.org/data/headi386PR221820-default/2017-09-01_18h02m52s/logs/errors/lsof-4.90.m,8.log
http://package18.nyi.freebsd.org/data/headi386PR221820-default/2017-09-01_18h02m52s/logs/errors/py27-psutil-5.2.2.log
http://package18.nyi.freebsd.org/data/headi386PR221820-default/2017-09-01_18h02m52s/logs/errors/firefox-55.0.3_1,1.log
http://package18.nyi.freebsd.org/data/headi386PR221820-default/2017-09-01_18h02m52s/logs/errors/firefox-esr-52.3.0_1,1.log
http://package18.nyi.freebsd.org/data/headi386PR221820-default/2017-09-01_18h02m52s/logs/errors/libxul-45.9.0_3.log
http://package18.nyi.freebsd.org/data/headi386PR221820-default/2017-09-01_18h02m52s/logs/errors/seamonkey-2.48_1.log

Around 40 ports were skipped due to those failures.
Comment 3 Gleb Smirnoff freebsd_committer freebsd_triage 2017-09-18 23:42:43 UTC
Created attachment 186526 [details]
we need patched headers in /usr/include, and delete sockstate.h

We need patched headers in /usr/include, and /usr/include/sys/sockstate.h needs to be deleted.
Comment 4 Gleb Smirnoff freebsd_committer freebsd_triage 2017-09-18 23:43:24 UTC
Created attachment 186527 [details]
patch for lsof

Please apply this to ports tree.
Comment 5 Gleb Smirnoff freebsd_committer freebsd_triage 2017-09-18 23:44:09 UTC
Thanks a lot, Antoine!

I have updated the patch and added patch for lsof. Can you please launch the exp-run again?
Comment 6 Antoine Brodin freebsd_committer freebsd_triage 2017-09-24 06:06:10 UTC
world fails to build:

/poudriere/jails/headi386PR221820/usr/src/usr.bin/sockstat/sockstat.c:783:9: error: cast from 'struct xunpgen *' to 'struct xunpcb *' increases required alignment from 4 to 8 [-Werror,-Wcast-align]
                xup = (struct xunpcb *)xug;                       
                      ^~~~~~~~~~~~~~~~~~~~
Comment 7 Gleb Smirnoff freebsd_committer freebsd_triage 2017-09-25 19:57:25 UTC
Created attachment 186716 [details]
we need patched headers in /usr/include, and delete sockstate.h

Don't forget to delete /usr/include/sys/sockstate.h after patching.
Comment 8 Gleb Smirnoff freebsd_committer freebsd_triage 2017-09-25 19:57:46 UTC
Patch updated. Thanks!
Comment 9 Antoine Brodin freebsd_committer freebsd_triage 2017-10-01 06:47:45 UTC
Exp-run looks fine.
Comment 10 Gleb Smirnoff freebsd_committer freebsd_triage 2017-10-02 01:22:42 UTC
Do you mean, no failures at all?
Comment 11 Antoine Brodin freebsd_committer freebsd_triage 2017-10-02 05:35:43 UTC
(In reply to Gleb Smirnoff from comment #10)
Yes,  did I miss something?
Comment 12 commit-hook freebsd_committer freebsd_triage 2017-10-02 23:30:59 UTC
A commit references this bug:

Author: glebius
Date: Mon Oct  2 23:29:57 UTC 2017
New revision: 324227
URL: https://svnweb.freebsd.org/changeset/base/324227

Log:
  Hide struct socket and struct unpcb from the userland.

  Violators may define _WANT_SOCKET and _WANT_UNPCB respectively and
  are not guaranteed for stability of the structures.  The violators
  list is the the usual one: libprocstat(3) and netstat(1) internally
  and lsof in ports.

  In struct xunpcb remove the inclusion of kernel structure and add
  a bunch of spare fields.  The xsocket already has socket not included,
  but add there spares as well.  Embed xsockbuf into xsocket.

  Sort declarations in sys/socketvar.h to separate kernel only from
  userland available ones.

  PR:		221820 (exp-run)

Changes:
  head/lib/libprocstat/libprocstat.c
  head/sys/kern/uipc_usrreq.c
  head/sys/netinet6/send.c
  head/sys/sys/param.h
  head/sys/sys/sockbuf.h
  head/sys/sys/socketvar.h
  head/sys/sys/sockstate.h
  head/sys/sys/unpcb.h
  head/usr.bin/bluetooth/btsockstat/btsockstat.c
  head/usr.bin/netstat/inet.c
  head/usr.bin/netstat/netgraph.c
  head/usr.bin/netstat/unix.c
  head/usr.bin/sockstat/sockstat.c
  head/usr.bin/systat/netstat.c
Comment 13 Gleb Smirnoff freebsd_committer freebsd_triage 2017-10-02 23:32:14 UTC
Thanks a lot, Antoine!