1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-04 06:15:24 +00:00
Mirror of the FreeBSD ports git repo https://git.FreeBSD.org/ports.git .
Go to file
Dimitry Andric 3217bf995f cad/brlcad: fix null pointer accesses during build
During an exp-run for llvm 12 (see bug 255570), it turned out that
cad/brlcad does not build with clang 12.0.0:

[ 99% 4379/4403] cd /wrkdirs/usr/ports/cad/brlcad/work/brlcad-7.30.2/db/nist && /wrkdirs/usr/ports/cad/brlcad/work/brlcad-7.30.2/bin/step-g -O /wrkdirs/usr/ports/cad/brlcad/work/brlcad-7.30.2/share/db/nist/NIST_MBE_PMI_11.g /wrkdirs/usr/ports/cad/brlcad/work/brlcad-7.30.2/db/nist/NIST_MBE_PMI_11.stp > /wrkdirs/usr/ports/cad/brlcad/work/brlcad-7.30.2/db/nist/NIST_MBE_PMI_11.log 2>&1
FAILED: share/db/nist/NIST_MBE_PMI_11.g

What happens is that the step-g intermediate program segfaults, because
it attempts to access a null pointer. Valgrind shows:

Reading Data from /wrkdirs/share/dim/ports/cad/brlcad/work/brlcad-7.30.2/db/nist/NIST_MBE_PMI_11.stp...

HEADER read:
==24919== Invalid read of size 4
==24919==    at 0x1337BA10: EntList::firstNot(JoinType) (entlist.cc:39)
==24919==    by 0x1337C93E: nextNot (complexSupport.h:185)
==24919==    by 0x1337C93E: AndList::matchNonORs(EntNode*) (non-ors.cc:135)
==24919==    by 0x1337B77C: ComplexList::matches(EntNode*) (complexlist.cc:176)
==24919==    by 0x1337B36A: ComplexCollect::supports(EntNode*) const (collect.cc:140)
==24919==    by 0x1335FA5A: STEPcomplex::Initialize(char const**, char const*) (STEPcomplex.cc:126)
==24919==    by 0x1335F774: STEPcomplex::STEPcomplex(Registry*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const**, int, char const*) (STEPcomplex.cc:33)
==24919==    by 0x1331842E: STEPfile::CreateSubSuperInstance(std::__1::basic_istream<char, std::__1::char_traits<char> >&, int, ErrorDescriptor&) (STEPfile.cc:1048)
==24919==    by 0x13315E15: STEPfile::CreateInstance(std::__1::basic_istream<char, std::__1::char_traits<char> >&, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) (STEPfile.cc:833)
==24919==    by 0x133158B1: STEPfile::ReadData1(std::__1::basic_istream<char, std::__1::char_traits<char> >&) (STEPfile.cc:502)
==24919==    by 0x13319EA8: STEPfile::AppendFile(std::__1::basic_istream<char, std::__1::char_traits<char> >*, bool) (STEPfile.cc:1674)
==24919==    by 0x1331C984: STEPfile::ReadExchangeFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool) (STEPfile.inline.cc:119)
==24919==    by 0x3AFDCE: STEPWrapper::load(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) (STEPWrapper.cpp:1300)
==24919==  Address 0x8 is not stack'd, malloc'd or (recently) free'd
==24919==
==24919==
==24919== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==24919==  Access not within mapped region at address 0x8
==24919==    at 0x1337BA10: EntList::firstNot(JoinType) (entlist.cc:39)
==24919==    by 0x1337C93E: nextNot (complexSupport.h:185)
==24919==    by 0x1337C93E: AndList::matchNonORs(EntNode*) (non-ors.cc:135)
==24919==    by 0x1337B77C: ComplexList::matches(EntNode*) (complexlist.cc:176)
==24919==    by 0x1337B36A: ComplexCollect::supports(EntNode*) const (collect.cc:140)
==24919==    by 0x1335FA5A: STEPcomplex::Initialize(char const**, char const*) (STEPcomplex.cc:126)
==24919==    by 0x1335F774: STEPcomplex::STEPcomplex(Registry*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const**, int, char const*) (STEPcomplex.cc:33)
==24919==    by 0x1331842E: STEPfile::CreateSubSuperInstance(std::__1::basic_istream<char, std::__1::char_traits<char> >&, int, ErrorDescriptor&) (STEPfile.cc:1048)
==24919==    by 0x13315E15: STEPfile::CreateInstance(std::__1::basic_istream<char, std::__1::char_traits<char> >&, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) (STEPfile.cc:833)
==24919==    by 0x133158B1: STEPfile::ReadData1(std::__1::basic_istream<char, std::__1::char_traits<char> >&) (STEPfile.cc:502)
==24919==    by 0x13319EA8: STEPfile::AppendFile(std::__1::basic_istream<char, std::__1::char_traits<char> >*, bool) (STEPfile.cc:1674)
==24919==    by 0x1331C984: STEPfile::ReadExchangeFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool) (STEPfile.inline.cc:119)
==24919==    by 0x3AFDCE: STEPWrapper::load(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) (STEPWrapper.cpp:1300)
==24919==  If you believe this happened as a result of a stack
==24919==  overflow in your program's main thread (unlikely but
==24919==  possible), you can try to increase the size of the
==24919==  main thread stack using the --main-stacksize= flag.
==24919==  The main thread stack size used in this run was 16777216.

To fix this, add null pointer checks to EntList::firstNot() and various
other EntList functions.

Approved by:	erik@brlcad.org (maintainer)
PR:		256166
MFH:		2021Q2
2021-06-10 18:57:57 +02:00
.hooks .hooks/prepare-commit-msg: Enhance commit-msg hook. 2021-06-04 13:57:25 +02:00
accessibility accessibility/orca: remove obsolete dependency on devel/py-xdg 2021-06-02 11:25:36 +02:00
arabic editors/libreoffice: Update to 7.1.3 release 2021-05-10 01:42:35 +10:00
archivers archivers/makeself: update to 2.4.4 2021-06-08 12:52:29 +01:00
astro astro/phd2: fix build on non-x86/non-ARM 2021-06-09 19:55:41 +00:00
audio */*: Add a backup master site to all Xiph.org ports 2021-06-10 15:48:47 +02:00
base
benchmarks */*: Replace USE_GCC=any with USE_GCC=yes 2021-06-04 05:53:21 +00:00
biology biology/fasttree: fix build on powerpc 2021-06-10 12:25:31 +00:00
cad cad/brlcad: fix null pointer accesses during build 2021-06-10 18:57:57 +02:00
chinese chinese/sunpinyin: fix build with python3 scons 2021-05-26 18:05:36 +03:00
comms */*: return shurd's ports to the pool ... 2021-06-07 19:36:24 +02:00
converters converters/p5-Convert-UU: Add NO_ARCH 2021-06-10 22:46:21 +08:00
databases databases/py-sqlalchemy14: Update to 1.4.16 2021-06-10 22:46:13 +08:00
deskutils deskutils/py-paperless: Fix man page formatting 2021-06-10 11:29:31 +02:00
devel devel/py-twine1: Remove obsoleted port 2021-06-10 23:42:42 +08:00
dns dns/rubygem-google-apis-dns_v1: Update to 0.10.0 2021-06-10 22:46:19 +08:00
editors editors/rehex: new port had been added (+) 2021-06-10 08:13:35 +00:00
emulators emulators/yuzu: update to s20210609 2021-06-10 00:59:46 +00:00
finance finance/p5-Finance-QuoteHist: Update to 1.32 2021-05-31 03:53:18 +08:00
french editors/libreoffice: Update to 7.1.3 release 2021-05-10 01:42:35 +10:00
ftp ftp/curl: Update to 7.77.0 2021-06-10 22:45:58 +08:00
games games/hyperrogue: update to 12.0a 2021-06-10 17:00:45 +03:00
german german/mythes: Update to 2021.05.23 2021-05-27 03:00:10 +08:00
graphics graphics/gdal: Convert REINPLACE_CMD to patch files 2021-06-10 22:45:58 +08:00
hebrew editors/libreoffice: Update to 7.1.3 release 2021-05-10 01:42:35 +10:00
hungarian editors/libreoffice: Update to 7.1.3 release 2021-05-10 01:42:35 +10:00
irc irc/ergo: Add PKGNAMESUFFIX to uniquify package name 2021-06-08 09:37:08 -07:00
japanese category/port: Package name dependencies do not support globbing. 2021-06-07 15:39:37 -07:00
java java/java-zoneinfo: Add NO_ARCH 2021-06-10 22:46:21 +08:00
Keywords
korean editors/libreoffice: Update to 7.1.3 release 2021-05-10 01:42:35 +10:00
lang lang/rust: Disable DOCS to fix build on armv6/7 2021-06-10 10:35:22 -06:00
mail mail/phplist: update distinfo 2021-06-10 08:09:03 +01:00
math math/py-mpmath: Add NO_ARCH 2021-06-10 22:46:22 +08:00
misc misc/rubygem-octicons: Update to 14.2.1 2021-06-10 22:46:20 +08:00
Mk Mk/bsd.default-versions.mk: Update comment: add ImageMagick 6-nox11 and 7-nox11 2021-06-10 22:46:21 +08:00
multimedia */*: Add a backup master site to all Xiph.org ports 2021-06-10 15:48:47 +02:00
net net/py-python-novaclient16: Remove obsoleted port 2021-06-10 23:42:45 +08:00
net-im devel/meson: update to 0.58.1 2021-06-09 21:29:24 +00:00
net-mgmt net-mgmt/cacti: Update to 1.2.17 2021-06-10 16:12:07 +02:00
net-p2p net-p2p/xmrig: Update to 6.12.2 2021-06-01 19:50:36 +02:00
news news/sabnzbdplus: Update to 3.3.0 2021-06-01 23:48:14 +08:00
polish devel/protobuf-c: Bump PORTREVISION of dependent ports 2021-05-31 10:43:49 -07:00
ports-mgmt */*: return shurd's ports to the pool ... 2021-06-07 19:36:24 +02:00
portuguese editors/libreoffice: Update to 7.1.3 release 2021-05-10 01:42:35 +10:00
print print/py-pycups1: Remove obsoleted port 2021-06-10 23:42:46 +08:00
russian devel/eric6: update to 21.5 release 2021-05-12 13:40:52 +10:00
science science/py-eccodes: Remove PYNUMPY 2021-06-10 22:46:16 +08:00
security security/py-flask-saml: Fix build with Python 3.9+ 2021-06-10 22:46:24 +08:00
shells shells/dash: update DASH to version 0.5.11.4. 2021-06-05 17:57:39 +00:00
sysutils sysutils/py-ptyprocess: Add NO_ARCH 2021-06-10 22:46:22 +08:00
Templates
textproc textproc/py-recommonmark: Update WWW 2021-06-10 22:46:22 +08:00
Tools Tools/scripts/rmport: satisfy path check hook 2021-05-31 22:53:38 +02:00
ukrainian editors/libreoffice: Update to 7.1.3 release 2021-05-10 01:42:35 +10:00
vietnamese editors/libreoffice: Update to 7.1.3 release 2021-05-10 01:42:35 +10:00
www www/gitlab-ce: Change RUN_DEPENDS from rubygem-rack-proxy to rubygem-rack-proxy06 2021-06-10 22:46:24 +08:00
x11 x11/xapp: update to version 2.2.0. 2021-06-08 10:47:56 +00:00
x11-clocks Update KDE Gear to 21.04.1 2021-05-13 19:33:56 +02:00
x11-drivers */*: Replace USE_GCC=any with USE_GCC=yes 2021-06-04 05:53:21 +00:00
x11-fm x11-fm/qtfm: update to 6.2.1 2021-06-09 00:49:16 +00:00
x11-fonts x11-fonts/iosevka: Update to 0.7.3 2021-06-04 17:31:01 +02:00
x11-servers x11-servers/xwayland-devel: update to 1.20.0.969 2021-06-10 00:59:46 +00:00
x11-themes x11-themes/numix-icon-theme-circle: Update to 21.05.31 2021-06-09 22:25:35 +02:00
x11-toolkits graphics/poppler: update to 21.06.0 2021-06-07 15:26:18 +02:00
x11-wm */*: Bump PORTREVISION on *-sbcl ports after lang/sbcl upgrade. 2021-06-08 08:28:16 +02:00
.arcconfig
.gitignore
CHANGES CHANGES: Document the prepare-commit-msg hook. 2021-06-09 12:47:55 +02:00
CONTRIBUTING.md CONTRIBUTING.md: Adjust link to "submitting patches" instructions. 2021-05-15 13:36:25 +02:00
COPYRIGHT
GIDs ftp/sftpgo: SFTP, FTP/S, and WebDAV server [NEW] 2021-06-08 16:46:34 +00:00
LEGAL Remove expired ports: 2021-05-16 13:29:59 +02:00
Makefile Makefile: Force to rebase when using make update 2021-05-25 16:01:19 +00:00
MOVED MOVED: Remove superfluous space 2021-06-10 23:45:32 +08:00
README
UIDs ftp/sftpgo: SFTP, FTP/S, and WebDAV server [NEW] 2021-06-08 16:46:34 +00:00
UPDATING UPDATING: fix spelink 2021-05-23 12:34:55 +02:00

This is the FreeBSD Ports Collection.  For an easy to use
WEB-based interface to it, please see:

	https://www.FreeBSD.org/ports

For general information on the Ports Collection, please see the
FreeBSD Handbook ports section which is available from:

	https://docs.freebsd.org/en/books/handbook/ports/
		for the latest official version
	or:
	The ports(7) manual page (man ports).

These will explain how to use ports and packages.

If you would like to search for a port, you can do so easily by
saying (in /usr/ports):

	make search name="<name>"
	or:
	make search key="<keyword>"

which will generate a list of all ports matching <name> or <keyword>.
make search also supports wildcards, such as:

	make search name="gtk*"

For information about contributing to FreeBSD ports, please see the Porter's
Handbook, available at:

	https://docs.freebsd.org/en/books/porters-handbook/

NOTE:  This tree will GROW significantly in size during normal usage!
The distribution tar files can and do accumulate in /usr/ports/distfiles,
and the individual ports will also use up lots of space in their work
subdirectories unless you remember to "make clean" after you're done
building a given port.  /usr/ports/distfiles can also be periodically
cleaned without ill-effect.