glibc build failure for Hurd with mainline GCC
Joseph Myers
joseph@codesourcery.com
Thu Oct 14 21:15:59 GMT 2021
The build failures in the compilers stage of a build-many-glibcs.py build
are now down to just a failure for i686-gnu, which I hope the Hurd
maintainers might look at.
The error reported is:
In file included from intr-msg.c:25:
intr-msg.c: In function '_hurd_intr_rpc_mach_msg':
../sysdeps/mach/hurd/i386/intr-msg.h:48:21: error: array subscript -1 is outside array bounds of 'mach_msg_header_t[0]' [-Werror=array-bounds]
48 | : "m" ((&msg)[-1]), "m" (*cancel_p), "i" (EINTR) \
| ~~~~~~^~~~
intr-msg.c:118:9: note: in expansion of macro 'INTR_MSG_TRAP'
118 | err = INTR_MSG_TRAP (msg, option, send_size,
| ^~~~~~~~~~~~~
intr-msg.c:32:45: note: at offset -4 into object 'msg' of size 4
32 | _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg,
| ~~~~~~~~~~~~~~~~~~~^~~
As far as I can tell, this seems to be reporting a genuine issue. The asm
in INTR_MSG_TRAP has inputs saying it accesses ((&msg)[-1]). And in the
call to that macro from _hurd_intr_rpc_mach_msg, msg is a function
parameter. That is, this code seems to be taking the address of a
function parameter, then looking at whatever comes before that function
parameter in memory, which doesn't make much sense.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list