Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Feb 2023 16:09:04 -0500
From:      Shawn Webb <shawn.webb@hardenedbsd.org>
To:        Mark Millard <marklmi@yahoo.com>
Cc:        FreeBSD Hackers <freebsd-hackers@freebsd.org>, David Chisnall <theraven@FreeBSD.org>
Subject:   Re: CFT: snmalloc as libc malloc
Message-ID:  <20230212210904.nzxfwtzsjf2tu6ky@mutt-hbsd>
In-Reply-To: <ED93FF21-07BC-4FC0-A114-27424E60C024@yahoo.com>
References:  <ED93FF21-07BC-4FC0-A114-27424E60C024.ref@yahoo.com> <ED93FF21-07BC-4FC0-A114-27424E60C024@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--utl62kziietstoa5
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Feb 12, 2023 at 12:01:22PM -0800, Mark Millard wrote:
> Shawn Webb <shawn.webb_at_hardenedbsd.org> wrote on
> Date: Sun, 12 Feb 2023 19:44:24 UTC :
>=20
> > On Sat, Feb 11, 2023 at 05:10:02PM +0000, David Chisnall wrote:
> > > On 10 Feb 2023, at 16:23, Shawn Webb <shawn.webb@hardenedbsd.org> wro=
te:
> > > >=20
> > > > So I took a little bit of a different approach, which should provide
> > > > the same end result as your submodule approach. Note that I'm doing
> > > > this in HardenedBSD 14-CURRENT (the hardened/current/master branch).
> > > >=20
> > > > 1. git cherry-pick -xs a5c83c69817d03943b8be982dd815c7e263d1a83
> > > > 2. git rm -f .gitmodules contrib/snmalloc
> > > > 3. git commit
> > > > 4. git subtree add -P contrib/snmalloc \
> > > > git@github.com:microsoft/snmalloc.git main
> > > >=20
> > > > I believe this should leave me with a tree that populates
> > > > contrib/snmalloc and pulls in your non-contrib/ changes, leading me=
 to
> > > > end up in the same end state as your submodule approach.
> > > >=20
> > > > I am seeing some build errors. I've uploaded a WITHOUT_CLEAN=3Dyes =
log
> > > > to:
> > > >=20
> > > > https://hardenedbsd.org/~shawn/2023-02-10_snmalloc-01.log.txt
> > > >=20
> > > > Note that this is with llvm 15.0.7 that just landed in FreeBSD main.
> > >=20
> > > The error is a bit confusing, because nullptr_t has been in libc++ si=
nce C++11. Does HardenedBSD change anything in include orders? Can you add =
-v to the end of the compile command:
> > >=20
> > >=20
> > > c++ -target x86_64-unknown-freebsd14.0 --sysroot=3D/usr/obj/data/src/=
hardenedbsd/amd64.amd64/tmp -B/usr/obj/data/src/hardenedbsd/amd64.amd64/tmp=
/usr/bin -fomit-frame-pointer -O2 -pipe -fno-common -DHARDENEDBSD -DNO__SCC=
SID -DNO__RCSID -I/data/src/hardenedbsd/lib/libc/include -I/data/src/harden=
edbsd/include -I/data/src/hardenedbsd/lib/libc/amd64 -DNLS -ftls-model=3Din=
itial-exec -D__DBINTERFACE_PRIVATE -I/data/src/hardenedbsd/contrib/gdtoa -I=
/data/src/hardenedbsd/contrib/libc-vis -DINET6 -I/usr/obj/data/src/hardened=
bsd/amd64.amd64/lib/libc -I/data/src/hardenedbsd/lib/libc/resolv -D_ACL_PRI=
VATE -DPOSIX_MISTAKE -I/data/src/hardenedbsd/lib/libmd -I/data/src/hardened=
bsd/lib/libc/locale -DBROKEN_DES -DPORTMAP -DDES_BUILTIN -I/data/src/harden=
edbsd/lib/libc/rpc -DWANT_HYPERV -DYP -DNS_CACHING -DSYMBOL_VERSIONING -g -=
gz=3Dzlib -mretpoline -fPIC -flto -MD -MF.depend.malloc.o -MTmalloc.o -Wno-=
format-zero-length -fstack-protector-strong -Wsystem-headers -Werror -Wall =
-Wno-format-y2k -Wno-uninitialized -Wdate-time -Wno-empty-body -Wno-string-=
plus-int -Wno-unused-const-variable -Wno-error=3Dunused-but-set-variable -W=
no-error=3Darray-parameter -Wno-error=3Ddeprecated-non-prototype -Wno-error=
=3Dunused-but-set-parameter -Wno-tautological-compare -Wno-unused-value -Wn=
o-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unuse=
d-local-typedef -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum =
-Wno-knr-promoted-parameter -Qunused-arguments -I/data/src/hardenedbsd/lib/=
libutil -I/data/src/hardenedbsd/lib/msun/amd64 -I/data/src/hardenedbsd/lib/=
msun/x86 --include-directory-after /data/src/hardenedbsd/lib/msun/src -DHAR=
DENEDBSD -I/data/src/hardenedbsd/contrib/snmalloc/src/snmalloc -std=3Dc++20=
 -mcx16 -fno-exceptions -fno-rtti -DSNMALLOC_USE_THREAD_CLEANUP -DSNMALLOC_=
BOOTSTRAP_ALLOCATOR -DSNMALLOC_JEMALLOC3_EXPERIMENTAL -DSNMALLOC_JEMALLOC_N=
ONSTANDARD -DSNMALLOC_PLATFORM_HAS_GETENTROPY -DSNMALLOC_STATIC_LIBRARY_PRE=
FIX=3D__ -ftls-model=3Dinitial-exec -DSNMALLOC_CHECK_CLIENT -DSNMALLOC_FAIL=
_FAST=3Dfalse -DNDEBUG -g -gz=3Dzlib -mretpoline -flto -Wno-c++11-extension=
s -c /data/src/hardenedbsd/lib/libc/stdlib/snmalloc/malloc.cc -o malloc.o
> > >=20
> > >=20
> > >=20
> > > That should dump the include paths. It=E2=80=99s possible that the li=
bc++ headers are being included in the wrong order with respect to the C pa=
ths?
> >=20
> > Hey David,
> >=20
> > HardenedBSD doesn't have any changes to userland that would cause
> > changes in include header paths (and the priorities of them.)
> >=20
> > I made sure to `pkg delete -g gcc\* binutils\*` before running another
> > buildworld, ending up with the same error.
> >=20
> > I tried running your command above.
>=20
> He asked that you add a -v to it. Implicitly also: capture
> and report the extra text that the -v causes in the output.
>=20
> That extra text covers what the sequence of include paths
> searched are in the order searched. It shows even the paths
> for which nothing is/will-be found for the specific
> compile: where all did the compiler look? Any unexpected
> places? Any missing places? Any examples of not being in
> the required order?
>=20
> > Here's the result:
> > http://ix.io/4nS9
>=20
> That does not include the extra text that would be generated
> by having added the -v requested to that shown command line.
> That tet would likely have been before the text that you did
> include.
>=20
> Did you add the -v option? Was there extra text?

Good catch. I missed reading that. Here's the new output:
http://ix.io/4nSy

Thanks,

--=20
Shawn Webb
Cofounder / Security Engineer
HardenedBSD

https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A=
4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc

--utl62kziietstoa5
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmPpVWoACgkQ/y5nonf4
4foQ2A//SHF+npe/6nRSwzTOPVAQjZXH6Xkfvdka6+qH3yVscNPRephxhmpyUEVb
WfvaX27T6My4S7gSP4kJX4hltsqeLHszhX7a+MZFN1jORuKfndOPDIcNnkIWq22T
53Pwh49fEMQAUJVTw4NTZKKiHRYWXWCD39u6TLJPMI6c2sY0qfbvPjpy+YprWdso
K8SXKCFTREVKg87SK+olgvlD+SgHiyQxTJcmVP2i5BUhnKZipeDkteI5zvMyqRTJ
DCMLbjUCH+El6VA2qhBNbdT/0aAvjkcNoRHAioxw1MWO2CEHQ+MjoMT9Wit6ME8N
6MlYHsrtg46RSk7ipV2m8Ks4feiiGsF5qhzh/Ud4PlRV6Feif8N0cQ6xFpFBG4//
RpqiKkx8tTXODSzwc0bFekhmL+cX9tC0KXo/QuIiNWX1soznNLK+Ne92mYIzvob2
kSNHJ/rA4ScHy2R+ZvJtnCrqZnF6GhoLbBew9aqLfVqGhOMaNdhOhombncaWcC0B
8zlO2TCY0UiZ6hQMiEywwncOCxSxfe+n2sGWbMHpW/zfDgZ5TDp0YT62Ev/BnrT1
zb0DOjHfQBgEVFikgkVtesldFZy2bJRrl2KECKLeEKxdJaVCMQ2vPj32wDMyV3nF
Xpl3C1yJwGYYc8OFqcdwqeq4cx5UUglqQkb2YWPcbPlJ+bFnins=
=GCtU
-----END PGP SIGNATURE-----

--utl62kziietstoa5--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20230212210904.nzxfwtzsjf2tu6ky>