Bug 199128 - net-mgmt/net-snmp fails to compile with seg. fault checking size of short at config stage
Summary: net-mgmt/net-snmp fails to compile with seg. fault checking size of short at ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Ryan Steinmetz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-02 22:37 UTC by mikhail.rokhin
Modified: 2015-09-09 19:27 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (zi)


Attachments
config.log (811.15 KB, text/plain)
2015-05-19 16:35 UTC, IMFA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description mikhail.rokhin 2015-04-02 22:37:11 UTC
fails at config stage with default cc and gcc49

FBSD-x86-11-CURRENT latest svn up
Comment 1 Ryan Steinmetz freebsd_committer freebsd_triage 2015-04-02 23:58:00 UTC
Please try 10.1-RELEASE.
Comment 2 jarrod 2015-04-11 01:12:26 UTC
In a tinderbox environment of both 10.1-RELEASE-p8 and 10.1-RELEASE-p9, net-mgmt/net-snmp has failed to build on the i386 since around r381568 while it builds fine on amd64.  The error is as the reporter has suggested, and looks like..

...
checking for picl.h... no
checking for struct rtentry.rt_dst... no
checking for struct rtentry.rt_hash... no
checking for struct rtentry.rt_next... no
checking for struct rtentry.rt_refcnt... no
checking for struct rtentry.rt_unit... no
checking for struct rtentry.rt_use... no
checking size of short... Segmentation fault (core dumped)
configure: error: in `/work/a/ports/net-mgmt/net-snmp/work/net-snmp-5.7.3':
configure: error: cannot compute sizeof (short)
See `config.log' for more details
===>  Script "configure" failed unexpectedly.
Please report the problem to zi@FreeBSD.org [maintainer] and attach the
"/work/a/ports/net-mgmt/net-snmp/work/net-snmp-5.7.3/config.log" including
the output of the failure of your make command. Also, it might be a good idea
to provide an overview of all packages installed on your system (e.g. a
/usr/local/sbin/pkg-static info -g -Ea).
*** Error code 1
Comment 3 IMFA 2015-05-14 16:44:34 UTC
I got this problem.

10.1-RELEASE-p9 FreeBSD 10.1-RELEASE-p9

checking for struct rtentry.rt_use... no
checking size of short... Segmentation fault (core dumped)
configure: error: in `/usr/ports/net-mgmt/net-snmp/work/net-snmp-5.7.3':
configure: error: cannot compute sizeof (short)

From logfile

#define HAVE_NETINET6_IN6_VAR_H 1
#define HAVE_NETINET6_IN6_PCB_H 1
#define HAVE_NETINET6_IP6_VAR_H 1
#define HAVE_NETINET6_TCP6_VAR_H 1
#define HAVE_NETINET_IN_PCB_H 1
#define HAVE_PKG_H 1
#define HAVE_LIBPKG 1

configure: exit 77

Have been this for several weeks.
Comment 4 James Elstone 2015-05-17 11:31:55 UTC
I have just built on i386 with GENRIC kernel (FreeBSD 10.1-p9) on default options for "net-mgmt/net-snmp" using clang version 3.4.1 and did not get the errors you have reported.

Can you confirm the output from the shell commands within the port directory "make showconfig", "cc --version" and detail what your path variable is please?
Comment 5 IMFA 2015-05-17 14:38:27 UTC
here you go


[root@xxx /usr/ports/net-mgmt/net-snmp]# make showconfig
===> The following configuration options are available for net-snmp-5.7.3_7:
     AX_SOCKONLY=off: Disable UDP/TCP transports for agentx
     DOCS=on: Build and/or install documentation
     DUMMY=on: Enable dummy values as placeholders
     IPV6=on: IPv6 protocol support
     JAIL=off: Options for running snmpd within a jail(8)
     MFD_REWRITES=off: Build with 64-bit Interface Counters
     MYSQL=off: MySQL database support
     PERL=on: Perl scripting language support
     PERL_EMBEDDED=on: Build embedded perl
     PYTHON=off: Python bindings or support
     SMUX=on: Build with SNMP multiplexing (SMUX) support
     TKMIB=off: Install graphical MIB browser
     UNPRIVILEGED=off: Allow unprivileged users to execute net-snmp
===> Use 'make config' to modify these settings

[root@xxx /usr/ports/net-mgmt/net-snmp]# cc --version
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target: i386-unknown-freebsd10.1
Thread model: posix

[root@xxx /usr/ports/net-mgmt/net-snmp]# echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/root/bin
Comment 6 James Elstone 2015-05-17 17:47:33 UTC
I have identical settings and it compiles: hmmm...

Can you share "uname -a" and also do you have a make.conf or any other preprocessor effecting configuration?  If so can you share a copy of that as well please?

Are you cross compiling, or anything else?

Could you describe any additional steps to help reproduce this?

Thanks...
Comment 7 IMFA 2015-05-17 20:11:35 UTC
(In reply to JamesElstone from comment #6)

FreeBSD xxx 10.1-RELEASE-p9 FreeBSD 10.1-RELEASE-p9 #0: Tue Apr  7 01:07:33 UTC 2015     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  i386


This is from /etc/make.conf

# added by use.perl 2012-12-30 21:51:22
PERL_VERSION=5.10.1
WITH_PKGNG=yes
DEFAULT_VERSIONS=apache=2.2


I dont know anything about cross-compiling. Just trying to install the port(net-snmp) that i have been using before.
Comment 8 James Elstone 2015-05-17 22:02:21 UTC
Thank you for your answers; Sorry for all these questions, just trying to understand the environment on your machine that could effect this; I can empathise with your scenario.

Cross compiling is when you run a kernel on one platform (e.g. amd64) and build for another (e.g. i386).  Your output from uname -a and the target from clang shows you are not.

I am going to need a few more pieces of information though please.

Can you perform a "make clean && make" in /usr/ports/net-mgmt/net-snmp/ please, and attach to this bug report the config.log in it's entirety (located in ./work/net-snmp-5.7.3/config.log).  It should provide detailed information into what is being executed and what is failing...

Can you also share the output of:

   "perl -version"
   "pkg version | grep pkg"
   "pkg version | grep apache"

p.s. I don't have an /etc/make.conf defined at all.
Comment 9 IMFA 2015-05-19 16:35:53 UTC
Created attachment 156952 [details]
config.log
Comment 10 IMFA 2015-05-19 16:37:15 UTC
I have added config.log and here are the other info.


[root@xxx /usr/ports/net-mgmt/net-snmp]# perl -version

This is perl 5, version 18, subversion 4 (v5.18.4) built for i386-freebsd-thread-multi-64int

Copyright 1987-2013, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

[root@xxx /usr/ports/net-mgmt/net-snmp]# pkg version | grep pkg
pkg-1.5.2                          =
pkgconf-0.9.10                     =
[root@xxx /usr/ports/net-mgmt/net-snmp]# pkg version | grep apache
apache22-2.2.29_2                  =
[root@pantera /usr/ports/net-mgmt/net-snmp]#
Comment 11 James Elstone 2015-05-19 23:22:26 UTC
Thanks.

From looking at the config.log attachment I can see a couple of things:

Just prior to the core dump, you are getting a warning message:
  warning: libcrypto.so.7, needed by /usr/local/lib/libpkg.so, may conflict with libcrypto.so.8

Also the invokation of the configure process on in my test environment is involked with "--with-openssl=/usr", where as on your node you have "-lcrypto --with-openssl=/usr/local"

This indicates that you have a ports based version of openssl installed and are not using the base version included with FreeBSD.

There are two primary source locations for OpenSSL, either in the base system or installed from the ports collection [security/openssl].  If you run "pkg info | grep ssl" or type "pkg which /usr/local/lib/libcrypto.so.8" it will respond with the package in question (rather than saying it was not found in the database).

Some ports and applications will use the highest available version (currently the ports version if installed) regardless of what they were originally compiled against at build time.

There are issues being seen elsewhere at the moment with an upgrade from OpenSSL 1.0.1 to 1.0.2, see here for more information:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198788
http://freebsd.1045724.n5.nabble.com/openssl-and-bash-libcrypto-td6003769.html

You could try a couple of things which may resolve the issue you are experiencing:

A) Clean the openssl libraries and applications that depend on them.

1) Confirm there is a need to use the openssl version from ports.  There may be a good reason to leave it installed, and this may have been a known decision?

If not deinstall the relevant openssl port before proceeding with step 4, skiping steps 2, and 3.  No entry in /etc/make.conf is required if using the base version of OpenSSL.

2) In the openssl port you have installed (maybe [security/openssl]), run "make config" and turn off the "ASM" option, then reinstall the port ("make clean && make reinstall").  (Skip if using base version).

3) In your /etc/make.conf insert a new line that reads: "WITH_OPENSSL_PORT=yes", without the quotes. (Skip if using base version in FreeBSD).

4) Run "portmaster -r openssl", which will rebuild and reinstall all ports that utilise or depend on openssl.  In the warning from your config.log above, one such package is "pkg" itself.

B) Do you realise that the version of Perl installed is v5.18.4, whereas your "make.conf" specifies v5.10.1.  Is this intentional?

If not I would consider removing the line in the "make.conf" file, and checking if dependant ports need to be recompiled...

Please let us know how things go.
Comment 12 IMFA 2015-05-20 21:09:35 UTC
Thanks for the help! I did a reinstall of OpenSSL and then it worked like a charm.
Comment 13 Ryan Steinmetz freebsd_committer freebsd_triage 2015-05-20 21:30:48 UTC
Thanks James!
Comment 14 James Elstone 2015-05-21 06:44:01 UTC
Good to hear it is resolved for you! :-)
Comment 15 Ryan Steinmetz freebsd_committer freebsd_triage 2015-09-09 19:27:49 UTC
Submitter resolved issue.