Project

General

Profile

Actions

Bug #16545

closed

aligned_alloc not conformant with C11 standard

Added by Ralf J 17 days ago. Updated 1 day ago.

Status:
Closed
Priority:
Normal
Category:
lib - userland libraries
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

The C11 standard says about align_alloc

Fundamental alignments are always supported.

However, the Illumos man page says

The value of alignment is constrained, it must be a power of two and it must be greater than or equal to the size of a word on the platform.

The restriction to being at least the size of a word is a violation of the C standard: _Alignof(short) is a fundamental alignment, so a C11 program can call align_alloc with an alignment of _Alignof(short) and a conformant implementation must support that alignment.
This is a portability hazard, programs developed assuming a C11-compliant implementation will suddenly fail to work properly on Illumos.

Actions #1

Updated by Ralf J 17 days ago

According to their man page, Solaris also allows all powers of two for aligned_alloc, so this is also a portability hazard for programs originally written for Solaris (in case that matters -- I don't know how much illumos tries to be Solaris-compatible these days).

Actions #2

Updated by Ralf J 17 days ago

Sorry, I meant aligned_alloc, not align_alloc... I can't seem to be able to edit the issue description and fix this, unfortunately.

Actions #3

Updated by Gordon Ross 17 days ago

  • Subject changed from align_alloc not conformat with C11 standard to aligned_alloc not conformat with C11 standard
Actions #4

Updated by Robert Mustacchi 15 days ago

  • Assignee set to Robert Mustacchi

Thank you for reporting this. I agree that what we're doing is wrong! Certainly one should be able to specify any power of 2 based alignment for the reason you pointed out. I'll work on getting something here to address this.

One small thing, I'm having trouble finding that exact line you quoted about fundamental alignments in the versions of the spec I have access to (N1570, N2310). If you don't mind, could you share where you found that line?

Actions #5

Updated by Ralf J 14 days ago

Fair question! I quoted from https://en.cppreference.com/w/c/memory/aligned_alloc, which I assumed was quoting from the spec. I have since taken a look at the spec and now I am not sure where cppreference got that line from -- sorry for not checking earlier.

However, the spec does have this:

The pointer returned if the allocation succeeds is suitably aligned so that it may be assigned to a pointer to any type of object with a fundamental alignment requirement and size less than or equal to the size requested.

and it makes it clear that this is also required for aligned_alloc. Maybe that's where cppreference got their claim from? It's not the same thing though. Maybe the reasoning is, if aligned_alloc has to align things to the fundamental alignment anyway, then clearly fundamental alignment must be supported.

I did dig up the documentation for aligned_alloc on a bunch of platforms and as far as I can tell, Illumos is the only one that has this requirement of the alignment being at least the pointer size. (For macOS, the requirement also exists in the code; I couldn't find docs for this.) So this is a portability hazard. But I am less sure now about the state of standards compliance here. (Why can't reading the C standard ever be easy...)

Actions #6

Updated by Robert Mustacchi 14 days ago

Yeah, I found those same bits from other platforms and the spec. I also focused on the description of aligned_allocf when I was looking and agreed that it should be fixed. It does seem straightforward to me that _Alignof(short) or _Alignof(char) should be supported for aligned_alloc as those are alignments the platform should support. Because on our supported plaforms, ILP32/LP64 these are all powers of two, I think that's where the powers of two comes from. I suspect if you were on a platform where _Alignof(short) was a non-power of 2 (imagine 3 bytes), then you'd need to support that alignment too.

Actions #7

Updated by Ralf J 14 days ago

There is this sentence in 6.2.8 of C23:

"Fundamental alignments shall be supported by the implementation for objects of all storage durations."

If this is meant to refer to the same notion of "supported" as the aligned_alloc section, then it would indeed mandate that aligned_alloc must support all fundamental alignments. (And as you say, since malloc definitely has to support them, it only makes sense that aligned_alloc would also support them.)

Actions #8

Updated by Electric Monk 14 days ago

  • Gerrit CR set to 3476
Actions #9

Updated by Robert Mustacchi 14 days ago

  • Gerrit CR deleted (3476)

To test this I updated the aligned_alloc test in the libc-tests and extended it to catch a few more cases than it did previously. I also extended it so that it ran with the additional malloc libraries that are commonly (libumem) and uncommonly (libmtmalloc) used. Here's the output of running the test on its own:

rm@harley ~ $ /opt/libc-tests/tests/aligned_alloc
Running 32-bit tests with library none
TEST PASSED: zero alignment fails with EINVAL
TEST PASSED: zero size fails with EINVAL
TEST PASSED: 3-byte alignment fails with EINVAL
TEST PASSED: 7777-byte alignment fails with EINVAL
TEST PASSED: 23-byte alignment fails with EINVAL
TEST PASSED: alignof (char), 1 byte
TEST PASSED: alignof (char), multiple bytes
TEST PASSED: alignof (short), 1 byte
TEST PASSED: alignof (short), 16 byte
TEST PASSED: alignof (int), 1 byte
TEST PASSED: alignof (int), 4 bytes
TEST PASSED: alignof (int), 22 bytes
TEST PASSED: alignof (long long), 7 bytes
TEST PASSED: alignof (long long), 128 bytes
TEST PASSED: alignof (long long), 511 bytes
TEST PASSED: 16-byte alignment), 16 bytes
TEST PASSED: 16-byte alignment), 256 bytes
TEST PASSED: 4096-byte alignment), 256 bytes
TEST PASSED: 4096-byte alignment), 4096 bytes
TEST PASSED: alignof (char), 1 byte: ENOMEM/EAGAIN forced
TEST PASSED: alignof (char), multiple bytes: ENOMEM/EAGAIN forced
TEST PASSED: alignof (short), 1 byte: ENOMEM/EAGAIN forced
TEST PASSED: alignof (short), 16 byte: ENOMEM/EAGAIN forced
TEST PASSED: alignof (int), 1 byte: ENOMEM/EAGAIN forced
TEST PASSED: alignof (int), 4 bytes: ENOMEM/EAGAIN forced
TEST PASSED: alignof (int), 22 bytes: ENOMEM/EAGAIN forced
TEST PASSED: alignof (long long), 7 bytes: ENOMEM/EAGAIN forced
TEST PASSED: alignof (long long), 128 bytes: ENOMEM/EAGAIN forced
TEST PASSED: alignof (long long), 511 bytes: ENOMEM/EAGAIN forced
TEST PASSED: 16-byte alignment), 16 bytes: ENOMEM/EAGAIN forced
TEST PASSED: 16-byte alignment), 256 bytes: ENOMEM/EAGAIN forced
TEST PASSED: 4096-byte alignment), 256 bytes: ENOMEM/EAGAIN forced
TEST PASSED: 4096-byte alignment), 4096 bytes: ENOMEM/EAGAIN forced
All tests passed successfully
Running 64-bit tests with library none
TEST PASSED: zero alignment fails with EINVAL
TEST PASSED: zero size fails with EINVAL
TEST PASSED: 3-byte alignment fails with EINVAL
TEST PASSED: 7777-byte alignment fails with EINVAL
TEST PASSED: 23-byte alignment fails with EINVAL
TEST PASSED: alignof (char), 1 byte
TEST PASSED: alignof (char), multiple bytes
TEST PASSED: alignof (short), 1 byte
TEST PASSED: alignof (short), 16 byte
TEST PASSED: alignof (int), 1 byte
TEST PASSED: alignof (int), 4 bytes
TEST PASSED: alignof (int), 22 bytes
TEST PASSED: alignof (long long), 7 bytes
TEST PASSED: alignof (long long), 128 bytes
TEST PASSED: alignof (long long), 511 bytes
TEST PASSED: 16-byte alignment), 16 bytes
TEST PASSED: 16-byte alignment), 256 bytes
TEST PASSED: 4096-byte alignment), 256 bytes
TEST PASSED: 4096-byte alignment), 4096 bytes
TEST PASSED: alignof (char), 1 byte: ENOMEM/EAGAIN forced
TEST PASSED: alignof (char), multiple bytes: ENOMEM/EAGAIN forced
TEST PASSED: alignof (short), 1 byte: ENOMEM/EAGAIN forced
TEST PASSED: alignof (short), 16 byte: ENOMEM/EAGAIN forced
TEST PASSED: alignof (int), 1 byte: ENOMEM/EAGAIN forced
TEST PASSED: alignof (int), 4 bytes: ENOMEM/EAGAIN forced
TEST PASSED: alignof (int), 22 bytes: ENOMEM/EAGAIN forced
TEST PASSED: alignof (long long), 7 bytes: ENOMEM/EAGAIN forced
TEST PASSED: alignof (long long), 128 bytes: ENOMEM/EAGAIN forced
TEST PASSED: alignof (long long), 511 bytes: ENOMEM/EAGAIN forced
TEST PASSED: 16-byte alignment), 16 bytes: ENOMEM/EAGAIN forced
TEST PASSED: 16-byte alignment), 256 bytes: ENOMEM/EAGAIN forced
TEST PASSED: 4096-byte alignment), 256 bytes: ENOMEM/EAGAIN forced
TEST PASSED: 4096-byte alignment), 4096 bytes: ENOMEM/EAGAIN forced
All tests passed successfully
Running 32-bit tests with library libumem.so
TEST PASSED: zero alignment fails with EINVAL
TEST PASSED: zero size fails with EINVAL
TEST PASSED: 3-byte alignment fails with EINVAL
TEST PASSED: 7777-byte alignment fails with EINVAL
TEST PASSED: 23-byte alignment fails with EINVAL
TEST PASSED: alignof (char), 1 byte
TEST PASSED: alignof (char), multiple bytes
TEST PASSED: alignof (short), 1 byte
TEST PASSED: alignof (short), 16 byte
TEST PASSED: alignof (int), 1 byte
TEST PASSED: alignof (int), 4 bytes
TEST PASSED: alignof (int), 22 bytes
TEST PASSED: alignof (long long), 7 bytes
TEST PASSED: alignof (long long), 128 bytes
TEST PASSED: alignof (long long), 511 bytes
TEST PASSED: 16-byte alignment), 16 bytes
TEST PASSED: 16-byte alignment), 256 bytes
TEST PASSED: 4096-byte alignment), 256 bytes
TEST PASSED: 4096-byte alignment), 4096 bytes
TEST PASSED: alignof (char), 1 byte: ENOMEM/EAGAIN forced
TEST PASSED: alignof (char), multiple bytes: ENOMEM/EAGAIN forced
TEST PASSED: alignof (short), 1 byte: ENOMEM/EAGAIN forced
TEST PASSED: alignof (short), 16 byte: ENOMEM/EAGAIN forced
TEST PASSED: alignof (int), 1 byte: ENOMEM/EAGAIN forced
TEST PASSED: alignof (int), 4 bytes: ENOMEM/EAGAIN forced
TEST PASSED: alignof (int), 22 bytes: ENOMEM/EAGAIN forced
TEST PASSED: alignof (long long), 7 bytes: ENOMEM/EAGAIN forced
TEST PASSED: alignof (long long), 128 bytes: ENOMEM/EAGAIN forced
TEST PASSED: alignof (long long), 511 bytes: ENOMEM/EAGAIN forced
TEST PASSED: 16-byte alignment), 16 bytes: ENOMEM/EAGAIN forced
TEST PASSED: 16-byte alignment), 256 bytes: ENOMEM/EAGAIN forced
TEST PASSED: 4096-byte alignment), 256 bytes: ENOMEM/EAGAIN forced
TEST PASSED: 4096-byte alignment), 4096 bytes: ENOMEM/EAGAIN forced
All tests passed successfully
Running 64-bit tests with library libumem.so
TEST PASSED: zero alignment fails with EINVAL
TEST PASSED: zero size fails with EINVAL
TEST PASSED: 3-byte alignment fails with EINVAL
TEST PASSED: 7777-byte alignment fails with EINVAL
TEST PASSED: 23-byte alignment fails with EINVAL
TEST PASSED: alignof (char), 1 byte
TEST PASSED: alignof (char), multiple bytes
TEST PASSED: alignof (short), 1 byte
TEST PASSED: alignof (short), 16 byte
TEST PASSED: alignof (int), 1 byte
TEST PASSED: alignof (int), 4 bytes
TEST PASSED: alignof (int), 22 bytes
TEST PASSED: alignof (long long), 7 bytes
TEST PASSED: alignof (long long), 128 bytes
TEST PASSED: alignof (long long), 511 bytes
TEST PASSED: 16-byte alignment), 16 bytes
TEST PASSED: 16-byte alignment), 256 bytes
TEST PASSED: 4096-byte alignment), 256 bytes
TEST PASSED: 4096-byte alignment), 4096 bytes
TEST PASSED: alignof (char), 1 byte: ENOMEM/EAGAIN forced
TEST PASSED: alignof (char), multiple bytes: ENOMEM/EAGAIN forced
TEST PASSED: alignof (short), 1 byte: ENOMEM/EAGAIN forced
TEST PASSED: alignof (short), 16 byte: ENOMEM/EAGAIN forced
TEST PASSED: alignof (int), 1 byte: ENOMEM/EAGAIN forced
TEST PASSED: alignof (int), 4 bytes: ENOMEM/EAGAIN forced
TEST PASSED: alignof (int), 22 bytes: ENOMEM/EAGAIN forced
TEST PASSED: alignof (long long), 7 bytes: ENOMEM/EAGAIN forced
TEST PASSED: alignof (long long), 128 bytes: ENOMEM/EAGAIN forced
TEST PASSED: alignof (long long), 511 bytes: ENOMEM/EAGAIN forced
TEST PASSED: 16-byte alignment), 16 bytes: ENOMEM/EAGAIN forced
TEST PASSED: 16-byte alignment), 256 bytes: ENOMEM/EAGAIN forced
TEST PASSED: 4096-byte alignment), 256 bytes: ENOMEM/EAGAIN forced
TEST PASSED: 4096-byte alignment), 4096 bytes: ENOMEM/EAGAIN forced
All tests passed successfully
Running 32-bit tests with library libmtmalloc.so
TEST PASSED: zero alignment fails with EINVAL
TEST PASSED: zero size fails with EINVAL
TEST PASSED: 3-byte alignment fails with EINVAL
TEST PASSED: 7777-byte alignment fails with EINVAL
TEST PASSED: 23-byte alignment fails with EINVAL
TEST PASSED: alignof (char), 1 byte
TEST PASSED: alignof (char), multiple bytes
TEST PASSED: alignof (short), 1 byte
TEST PASSED: alignof (short), 16 byte
TEST PASSED: alignof (int), 1 byte
TEST PASSED: alignof (int), 4 bytes
TEST PASSED: alignof (int), 22 bytes
TEST PASSED: alignof (long long), 7 bytes
TEST PASSED: alignof (long long), 128 bytes
TEST PASSED: alignof (long long), 511 bytes
TEST PASSED: 16-byte alignment), 16 bytes
TEST PASSED: 16-byte alignment), 256 bytes
TEST PASSED: 4096-byte alignment), 256 bytes
TEST PASSED: 4096-byte alignment), 4096 bytes
aligned_alloc.32: malloc(3C) library libmtmalloc.so not supported, skipping ENOMEM tests
All tests passed successfully
Running 64-bit tests with library libmtmalloc.so
TEST PASSED: zero alignment fails with EINVAL
TEST PASSED: zero size fails with EINVAL
TEST PASSED: 3-byte alignment fails with EINVAL
TEST PASSED: 7777-byte alignment fails with EINVAL
TEST PASSED: 23-byte alignment fails with EINVAL
TEST PASSED: alignof (char), 1 byte
TEST PASSED: alignof (char), multiple bytes
TEST PASSED: alignof (short), 1 byte
TEST PASSED: alignof (short), 16 byte
TEST PASSED: alignof (int), 1 byte
TEST PASSED: alignof (int), 4 bytes
TEST PASSED: alignof (int), 22 bytes
TEST PASSED: alignof (long long), 7 bytes
TEST PASSED: alignof (long long), 128 bytes
TEST PASSED: alignof (long long), 511 bytes
TEST PASSED: 16-byte alignment), 16 bytes
TEST PASSED: 16-byte alignment), 256 bytes
TEST PASSED: 4096-byte alignment), 256 bytes
TEST PASSED: 4096-byte alignment), 4096 bytes
aligned_alloc.64: malloc(3C) library libmtmalloc.so not supported, skipping ENOMEM tests
All tests passed successfully

And here it is as part of the larger libc tests:

rm@harley ~ $ pfexec /opt/libc-tests/bin/libctest 
Test: /opt/libc-tests/tests/aligned_alloc (run as root)           [00:00] [PASS]
Test: /opt/libc-tests/tests/ascftime.32 (run as root)             [00:00] [PASS]
Test: /opt/libc-tests/tests/ascftime.64 (run as root)             [00:00] [PASS]
Test: /opt/libc-tests/tests/asprintf-14933.32 (run as root)       [00:00] [PASS]
Test: /opt/libc-tests/tests/asprintf-14933.64 (run as root)       [00:00] [PASS]
Test: /opt/libc-tests/tests/c11_threads.32 (run as root)          [00:00] [PASS]
Test: /opt/libc-tests/tests/c11_threads.64 (run as root)          [00:00] [PASS]
Test: /opt/libc-tests/tests/c11_tss.32 (run as root)              [00:00] [PASS]
Test: /opt/libc-tests/tests/c11_tss.64 (run as root)              [00:00] [PASS]
Test: /opt/libc-tests/tests/call_once.32 (run as root)            [00:00] [PASS]
Test: /opt/libc-tests/tests/call_once.64 (run as root)            [00:00] [PASS]
Test: /opt/libc-tests/tests/catopen (run as root)                 [00:00] [PASS]
Test: /opt/libc-tests/tests/closefrom.32 (run as root)            [00:00] [PASS]
Test: /opt/libc-tests/tests/closefrom.64 (run as root)            [00:00] [PASS]
Test: /opt/libc-tests/tests/endian.32 (run as root)               [00:00] [PASS]
Test: /opt/libc-tests/tests/endian.64 (run as root)               [00:00] [PASS]
Test: /opt/libc-tests/tests/env-7076.32 (run as root)             [00:00] [PASS]
Test: /opt/libc-tests/tests/env-7076.64 (run as root)             [00:00] [PASS]
Test: /opt/libc-tests/tests/err/err.ksh (run as root)             [00:00] [PASS]
Test: /opt/libc-tests/tests/fexecve_test (run as root)            [00:00] [PASS]
Test: /opt/libc-tests/tests/fnmatch.32 (run as root)              [00:00] [PASS]
Test: /opt/libc-tests/tests/fnmatch.64 (run as root)              [00:00] [PASS]
Test: /opt/libc-tests/tests/fpround_test (run as root)            [00:00] [PASS]
Test: /opt/libc-tests/tests/i18n/bindtextdomain_test (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/isatty.32 (run as root)               [00:00] [PASS]
Test: /opt/libc-tests/tests/isatty.64 (run as root)               [00:00] [PASS]
Test: /opt/libc-tests/tests/memchr.32 (run as root)               [00:00] [PASS]
Test: /opt/libc-tests/tests/memchr.64 (run as root)               [00:00] [PASS]
Test: /opt/libc-tests/tests/memset_s.32 (run as root)             [00:00] [PASS]
Test: /opt/libc-tests/tests/memset_s.64 (run as root)             [00:00] [PASS]
Test: /opt/libc-tests/tests/mutex-16200.32 (run as root)          [00:00] [PASS]
Test: /opt/libc-tests/tests/mutex-16200.64 (run as root)          [00:00] [PASS]
Test: /opt/libc-tests/tests/newlocale_test (run as root)          [00:00] [PASS]
Test: /opt/libc-tests/tests/nl_langinfo_test (run as root)        [00:00] [PASS]
Test: /opt/libc-tests/tests/posix_memalign.32 (run as root)       [00:00] [PASS]
Test: /opt/libc-tests/tests/posix_memalign.64 (run as root)       [00:00] [PASS]
Test: /opt/libc-tests/tests/printf-15294.32 (run as root)         [00:00] [PASS]
Test: /opt/libc-tests/tests/printf-15294.64 (run as root)         [00:00] [PASS]
Test: /opt/libc-tests/tests/printf-6961.64 (run as root)          [00:00] [PASS]
Test: /opt/libc-tests/tests/printf-9511.32 (run as root)          [00:00] [PASS]
Test: /opt/libc-tests/tests/printf-9511.64 (run as root)          [00:00] [PASS]
Test: /opt/libc-tests/tests/priv_gettext (run as root)            [00:00] [PASS]
Test: /opt/libc-tests/tests/psignal (run as root)                 [00:00] [PASS]
Test: /opt/libc-tests/tests/pthread_attr_get_np (run as root)     [00:00] [PASS]
Test: /opt/libc-tests/tests/qsort/qsort_test (run as root)        [00:01] [PASS]
Test: /opt/libc-tests/tests/quick_exit (run as root)              [00:00] [PASS]
Test: /opt/libc-tests/tests/random/arc4key.ksh (run as root)      [00:00] [PASS]
Test: /opt/libc-tests/tests/random/arc4random (run as root)       [00:00] [PASS]
Test: /opt/libc-tests/tests/random/arc4random_fork (run as root)  [00:00] [PASS]
Test: /opt/libc-tests/tests/random/arc4random_forkall (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/random/arc4random_forksig (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/random/arc4random_prefork (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/random/arc4random_preforkall (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/random/arc4random_preforksig (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/random/chacha (run as root)           [00:00] [PASS]
Test: /opt/libc-tests/tests/random/getentropy (run as root)       [00:00] [PASS]
Test: /opt/libc-tests/tests/random/getrandom (run as root)        [00:00] [PASS]
Test: /opt/libc-tests/tests/random/inz_child (run as root)        [00:00] [PASS]
Test: /opt/libc-tests/tests/random/inz_inval (run as root)        [00:00] [PASS]
Test: /opt/libc-tests/tests/random/inz_mlock (run as root)        [00:00] [PASS]
Test: /opt/libc-tests/tests/random/inz_region (run as root)       [00:00] [PASS]
Test: /opt/libc-tests/tests/random/inz_split (run as root)        [00:00] [PASS]
Test: /opt/libc-tests/tests/random/inz_split_vpp (run as root)    [00:00] [PASS]
Test: /opt/libc-tests/tests/random/inz_vpp (run as root)          [00:00] [PASS]
Test: /opt/libc-tests/tests/regex/regex_test (run as root)        [00:00] [PASS]
Test: /opt/libc-tests/tests/select/select.sh (run as root)        [00:04] [PASS]
Test: /opt/libc-tests/tests/set_constraint_handler_s.32 (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/set_constraint_handler_s.64 (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/fileno.32 (run as root)         [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/fileno.64 (run as root)         [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/fmemopentest.32 (run as root)   [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/fmemopentest.64 (run as root)   [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/ftell_ungetc.32 (run as root)   [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/ftell_ungetc.64 (run as root)   [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/ftello_12768.64 (run as root)   [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/ftello_12768.lfs (run as root)  [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/memstream.32 (run as root)      [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/memstream.64 (run as root)      [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/memstream_reopen.32 (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/memstream_reopen.64 (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/open_memstreamtest.32 (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/open_memstreamtest.64 (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/orientation_test.32 (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/orientation_test.64 (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/test_mbrtowc.32 (run as root)   [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/test_mbrtowc.64 (run as root)   [00:00] [PASS]
Test: /opt/libc-tests/tests/strcoll-strxfrm-6907.32 (run as root) [00:01] [PASS]
Test: /opt/libc-tests/tests/strcoll-strxfrm-6907.64 (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/strerror.32 (run as root)             [00:00] [PASS]
Test: /opt/libc-tests/tests/strerror.64 (run as root)             [00:00] [PASS]
Test: /opt/libc-tests/tests/strtonum.32 (run as root)             [00:00] [PASS]
Test: /opt/libc-tests/tests/strtonum.64 (run as root)             [00:00] [PASS]
Test: /opt/libc-tests/tests/thread_name (run as root)             [00:00] [PASS]
Test: /opt/libc-tests/tests/timespec_get.32 (run as root)         [00:00] [PASS]
Test: /opt/libc-tests/tests/timespec_get.64 (run as root)         [00:00] [PASS]
Test: /opt/libc-tests/tests/uchar.32 (run as root)                [00:00] [PASS]
Test: /opt/libc-tests/tests/uchar.64 (run as root)                [00:00] [PASS]
Test: /opt/libc-tests/tests/utimes.32 (run as root)               [00:00] [PASS]
Test: /opt/libc-tests/tests/utimes.64 (run as root)               [00:00] [PASS]
Test: /opt/libc-tests/tests/wcsncasecmp-7344.32 (run as root)     [00:00] [PASS]
Test: /opt/libc-tests/tests/wcsncasecmp-7344.64 (run as root)     [00:00] [PASS]
Test: /opt/libc-tests/tests/wcsncasecmp-7350.32 (run as root)     [00:00] [PASS]
Test: /opt/libc-tests/tests/wcsncasecmp-7350.64 (run as root)     [00:00] [PASS]
Test: /opt/libc-tests/tests/wcsncasecmp.32 (run as root)          [00:00] [PASS]
Test: /opt/libc-tests/tests/wcsncasecmp.64 (run as root)          [00:00] [PASS]
Test: /opt/libc-tests/tests/wcsrtombs_test (run as root)          [00:00] [PASS]
Test: /opt/libc-tests/tests/wctype_test (run as root)             [00:00] [PASS]
Test: /opt/libc-tests/tests/symbols/setup (run as root)           [00:00] [PASS]
Test: /opt/libc-tests/tests/symbols/assert_h (run as root)        [00:00] [PASS]
Test: /opt/libc-tests/tests/symbols/ctype_h (run as root)         [00:14] [PASS]
Test: /opt/libc-tests/tests/symbols/dirent_h (run as root)        [00:03] [PASS]
Test: /opt/libc-tests/tests/symbols/fcntl_h (run as root)         [00:08] [PASS]
Test: /opt/libc-tests/tests/symbols/locale_h (run as root)        [00:06] [PASS]
Test: /opt/libc-tests/tests/symbols/math_h (run as root)          [00:02] [PASS]
Test: /opt/libc-tests/tests/symbols/netdb_h (run as root)         [00:00] [PASS]
Test: /opt/libc-tests/tests/symbols/pthread_h (run as root)       [00:01] [PASS]
Test: /opt/libc-tests/tests/symbols/signal_h (run as root)        [00:01] [PASS]
Test: /opt/libc-tests/tests/symbols/stdalign_h (run as root)      [00:01] [PASS]
Test: /opt/libc-tests/tests/symbols/stddef_h (run as root)        [00:00] [PASS]
Test: /opt/libc-tests/tests/symbols/stdio_h (run as root)         [00:07] [PASS]
Test: /opt/libc-tests/tests/symbols/stdlib_h (run as root)        [00:08] [PASS]
Test: /opt/libc-tests/tests/symbols/stdnoreturn_h (run as root)   [00:00] [PASS]
Test: /opt/libc-tests/tests/symbols/string_h (run as root)        [00:01] [PASS]
Test: /opt/libc-tests/tests/symbols/strings_h (run as root)       [00:00] [PASS]
Test: /opt/libc-tests/tests/symbols/sys_atomic_h (run as root)    [00:54] [PASS]
Test: /opt/libc-tests/tests/symbols/sys_mman_h (run as root)      [00:15] [PASS]
Test: /opt/libc-tests/tests/symbols/sys_stat_h (run as root)      [00:03] [PASS]
Test: /opt/libc-tests/tests/symbols/sys_time_h (run as root)      [00:02] [PASS]
Test: /opt/libc-tests/tests/symbols/sys_timeb_h (run as root)     [00:00] [PASS]
Test: /opt/libc-tests/tests/symbols/time_h (run as root)          [00:00] [PASS]
Test: /opt/libc-tests/tests/symbols/threads_h (run as root)       [00:15] [PASS]
Test: /opt/libc-tests/tests/symbols/ucontext_h (run as root)      [00:01] [PASS]
Test: /opt/libc-tests/tests/symbols/unistd_h (run as root)        [00:11] [PASS]
Test: /opt/libc-tests/tests/symbols/wchar_h (run as root)         [00:06] [PASS]
Test: /opt/libc-tests/tests/symbols/wctype_h (run as root)        [00:14] [PASS]

Results Summary
PASS     135

Running Time:   00:03:18
Percent passed: 100.0%
Log directory:  /var/tmp/test_results/20240512T175403
Actions #10

Updated by Robert Mustacchi 14 days ago

  • Gerrit CR set to 3476
Actions #11

Updated by Ralf J 14 days ago

I don't think I can comment on gerrit.

Rounding up to 4 does not seem sufficient to me. On a 64bit system, what's the primitive type with the highest alignment? On x86-64, it seems like max_align_t has alignment 16 (https://godbolt.org/z/xYoY3ejrc). There is a type with size 16 and align 16 (https://godbolt.org/z/z544GK85b). So aligned_alloc must guarantee that every request with size at least 16 is aligned to 16, to fit that type.

Actions #12

Updated by Robert Mustacchi 14 days ago

I don't think I can comment on gerrit.

I'm assuming you followed https://illumos.org/docs/contributing/gerrit/ and it didn't work. I'll see if I can follow up with folks and figure out what happened.

Rounding up to 4 does not seem sufficient to me. On a 64bit system, what's the primitive type with the highest alignment? On x86-64, it seems like max_align_t has alignment 16 (https://godbolt.org/z/xYoY3ejrc). There is a type with size 16 and align 16 (https://godbolt.org/z/z544GK85b). So aligned_alloc must guarantee that every request with size at least 16 is aligned to 16, to fit that type.

So my expectation is the underlying memalign implementations that this calls into take care of this. At least at a quick glance, the umem one certainly does as it'll just call malloc for smaller alignments. The same is true from my initial reading of the libc memalign, but I'll need to spend some time there to confirm. Put differently, I think memalign effectively has to operate logically under the same constraints as the other library routines here. Though I'll admit as with a lot of the rest of this journey I'm not entirely confident here. We could just change it to be rounded up to the value of _MAX_ALIGNMENT from <sys/isa_defs.h> out of paranoia though.

Actions #13

Updated by Robert Mustacchi 13 days ago

  • Subject changed from aligned_alloc not conformat with C11 standard to aligned_alloc not conformant with C11 standard
Actions #14

Updated by Ralf J 13 days ago

I'm assuming you followed https://illumos.org/docs/contributing/gerrit/ and it didn't work. I'll see if I can follow up with folks and figure out what happened.

I think it's a user error, I'm just not seeing a text box to put a comment in.^^ The Gerrit UI is extremely confusing to someone used to Github or Gitlab. It took me a bit just to find the diff. ;)

So my expectation is the underlying memalign implementations that this calls into take care of this.

Ah, that makes sense, thanks.

Actions #15

Updated by Bill Sommerfeld 12 days ago

Due to past experience I've been sensitized to changes that have the potential to cause an application's memory use to suddenly expand unexpectedly, so setting a floor of _MAX_ALIGNMENT caught my attention. With our allocator on LP64 it currently doesn't matter, but applications can interpose on the malloc family and may well do so to get greater space efficiency, and our aligned_alloc implementation has a comment suggesting a desire to work with an interposed memalign.

Here's my reading on what the specs say around small allocations.

There are two constraints on alignment - what the application asks for and will use and what the underlying memory allocator requires for its own bookkeeping.

We should trust that an application that says it needs N byte alignment doesn't actually need 2N byte alignment.

So then only becomes a question of constraints from the underlying allocator, likely from metadata objects which the allocator places around the allocated memory.

So why sizeof(void *)? IEEE 1003.1-2017 at https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_memalign.html says the smallest acceptable alignment for posix_memalign is sizeof(void *); this is mentioned in passing in https://en.cppreference.com/w/c/memory/aligned_alloc.

If someone interposes on the malloc family and supplies a memalign, that's a more reasonable floor to assume.

Actions #16

Updated by Ralf J 12 days ago

We should trust that an application that says it needs N byte alignment doesn't actually need 2N byte alignment.

The C standard is very clear that no matter the requested alignment, whatever aligned_alloc returns must be sufficiently aligned for any type with fundamental alignment that fits the requested size. So it doesn't really matter how much one trusts the application; any deviation from the standard is a big risk in terms of portability.

The C standard also says "Fundamental alignments shall be supported by the implementation for objects of all storage durations", so it would be rather strange to declare an alignment of 2 "not supported" by returning NULL.

This doesn't expand an application's memory consumption much compared to the status quo: the status quo is that applications have to round up their request to at least the pointer size, so if they want 4KiB of memory 1-aligned they already will ask for unnecessarily high alignment. Having the implementation do the rounding-up instead of letting the application do it merely increases portability. So the only real change here is that it has to round up to 16 instead of 8 (since max_align_t is usually twice the pointer size). It is unfortunate that this is necessary, but someone would have to convince the C committee to change this as they "own" this API. An application that wants to avoid this can always use posix_memalign instead. (Having dug through aligned_alloc's specification, that's what I would generally recommend anyway. It seems to be available on pretty much every POSIX system, which makes it about equivalent to aligned_alloc -- Windows has neither of them.)

Actions #17

Updated by Robert Mustacchi 9 days ago

So I was taking a look at the standard again with fresh eyes here. First let me summarize where I think we agree:

  • The maximum size fundamental alignment for illumos on amd64 is 16 bytes from a long double. This is the max_align_t.
  • Alignments less than 16 are still valid fundamental alignments per 6.2.8.
  • All allocation routines are required to return "properly" aligned pointers.

So the real question is how do you interpret this bit of C11 (N1570):

The pointer returned if the allocation succeeds is suitably aligned so that it may be assigned to
a pointer to any type of object with a fundamental alignment requirement and then used
to access such an object or an array of such objects in the space allocated (until the space
is explicitly deallocated).

I think we would all agree that if you allocate for the moment 4 bytes that the following is true:

  • It would be considered an error / undefined behavior or some other more proper term to store more than 4 bytes in that location.
  • It must have alignment returned so that any 4 byte object can fit in there.
  • Currently in the AMD64 psABI, all of the Scalar types have a sizeof() and alignof() that is equivalent.

Things where I think there are different opinions if I'm capturing Bill and Ralf correctly is basically: "Does a pointer returned by aligned_alloc/malloc satisfy ALL fundamental alignments or only those it is capable of storing an object in."

I'm going to see if I can reach out to through a colleague to folks on the committee and in the mean time land the initial version of this which at least fixes the problem we have with smaller alignment requests outright failing.

Actions #18

Updated by Ralf J 8 days ago

Things where I think there are different opinions if I'm capturing Bill and Ralf correctly is basically: "Does a pointer returned by aligned_alloc/malloc satisfy ALL fundamental alignments or only those it is capable of storing an object in."

I don't quite understand how that relates to the previous discussion, to be honest. I'm completely on-board with the interpretation "an allocation of size N has to be aligned such that objects of size at most N with fundamental alignments can be stored there". This is, in fact, what jemalloc actually implements (a 4-byte allocation is not necessarily 16-byte aligned there). I did not intend to disagree with that interpretation, so I am sorry if some of my statements were confusing here.

My claim is that aligned_alloc(1, 4) (i.e. size 4, alignment 1) has to still be aligned to 4. The standard has a footnote that very explicitly says so, and it is based on the text you quoted. (The wording here changed a bit with C23/N3096 so I'd recommend looking at the latest version.)

Actions #19

Updated by Robert Mustacchi 8 days ago

Ralf J wrote in #note-18:

Things where I think there are different opinions if I'm capturing Bill and Ralf correctly is basically: "Does a pointer returned by aligned_alloc/malloc satisfy ALL fundamental alignments or only those it is capable of storing an object in."

I don't quite understand how that relates to the previous discussion, to be honest. I'm completely on-board with the interpretation "an allocation of size N has to be aligned such that objects of size at most N with fundamental alignments can be stored there". This is, in fact, what jemalloc actually implements (a 4-byte allocation is not necessarily 16-byte aligned there). I did not intend to disagree with that interpretation, so I am sorry if some of my statements were confusing here.

OK, thanks for that clarification. I think I had misinterpreted things then. Sorry about that.

My claim is that aligned_alloc(1, 4) (i.e. size 4, alignment 1) has to still be aligned to 4. The standard has a footnote that very explicitly says so, and it is based on the text you quoted. (The wording here changed a bit with C23/N3096 so I'd recommend looking at the latest version.)

Yes, that I think (hope?) we all agree with. I think based on this then I will revert this to the version that rounds up the passed in alignment to the minimum of what memalign requires and then rely on the normal allocation path to get here. Thanks for everyone's patience on this one.

Actions #20

Updated by Robert Mustacchi 3 days ago

Reran all the tests one last time ahead of RTI:

rm@harley ~ $ pfexec /opt/libc-tests/bin/libctest 
Test: /opt/libc-tests/tests/aligned_alloc (run as root)           [00:00] [PASS]
Test: /opt/libc-tests/tests/ascftime.32 (run as root)             [00:00] [PASS]
Test: /opt/libc-tests/tests/ascftime.64 (run as root)             [00:00] [PASS]
Test: /opt/libc-tests/tests/asprintf-14933.32 (run as root)       [00:00] [PASS]
Test: /opt/libc-tests/tests/asprintf-14933.64 (run as root)       [00:00] [PASS]
Test: /opt/libc-tests/tests/c11_threads.32 (run as root)          [00:00] [PASS]
Test: /opt/libc-tests/tests/c11_threads.64 (run as root)          [00:00] [PASS]
Test: /opt/libc-tests/tests/c11_tss.32 (run as root)              [00:00] [PASS]
Test: /opt/libc-tests/tests/c11_tss.64 (run as root)              [00:00] [PASS]
Test: /opt/libc-tests/tests/call_once.32 (run as root)            [00:00] [PASS]
Test: /opt/libc-tests/tests/call_once.64 (run as root)            [00:00] [PASS]
Test: /opt/libc-tests/tests/catopen (run as root)                 [00:00] [PASS]
Test: /opt/libc-tests/tests/closefrom.32 (run as root)            [00:00] [PASS]
Test: /opt/libc-tests/tests/closefrom.64 (run as root)            [00:00] [PASS]
Test: /opt/libc-tests/tests/endian.32 (run as root)               [00:00] [PASS]
Test: /opt/libc-tests/tests/endian.64 (run as root)               [00:00] [PASS]
Test: /opt/libc-tests/tests/env-7076.32 (run as root)             [00:00] [PASS]
Test: /opt/libc-tests/tests/env-7076.64 (run as root)             [00:00] [PASS]
Test: /opt/libc-tests/tests/err/err.ksh (run as root)             [00:00] [PASS]
Test: /opt/libc-tests/tests/fexecve_test (run as root)            [00:00] [PASS]
Test: /opt/libc-tests/tests/fnmatch.32 (run as root)              [00:00] [PASS]
Test: /opt/libc-tests/tests/fnmatch.64 (run as root)              [00:00] [PASS]
Test: /opt/libc-tests/tests/fpround_test (run as root)            [00:00] [PASS]
Test: /opt/libc-tests/tests/i18n/bindtextdomain_test (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/isatty.32 (run as root)               [00:00] [PASS]
Test: /opt/libc-tests/tests/isatty.64 (run as root)               [00:00] [PASS]
Test: /opt/libc-tests/tests/memchr.32 (run as root)               [00:00] [PASS]
Test: /opt/libc-tests/tests/memchr.64 (run as root)               [00:00] [PASS]
Test: /opt/libc-tests/tests/memset_s.32 (run as root)             [00:00] [PASS]
Test: /opt/libc-tests/tests/memset_s.64 (run as root)             [00:00] [PASS]
Test: /opt/libc-tests/tests/mutex-16200.32 (run as root)          [00:00] [PASS]
Test: /opt/libc-tests/tests/mutex-16200.64 (run as root)          [00:00] [PASS]
Test: /opt/libc-tests/tests/newlocale_test (run as root)          [00:00] [PASS]
Test: /opt/libc-tests/tests/nl_langinfo_test (run as root)        [00:00] [PASS]
Test: /opt/libc-tests/tests/posix_memalign.32 (run as root)       [00:00] [PASS]
Test: /opt/libc-tests/tests/posix_memalign.64 (run as root)       [00:00] [PASS]
Test: /opt/libc-tests/tests/printf-15294.32 (run as root)         [00:00] [PASS]
Test: /opt/libc-tests/tests/printf-15294.64 (run as root)         [00:00] [PASS]
Test: /opt/libc-tests/tests/printf-6961.64 (run as root)          [00:00] [PASS]
Test: /opt/libc-tests/tests/printf-9511.32 (run as root)          [00:00] [PASS]
Test: /opt/libc-tests/tests/printf-9511.64 (run as root)          [00:00] [PASS]
Test: /opt/libc-tests/tests/priv_gettext (run as root)            [00:00] [PASS]
Test: /opt/libc-tests/tests/psignal (run as root)                 [00:00] [PASS]
Test: /opt/libc-tests/tests/pthread_attr_get_np (run as root)     [00:00] [PASS]
Test: /opt/libc-tests/tests/qsort/qsort_test (run as root)        [00:01] [PASS]
Test: /opt/libc-tests/tests/quick_exit (run as root)              [00:00] [PASS]
Test: /opt/libc-tests/tests/random/arc4key.ksh (run as root)      [00:00] [PASS]
Test: /opt/libc-tests/tests/random/arc4random (run as root)       [00:00] [PASS]
Test: /opt/libc-tests/tests/random/arc4random_fork (run as root)  [00:00] [PASS]
Test: /opt/libc-tests/tests/random/arc4random_forkall (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/random/arc4random_forksig (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/random/arc4random_prefork (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/random/arc4random_preforkall (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/random/arc4random_preforksig (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/random/chacha (run as root)           [00:00] [PASS]
Test: /opt/libc-tests/tests/random/getentropy (run as root)       [00:00] [PASS]
Test: /opt/libc-tests/tests/random/getrandom (run as root)        [00:00] [PASS]
Test: /opt/libc-tests/tests/random/inz_child (run as root)        [00:00] [PASS]
Test: /opt/libc-tests/tests/random/inz_inval (run as root)        [00:00] [PASS]
Test: /opt/libc-tests/tests/random/inz_mlock (run as root)        [00:00] [PASS]
Test: /opt/libc-tests/tests/random/inz_region (run as root)       [00:00] [PASS]
Test: /opt/libc-tests/tests/random/inz_split (run as root)        [00:00] [PASS]
Test: /opt/libc-tests/tests/random/inz_split_vpp (run as root)    [00:00] [PASS]
Test: /opt/libc-tests/tests/random/inz_vpp (run as root)          [00:00] [PASS]
Test: /opt/libc-tests/tests/regex/regex_test (run as root)        [00:00] [PASS]
Test: /opt/libc-tests/tests/select/select.sh (run as root)        [00:04] [PASS]
Test: /opt/libc-tests/tests/set_constraint_handler_s.32 (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/set_constraint_handler_s.64 (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/fileno.32 (run as root)         [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/fileno.64 (run as root)         [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/fmemopentest.32 (run as root)   [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/fmemopentest.64 (run as root)   [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/ftell_ungetc.32 (run as root)   [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/ftell_ungetc.64 (run as root)   [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/ftello_12768.64 (run as root)   [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/ftello_12768.lfs (run as root)  [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/memstream.32 (run as root)      [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/memstream.64 (run as root)      [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/memstream_reopen.32 (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/memstream_reopen.64 (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/open_memstreamtest.32 (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/open_memstreamtest.64 (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/orientation_test.32 (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/orientation_test.64 (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/test_mbrtowc.32 (run as root)   [00:00] [PASS]
Test: /opt/libc-tests/tests/stdio/test_mbrtowc.64 (run as root)   [00:00] [PASS]
Test: /opt/libc-tests/tests/strcoll-strxfrm-6907.32 (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/strcoll-strxfrm-6907.64 (run as root) [00:00] [PASS]
Test: /opt/libc-tests/tests/strerror.32 (run as root)             [00:00] [PASS]
Test: /opt/libc-tests/tests/strerror.64 (run as root)             [00:00] [PASS]
Test: /opt/libc-tests/tests/strtonum.32 (run as root)             [00:00] [PASS]
Test: /opt/libc-tests/tests/strtonum.64 (run as root)             [00:00] [PASS]
Test: /opt/libc-tests/tests/thread_name (run as root)             [00:00] [PASS]
Test: /opt/libc-tests/tests/timespec_get.32 (run as root)         [00:00] [PASS]
Test: /opt/libc-tests/tests/timespec_get.64 (run as root)         [00:00] [PASS]
Test: /opt/libc-tests/tests/uchar.32 (run as root)                [00:00] [PASS]
Test: /opt/libc-tests/tests/uchar.64 (run as root)                [00:00] [PASS]
Test: /opt/libc-tests/tests/utimes.32 (run as root)               [00:00] [PASS]
Test: /opt/libc-tests/tests/utimes.64 (run as root)               [00:00] [PASS]
Test: /opt/libc-tests/tests/wcsncasecmp-7344.32 (run as root)     [00:00] [PASS]
Test: /opt/libc-tests/tests/wcsncasecmp-7344.64 (run as root)     [00:00] [PASS]
Test: /opt/libc-tests/tests/wcsncasecmp-7350.32 (run as root)     [00:00] [PASS]
Test: /opt/libc-tests/tests/wcsncasecmp-7350.64 (run as root)     [00:00] [PASS]
Test: /opt/libc-tests/tests/wcsncasecmp.32 (run as root)          [00:00] [PASS]
Test: /opt/libc-tests/tests/wcsncasecmp.64 (run as root)          [00:00] [PASS]
Test: /opt/libc-tests/tests/wcsrtombs_test (run as root)          [00:00] [PASS]
Test: /opt/libc-tests/tests/wctype_test (run as root)             [00:00] [PASS]
Test: /opt/libc-tests/tests/symbols/setup (run as root)           [00:00] [PASS]
Test: /opt/libc-tests/tests/symbols/assert_h (run as root)        [00:00] [PASS]
Test: /opt/libc-tests/tests/symbols/ctype_h (run as root)         [00:13] [PASS]
Test: /opt/libc-tests/tests/symbols/dirent_h (run as root)        [00:03] [PASS]
Test: /opt/libc-tests/tests/symbols/fcntl_h (run as root)         [00:08] [PASS]
Test: /opt/libc-tests/tests/symbols/locale_h (run as root)        [00:06] [PASS]
Test: /opt/libc-tests/tests/symbols/math_h (run as root)          [00:02] [PASS]
Test: /opt/libc-tests/tests/symbols/netdb_h (run as root)         [00:00] [PASS]
Test: /opt/libc-tests/tests/symbols/pthread_h (run as root)       [00:01] [PASS]
Test: /opt/libc-tests/tests/symbols/signal_h (run as root)        [00:00] [PASS]
Test: /opt/libc-tests/tests/symbols/stdalign_h (run as root)      [00:01] [PASS]
Test: /opt/libc-tests/tests/symbols/stddef_h (run as root)        [00:00] [PASS]
Test: /opt/libc-tests/tests/symbols/stdio_h (run as root)         [00:07] [PASS]
Test: /opt/libc-tests/tests/symbols/stdlib_h (run as root)        [00:08] [PASS]
Test: /opt/libc-tests/tests/symbols/stdnoreturn_h (run as root)   [00:00] [PASS]
Test: /opt/libc-tests/tests/symbols/string_h (run as root)        [00:01] [PASS]
Test: /opt/libc-tests/tests/symbols/strings_h (run as root)       [00:00] [PASS]
Test: /opt/libc-tests/tests/symbols/sys_atomic_h (run as root)    [00:51] [PASS]
Test: /opt/libc-tests/tests/symbols/sys_mman_h (run as root)      [00:16] [PASS]
Test: /opt/libc-tests/tests/symbols/sys_stat_h (run as root)      [00:04] [PASS]
Test: /opt/libc-tests/tests/symbols/sys_time_h (run as root)      [00:02] [PASS]
Test: /opt/libc-tests/tests/symbols/sys_timeb_h (run as root)     [00:00] [PASS]
Test: /opt/libc-tests/tests/symbols/time_h (run as root)          [00:00] [PASS]
Test: /opt/libc-tests/tests/symbols/threads_h (run as root)       [00:16] [PASS]
Test: /opt/libc-tests/tests/symbols/ucontext_h (run as root)      [00:01] [PASS]
Test: /opt/libc-tests/tests/symbols/unistd_h (run as root)        [00:11] [PASS]
Test: /opt/libc-tests/tests/symbols/wchar_h (run as root)         [00:06] [PASS]
Test: /opt/libc-tests/tests/symbols/wctype_h (run as root)        [00:15] [PASS]

Results Summary
PASS     135

Running Time:   00:03:16
Percent passed: 100.0%
Log directory:  /var/tmp/test_results/20240523T172644
Actions #21

Updated by Electric Monk 1 day ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 3448eae2e9d99e7fadeb43056eb8e788c7ea93be

commit  3448eae2e9d99e7fadeb43056eb8e788c7ea93be
Author: Robert Mustacchi <rm@fingolfin.org>
Date:   2024-05-24T16:28:43.000Z

    16545 aligned_alloc not conformant with C11 standard
    16557 umem_setmtbf() misses vmem_mtbf
    Reviewed by: Gordon Ross <Gordon.W.Ross@gmail.com>
    Reviewed by: Andy Fiddaman <illumos@fiddaman.net>
    Reviewed by: Bill Sommerfeld <sommerfeld@hamachi.org>
    Approved by: Patrick Mooney <pmooney@pfmooney.com>

Actions

Also available in: Atom PDF