[strace/strace] static assert (#133)
strace-devel mailing list
notifications at github.com
Thu Apr 16 21:51:28 UTC 2020
On Fri, Apr 10, 2020 at 01:20:03PM -0700, Jory A. Pratt wrote:
> In file included from static_assert.h:11,
> from v4l2.c:13:
> xlat/v4l2_ioctl_cmds.h:43:1: error: static assertion failed: "VIDIOC_QUERYBUF != _IOWR(\'V\', 9, struct_v4l2_buffer)"
> 43 | static_assert((VIDIOC_QUERYBUF) == (_IOWR('V', 9, struct_v4l2_buffer)), "VIDIOC_QUERYBUF != _IOWR('V', 9, struct_v4l2_buffer)");
> | ^~~~~~~~~~~~~
> xlat/v4l2_ioctl_cmds.h:64:1: error: static assertion failed: "VIDIOC_QBUF != _IOWR(\'V\', 15, struct_v4l2_buffer)"
> 64 | static_assert((VIDIOC_QBUF) == (_IOWR('V', 15, struct_v4l2_buffer)), "VIDIOC_QBUF != _IOWR('V', 15, struct_v4l2_buffer)");
> | ^~~~~~~~~~~~~
> xlat/v4l2_ioctl_cmds.h:71:1: error: static assertion failed: "VIDIOC_DQBUF != _IOWR(\'V\', 17, struct_v4l2_buffer)"
> 71 | static_assert((VIDIOC_DQBUF) == (_IOWR('V', 17, struct_v4l2_buffer)), "VIDIOC_DQBUF != _IOWR('V', 17, struct_v4l2_buffer)");
>
> This is build using linux-headers-5.6 with musl-1.2.0, this is a regression as 5.5 compiles fine.
The reason why 5.5 compiles fine is that the check was introduced in 5.6,
but the problem lies elsewhere.
Definitions of VIDIOC_QUERYBUF, VIDIOC_QBUF, and VIDIOC_DQBUF in
<linux/videodev2.h> use struct v4l2_buffer which in turn uses struct timeval.
The size of struct timeval on a traditional 32-bit architecture
like x86 depends on libc and its version thanks to time_t problem.
As result, the value of VIDIOC_QUERYBUF on a traditional 32-bit
architecture like x86 depends on libc and its version.
When v4l2.c is compiled in mpers mode to handle x86 and x32 personality
syscalls on x86_64, the value for VIDIOC_QUERYBUF is taken from the
appropriate linux/*/ioctls_inc*.h file. There is only one value there for
each architecture, not two. If you are unhappy enough to have time_t size
different from the one used to generate that ioctls_inc file, you get this
failed assertion.
The kernel starting with Linux kernel commit v5.6-rc1~93^2~102
supports both sets of ioctl values, but strace will recognize
and decode only one of them so far.
I don't see an easy fix of this issue for early adopters of 64-bit
time_t on 32-bit architectures, sorry.
--
ldv
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/strace/strace/issues/133#issuecomment-614915461
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20200416/81a631a6/attachment.html>
More information about the Strace-devel
mailing list