| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
convname and dst are guaranteed to be non-NULL by iconv_open(3).
src is an array. Remove these tests for NULL pointers.
While I'm here, eliminate a strlcpy with a correct but suspicious-looking
calculation for the third parameter (i.e. not a simple sizeof).
Compare the strings in-place instead of copying.
Found by: bdrewery
Found by: Coverity
CID: 1130050, 1130056
MFC after: 3 days
Sponsored by: Dell Inc.
Differential Revision: https://reviews.freebsd.org/D6338
|
|
|
|
|
|
|
|
|
|
| |
- Use fgetln instead of fgets; localize complexity related to fgetln(3)
inside the loop.
- Skip over blank lines.
- Skip over lines (properly) that start with a "#"
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
|
|
|
|
|
|
|
|
| |
These APIs take unit length, not byte length parameters.
Reported by: Coverity
CIDs: 1338543, 1338544, 1338545
Sponsored by: EMC / Isilon Storage Division
|
|
|
|
|
|
|
|
|
| |
h_aliases is a NULL-terminated rather than fixed-length array. nitems() is not
a valid way to determine its end; instead, check for NULL.
Reported by: Coverity
CID: 1346578
Sponsored by: EMC / Isilon Storage Division
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
after r298107
Summary of changes:
- Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that
namespacing is kept with FILES appropriately, and that this shouldn't need
to be repeated if the namespace changes -- only the definition of PACKAGE
needs to be changed
- Allow PACKAGE to be overridden by callers instead of forcing it to always be
`tests`. In the event we get to the point where things can be split up
enough in the base system, it would make more sense to group the tests
with the blocks they're a part of, e.g. byacc with byacc-tests, etc
- Remove PACKAGE definitions where possible, i.e. where FILES wasn't used
previously.
- Remove unnecessary TESTSPACKAGE definitions; this has been elided into
bsd.tests.mk
- Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES;
${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk.
- Fix installation of files under data/ subdirectories in lib/libc/tests/hash
and lib/libc/tests/net/getaddrinfo
- Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup)
Document the proposed changes in share/examples/tests/tests/... via examples
so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of
replacing FILES. share/mk/bsd.README didn't seem like the appropriate method
of communicating that info.
MFC after: never probably
X-MFC with: r298107
PR: 209114
Relnotes: yes
Tested with: buildworld, installworld, checkworld; buildworld, packageworld
Sponsored by: EMC / Isilon Storage Division
|
|
|
|
| |
Mostly on comments.
|
|
|
|
|
|
|
|
|
|
|
|
| |
freopen handles closing file descriptors on error, with the exception of
fdopen'ed descriptors, so closing an already fclose'd file descriptor is
incorrect
CID: 1338525
Differential Revision: https://reviews.freebsd.org/D6013
MFC after: 2 weeks
Reported by: Coverity
Sponsored by: EMC / Isilon Storage Division
|
|
|
|
|
|
|
|
|
|
|
| |
on the FILE object
This fixes potential null pointer dereferences on failure
CID: 1254952
MFC after: 2 weeks
Reported by: Coverity
Sponsored by: EMC / Isilon Storage Division
|
|\
| |
| |
| | |
Sponsored by: The FreeBSD Foundation
|
| |
| |
| |
| |
| |
| |
| | |
-fsanitize does not seem to work when a --sysroot is specified and there
is no <sysroot>/usr/lib/clang/3.8.0/lib/freebsd/libclang_rt.ubsan_standalone-*.a.
Sponsored by: EMC / Isilon Storage Division
|
|\ \
| |/
| |
| | |
Sponsored by: The FreeBSD Foundation
|
| |
| |
| |
| | |
Sponsored by: EMC / Isilon Storage Division
|
| |
| |
| |
| | |
Sponsored by: EMC / Isilon Storage Division
|
|\ \
| |/
| |
| | |
Sponsored by: The FreeBSD Foundation
|
| | |
|
|\ \
| |/
| |
| | |
Sponsored by: The FreeBSD Foundation
|
| |
| |
| |
| | |
They result in gratuitous differences when comparing build log output.
|
|\ \
| |/
| |
| | |
Sponsored by: The FreeBSD Foundation
|
| |
| |
| |
| | |
Sponsored by: EMC / Isilon Storage Division
|
| |
| |
| |
| | |
Sponsored by: The FreeBSD Foundation
|
| |
| |
| |
| | |
Sponsored by: The FreeBSD Foundation
|
| |
| |
| |
| | |
Sponsored by: The FreeBSD Foundation
|
| |
| |
| |
| | |
Sponsored by: The FreeBSD Foundation
|
|\ \
| |/
| |
| | |
Sponsored by: The FreeBSD Foundation
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
time ago, but for some reason it was not. Basically, without this change
dlopen(3)'ing an empty .so file would just cause application to dump core
with SIGSEGV.
Make sure the file has enough data for at least the ELF header before
mmap'ing it.
Add a test case to check that dlopen an empty file return an error.
There were a separate discussion as to whether it should be SIGBUS
instead when you try to access region mapped from an empty file,
but it's definitely SIGSEGV now, so if anyone want to check that please
be my guest.
Reviewed by: mjg, cem
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D5112
|
|/
|
|
| |
Sponsored by: The FreeBSD Foundation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
450 seconds
This is required on slower network connections, and on older releases
(stable/10 seems to be slower as far as name resolution goes.. not sure
why yet).
Remove an outdated comment in the Makefile from when I was working on
this code over a year ago on github
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The existing implementations of POSIX tsearch() and tdelete() don't
attempt to perform any balancing at all. Testing reveals that inserting
100k nodes into a tree sequentially takes approximately one minute on my
system.
Though most other BSDs also don't use any balanced tree internally, C
libraries like glibc and musl do provide better implementations. glibc
uses a red-black tree and musl uses an AVL tree.
Red-black trees have the advantage over AVL trees that they only require
O(1) rotations after insertion and deletion, but have the disadvantage
that the tree has a maximum depth of 2*log2(n) instead of 1.44*log2(n).
My take is that it's better to focus on having a lower maximum depth,
for the reason that in the case of tsearch() the invocation of the
comparator likely dominates the running time.
This change replaces the tsearch() and tdelete() functions by versions
that create an AVL tree. Compared to musl's implementation, this version
is different in two different ways:
- We don't keep track of heights; just balances. This is sufficient.
This has the advantage that it reduces the number of nodes that are
being accessed. Storing heights requires us to also access all of the
siblings along the path.
- Don't use any recursion at all. We know that the tree cannot 2^64
elements in size, so the height of the tree can never be larger than
96. Use a 128-bit bitmask to keep track of the path that is computed.
This allows us to iterate over the same path twice, meaning we can
apply rotations from top to bottom.
Inserting 100k nodes into a tree now only takes 0.015 seconds. Insertion
seems to be twice as fast as glibc, whereas deletion has about the same
performance. Unlike glibc, it uses a fixed amount of memory.
I also experimented with both recursive and iterative bottom-up
implementations of the same algorithm. This iterative top-down version
performs similar to the recursive bottom-up version in terms of speed
and code size.
For some reason, the iterative bottom-up algorithm was actually 30%
faster for deletion, but has a quadratic memory complexity to keep track
of all the parent pointers.
Reviewed by: jilles
Obtained from: https://github.com/NuxiNL/cloudlibc
Differential Revision: https://reviews.freebsd.org/D4412
|
|
|
|
|
|
| |
MFC after: 1 week
X-MFC with: r292323
Sponsored by: EMC / Isilon Storage Division
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
lib/libc/tests/nss
- Convert the testcases to ATF
- Do some style(9) cleanups:
-- Sort headers
-- Apply indentation fixes
-- Remove superfluous parentheses
- Explicitly print out debug printfs for use with `kyua {debug,report}`; for
items that were overly noisy, they've been put behind #ifdef DEBUG
conditionals
- Fix some format strings
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
|
|
|
|
|
|
| |
MFC after: 1 week
X-MFC with: r292317
Sponsored by: EMC / Isilon Storage Division
|
|
|
|
|
|
|
|
|
| |
lib/libc/tests/resolv
Convert the testcases to ATF
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
|
|
|
|
|
|
| |
MFC after: 3 days
Reported by: cppcheck
Sponsored by: EMC / Isilon Storage Division
|
|
|
|
|
|
|
|
| |
initialized in _test_fmt(..)
MFC after: 3 days
Reported by: cppcheck
Sponsored by: EMC / Isilon Storage Division
|
|
|
|
|
|
|
| |
The normal LIBADD is ssp_nonshared. This also had a DPADD on LIBSSP which
does not actually exist, it is blank.
Sponsored by: EMC / Isilon Storage Division
|
|
|
|
|
|
|
| |
For some odd reason stable/10 requires this, otherwise it always fails
the errno == 0 check on line 196.
Sponsored by: EMC / Isilon Storage Division
|
|
|
|
| |
Sponsored by: EMC / Isilon Storage Division
|
|
|
|
|
|
| |
X-MFC-With: r291330
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is so that 'make depend' is not a required build step in these
files.
DPSRCS is overall unneeded. DPSRCS already contains SRCS, so anything
which can safely be in SRCS should be. DPSRCS is mostly just a way to
generate files that should not be linked into the final PROG/LIB. For
headers and grammars it is safe for them to be in SRCS since they will
be excluded during linking and installation.
The only remaining uses of DPSRCS are for generating .c or .o files that
must be built before 'make depend' can run 'mkdep' on the SRCS c files
list. A semi-proper example is in tests/sys/kern/acct/Makefile where a
checked-in .c file has an #include on a generated .c file. The
generated .c file should not be linked into the final PROG though since
it is #include'd. The more proper way here is just to build/link it in
though without DPSRCS. Another example is in sys/modules/linux/Makefile
where a shell script runs to parse a DPSRCS .o file that should not be
linked into the module. Beyond those, the need for DPSRCS is largely
unneeded, redundant, and forces 'make depend' to be ran. Generally,
these Makefiles should avoid the need for DPSRCS and define proper
dependencies for their files as well.
An example of an improper usage and why this matters is in usr.bin/netstat.
nl_defs.h was only in DPSRCS and so was not generated during 'make all',
but only during 'make depend'. The files including it lacked proper
depenencies on it, which forced running 'make depend' to workaround that
bug. The 'make depend' target should mostly be used for incremental build
help, not to produce a working build. This specific example was broken in
the meta build until r287905 since it does not run 'make depend'.
The gnu/lib/libreadline/readline case is fine since bsd.lib.mk has 'OBJS:
SRCS:M*.h' when there is no .depend file.
Sponsored by: EMC / Isilon Storage Division
MFC after: 1 week
|
|
|
|
|
|
|
|
|
|
| |
(HOST_SHELL is used in NetBSD)
This fixes permission denied issues when gen_ether_subr is not executable
MFC after: 3 days
Reported by: José Pérez <fbl@aoek.com>
Suggested by: bdrewery, sjg
|
|
|
|
|
|
|
|
|
| |
made in r290868
MFC after: 4 days
X-MFC with: r290563, r290868
Reported by: jilles
Sponsored by: EMC / Isilon Storage Division
|
|
|
|
|
| |
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
|
|
|
|
|
|
|
|
|
| |
"use of assignment suppression and length modifier together in scanf format"
warning on line 90 (it's intentional)
MFC after: 1 week
X-MFC with: r290537, r290856, r290860
Sponsored by: EMC / Isilon Storage Division
|
|
|
|
|
|
|
| |
X-MFC with: r290563
MFC after: 1 week
Reported by: gcc
Sponsored by: EMC / Isilon Storage Division
|
| |
|
|
|
|
|
|
|
| |
This effectively "reverts" r290846
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
|
|
|
|
|
|
|
|
| |
testcase inputs
MFC after: 1 week
X-MFC with: r290572
Sponsored by: EMC / Isilon Storage Division
|
|
|
|
|
|
| |
MFC after: 1 week
X-MFC with: r290572
Sponsored by: EMC / Isilon Storage Division
|
|
|
|
|
|
| |
MFC after: 1 week
X-MFC with: r290532
Sponsored by: EMC / Isilon Storage Division
|
|
|
|
|
|
| |
MFC after: 1 week
X-MFC with: r290532
Sponsored by: EMC / Isilon Storage Division
|