Closed pgoodman closed 1 year ago
From uio_internal.h
:
It should be possible to reproduce this issue outside of XNU.
Minimal reproducer:
union iovecs {
void *a;
int *b;
};
typedef char __attribute__((aligned(_Alignof(union iovecs)))) uio_stackbuf_t;
int main() {
uio_stackbuf_t uio_buf[1];
return 0;
}
On clang 15 this compiles: https://godbolt.org/z/vTfh1jdzY On clang 16 this doesn't compile: https://godbolt.org/z/8eMdznce1
As far as I can tell, this is actually a bug in XNU.
The last time I saw an issue like this, it was related to a pragma that could push a pack. This could be similar.
Strategy for diagnosing this issue:
pasta::SaveFirstErrorDiagConsumer::HandleDiagnostic
Example from nfs_serv.c: