]> sourceware.org Git - newlib-cygwin.git/commit
Cygwin: cygtls: fix context alignment
authorCorinna Vinschen <corinna@vinschen.de>
Mon, 29 Aug 2022 13:18:53 +0000 (15:18 +0200)
committerCorinna Vinschen <corinna@vinschen.de>
Mon, 29 Aug 2022 13:18:53 +0000 (15:18 +0200)
commitdcab768cb93e59712af5818736c4de783ae2c612
tree148ba764d72ccf276a1c752798400fdf48d517c1
parent717c36c0a4e387a73146c1181b7b89f091176e85
Cygwin: cygtls: fix context alignment

A hang was encountered, apparently triggered by commit 63b503916d42,
changing tls_pathbufs from malloc'ed to HeapAlloc'ed memory.  After
lengthy debugging it transpired that adding the heap handle to the
tls_pathbuf struct added 8 bytes to the cygtls area, thus moving
the "context" member by 8 bytes, too, so it was suddently unaligned.

Fix this for now by changing the alignment.

Fix this once and for all, by adding code to the gentls_offsets script
to check if the alignment of the "context" member is 16 bytes.  If not,
print a matching error message, remove the just generated file, and exit
with error.

FIXME: It would be really nice to find a way to auomate the correct
alignment of the "context" member, but I don't see any way to use
alignment attributes to get what we need here.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygwin/local_includes/cygtls.h
winsup/cygwin/scripts/gentls_offsets
This page took 0.030032 seconds and 5 git commands to generate.