<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib/libc/tests, branch releng/11.3</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=releng%2F11.3</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=releng%2F11.3'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2019-04-29T19:11:56Z</updated>
<entry>
<title>MFC r346539:</title>
<updated>2019-04-29T19:11:56Z</updated>
<author>
<name>Enji Cooper</name>
<email>ngie@FreeBSD.org</email>
</author>
<published>2019-04-29T19:11:56Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=21c0210d7ff5bf91c3b5f8aedf77157bd0584021'/>
<id>urn:sha1:21c0210d7ff5bf91c3b5f8aedf77157bd0584021</id>
<content type='text'>
Fix `get_int_via_sysctlbyname(..)` on Jenkins

Initialize `oldlen` to the size of the value, instead of leaving the value
unitialized. Leaving it unitialized seems to work by accident on amd64 when
running 64-bit programs, but not on i386.

This matches patterns in use in other programs.

PR:		237458
Tested on:	^/head (amd64), ^/stable/11 (i386)
</content>
</entry>
<entry>
<title>MFC r343362,r343365,r343367,r343368,r343461,r343751,r344310:</title>
<updated>2019-03-10T16:13:00Z</updated>
<author>
<name>Enji Cooper</name>
<email>ngie@FreeBSD.org</email>
</author>
<published>2019-03-10T16:13:00Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=80ed9fe09c8ac6fce028227aef6bb417d4854cef'/>
<id>urn:sha1:80ed9fe09c8ac6fce028227aef6bb417d4854cef</id>
<content type='text'>
r343362:

Add [initial] functional tests for sendfile(2) as lib/libc/sys/sendfile

These testcases exercise a number of functional requirements for sendfile(2).

The testcases use IPv4 and IPv6 domain sockets with TCP, and were confirmed
functional on UFS and ZFS. UDP address family sockets cannot be used per the
sendfile(2) contract, thus using UDP sockets is outside the scope of
testing the syscall in positive cases. As seen in
`:s_negative_udp_socket_test`, UDP is used to test the sendfile(2) contract
to ensure that EINVAL is returned by sendfile(2).

The testcases added explicitly avoid testing out `SF_SYNC` due to the
complexity of verifying that support. However, this is a good next logical
item to verify.

The `hdtr_positive*` testcases work to a certain degree (the header
testcases pass), but the trailer testcases do not work (it is an expected
failure). In particular, the value received by the mock server doesn't match
the expected value, and instead looks something like the following (using
python array notation):

`trailer[:]message[1:]`

instead of:

`message[:]trailer[:]`

This makes me think there's a buffer overrun issue or problem with the
offset somewhere in the sendfile(2) system call, but I need to do some
other testing first to verify that the code is indeed sane, and my
assumptions/code isn't buggy.

The `sbytes_negative` testcases that check `sbytes` being set to an
invalid value resulting in `EFAULT` fails today as the other change
(which checks `copyout(9)`) has not been committed [1]. Thus, it
should remain an expected failure (see bug 232210 for more details
on this item).

Next steps for testing sendfile(2):
1. Fix the header/trailer testcases so that they pass.
2. Setup if_tap interface and test with it, instead of using "localhost", per
   @asomers's suggestion.
3. Handle short recv(2)'s in `server_cat(..)`.
4. Add `SF_SYNC` support.
5. Add some more negative tests outside the scope of the functional contract.

PR: 		232210

r343365:

Unbreak the gcc build with sendfile_test after r343362

gcc 8.x is more pedantic than clang 7.x with format strings and the tests
passed `void*` variables while supplying `%s` (which is technically
incorrect).

Make the affected `void*` variables use `char*` storage instead to address
this issue, as the compiler will upcast the values to `char*`.

MFC with:	r343362

r343367:

Unbreak the build on architectures where size_t isn't synonymous with uintmax_t

I should have used `%zu` instead of `%ju` with `size_t` types.

MFC with:	r343362, r343365
Pointyhat to:	ngie

r343368:

Fix up r343367

I should have only changed the format qualifier with the `size_t` value,
`length`, not the other [`off_t`] value, `dest_file_size`.

MFC with:	r343362, r343365, r343367

r343461:

Fix reporting errors with `gai_strerror(..)`

The return value (`err`) should be checked; not the `errno` value.

PR:		235200
MFC with:	r343362, r343365, r343367-r343368

r343751:

Avoid the DNS lookup for "localhost"

ci.FreeBSD.org does not have access to a DNS resolver/network (unlike my test
VM), so in order for the test to pass on the host, it needs to avoid the DNS
lookup by using the numeric host address representation.

PR:		235200
MFC with:	r343362, r343365, r343367-r343368, r343461

r344310:

Make `server_cat(..)` handle short receives

In short, the prior code was far too simplistic when it came to calling recv(2)
and failed intermittently (or in the case of Jenkins, deterministically).

Handle short recv(2)s by checking the return code and incrementing the window
into the buffer by the number of received bytes. If the number of received
bytes &lt;= 0, then bail out of the loop, and test the total number of received
bytes vs the expected number of bytes sent for equality, and base whether or
not the test passes/fails on that fact.

Remove the expected failure, now that the hdtr testcases deterministically pass
on my host after this change [1].

PR:		234809 [1], 235200

Approved by:	emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D19524
</content>
</entry>
<entry>
<title>MFC r321333:</title>
<updated>2018-08-08T18:59:22Z</updated>
<author>
<name>Bryan Drewery</name>
<email>bdrewery@FreeBSD.org</email>
</author>
<published>2018-08-08T18:59:22Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=57a4c73d6fad1386cacf18abf05e81307d2f2d09'/>
<id>urn:sha1:57a4c73d6fad1386cacf18abf05e81307d2f2d09</id>
<content type='text'>
  Properly set userid for truncate_test.
</content>
</entry>
<entry>
<title>MFC r335704:</title>
<updated>2018-08-08T17:57:45Z</updated>
<author>
<name>Bryan Drewery</name>
<email>bdrewery@FreeBSD.org</email>
</author>
<published>2018-08-08T17:57:45Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=947b20c41be9b3b5010e93a92432c08e3ad72f63'/>
<id>urn:sha1:947b20c41be9b3b5010e93a92432c08e3ad72f63</id>
<content type='text'>
  Rework check for libclang_rt to see if the needed library exists.
</content>
</entry>
<entry>
<title>MFC r333895, r334022</title>
<updated>2018-06-18T19:35:17Z</updated>
<author>
<name>Cy Schubert</name>
<email>cy@FreeBSD.org</email>
</author>
<published>2018-06-18T19:35:17Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=adb6ee746256fd3f1d2a83c4605b489ed3d5365d'/>
<id>urn:sha1:adb6ee746256fd3f1d2a83c4605b489ed3d5365d</id>
<content type='text'>
r333895:
Drop obsolete Buenos Aires Convention.

Prompted by:	Recent discussion

r334022:
Drop obsolete Buenos Aires Convention.
</content>
</entry>
<entry>
<title>MFC r331936, r331942, r331943, r331945, r331947, r331948</title>
<updated>2018-04-18T19:18:14Z</updated>
<author>
<name>Cy Schubert</name>
<email>cy@FreeBSD.org</email>
</author>
<published>2018-04-18T19:18:14Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=041ca5003745c04f57b13bf4a41cac8c72589515'/>
<id>urn:sha1:041ca5003745c04f57b13bf4a41cac8c72589515</id>
<content type='text'>
Add new gets_s(3) stdio function.

This implements the gets_s(3) function as documented at
http://en.cppreference.com/w/c/io/gets. It facilitates the
optional removal of gets(3).

Reviewed by:	ed
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D12785
</content>
</entry>
<entry>
<title>MFC r309373 (by bdrewery)</title>
<updated>2018-01-12T00:25:56Z</updated>
<author>
<name>Alan Somers</name>
<email>asomers@FreeBSD.org</email>
</author>
<published>2018-01-12T00:25:56Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e21ef7227eb274311766a85ea0f03a44a4226406'/>
<id>urn:sha1:e21ef7227eb274311766a85ea0f03a44a4226406</id>
<content type='text'>
Fix setrlimit_test:setrlimit_memlock when the system has exceeded vm.max_wired.

This uses the same fix as r294894 did for the mlock test.  The code from
that commit is moved into a common object file which PROGS supports
building first.

Sponsored by:   Dell EMC Isilon
Differential Revision:  https://reviews.freebsd.org/D8689
</content>
</entry>
<entry>
<title>MFC r326640:</title>
<updated>2018-01-11T23:57:55Z</updated>
<author>
<name>Alan Somers</name>
<email>asomers@FreeBSD.org</email>
</author>
<published>2018-01-11T23:57:55Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=94510b405315a7555890f5dd765cb1cb04ff60f1'/>
<id>urn:sha1:94510b405315a7555890f5dd765cb1cb04ff60f1</id>
<content type='text'>
Optimize telldir(3)

Currently each call to telldir() requires a malloc and adds an entry to a
linked list which must be traversed on future telldir(), seekdir(),
closedir(), and readdir() calls. Applications that call telldir() for every
directory entry incur O(n^2) behavior in readdir() and O(n) in telldir() and
closedir().

This optimization eliminates the malloc() and linked list in most cases by
packing the relevant information into a single long. On 64-bit architectures
msdosfs, NFS, tmpfs, UFS, and ZFS can all use the packed representation.  On
32-bit architectures msdosfs, NFS, and UFS can use the packed
representation, but ZFS and tmpfs can only use it for about the first 128
files per directory.  Memory savings is about 50 bytes per telldir(3) call.
Speedup for telldir()-heavy directory traversals is about 20-30x for one
million files per directory.

Reviewed by:	kib, mav, mckusick
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D13385
</content>
</entry>
<entry>
<title>MFC r320737, r320914</title>
<updated>2017-08-25T12:16:03Z</updated>
<author>
<name>Alan Somers</name>
<email>asomers@FreeBSD.org</email>
</author>
<published>2017-08-25T12:16:03Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=f92c1b8ae130865730d07aba6d430d2f28e5e171'/>
<id>urn:sha1:f92c1b8ae130865730d07aba6d430d2f28e5e171</id>
<content type='text'>
r320737:
Fix cleanup in lib/libc/gen/setdomainname_test

ATF cleanup routines run in separate processes from the tests themselves, so
they can't share global variables.

Also, setdomainname_test needs to be is_exclusive because the test cases
access a global resource.

PR:		219967
Reviewed by:	ngie
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D11188

r320914:
Remove an extraneous strlen from t_setdomainname.c

Reported by:	Coverity
CID:		1377568
X-MFC-With:	320737
Sponsored by:	Spectra Logic Corp
</content>
</entry>
<entry>
<title>MFC r322427:</title>
<updated>2017-08-19T09:38:43Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2017-08-19T09:38:43Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=2f90ec7e832970541d964b157c8803979336653f'/>
<id>urn:sha1:2f90ec7e832970541d964b157c8803979336653f</id>
<content type='text'>
Improve standard compliance for memset_s() and abort_handler_s().
</content>
</entry>
</feed>
