conformtest: Add x32 XFAILs for mq_attr element types (bug 21279) [committed]

Submitted by Joseph S. Myers on March 20, 2017, 9:31 p.m.

Details

Message ID alpine.DEB.2.20.1703202130510.14934@digraph.polyomino.org.uk
State New
Headers show

Commit Message

Joseph S. Myers March 20, 2017, 9:31 p.m.
POSIX specifies long as the type of elements of struct mq_attr.  For
x32, they are __syscall_slong_t (i.e. long long).  This patch XFAILs
the corresponding tests for x32 in the conformtest expectations (the
bug should not be closed without an actual fix).

Tested with build-many-glibcs.py.  Committed.

2017-03-20  Joseph Myers  <joseph@codesourcery.com>

	[BZ #21279]
	* sysdeps/unix/sysv/linux/x86_64/x32/Makefile
	[$(subdir) = conform] (conformtest-xfail-conds): Update comment.
	* conform/data/mqueue.h-data (mq_attr.mq_flags): XFAIL for
	x86_64-x32-linux.
	(mq_attr.mq_maxmsg): Likewise.
	(mq_attr.mq_msgsize): Likewise.
	(mq_attr.mq_curmsgs): Likewise.

Comments

Zack Weinberg March 22, 2017, 8:27 p.m.
On Mon, Mar 20, 2017 at 5:31 PM, Joseph Myers <joseph@codesourcery.com> wrote:
> POSIX specifies long as the type of elements of struct mq_attr.

I am extremely disappointed to learn that POSIX didn't just make this
mistake with struct timespec.

zw
Joseph S. Myers March 22, 2017, 9:06 p.m.
On Wed, 22 Mar 2017, Zack Weinberg wrote:

> On Mon, Mar 20, 2017 at 5:31 PM, Joseph Myers <joseph@codesourcery.com> wrote:
> > POSIX specifies long as the type of elements of struct mq_attr.
> 
> I am extremely disappointed to learn that POSIX didn't just make this
> mistake with struct timespec.

I think it's a lot more plausibly a mistake for mq_attr than for timespec 
(and thus a lot more plausible that a future POSIX version might add 
typedefs here), since as far as I can tell valid values for these fields 
could exceed the width of long, but they clearly can't for tv_nsec.  
(Though it's arguably similarly a mistake that printf functions return 
int, with a consequent limit on the number of bytes output.)

Patch hide | download patch | download mbox

diff --git a/conform/data/mqueue.h-data b/conform/data/mqueue.h-data
index 76652ce..c7d40ba 100644
--- a/conform/data/mqueue.h-data
+++ b/conform/data/mqueue.h-data
@@ -10,10 +10,11 @@  element {struct sigevent} {void(*} sigev_notify_function )(union sigval)
 element {struct sigevent} {pthread_attr_t*} sigev_notify_attributes
 
 type {struct mq_attr}
-element {struct mq_attr} long mq_flags
-element {struct mq_attr} long mq_maxmsg
-element {struct mq_attr} long mq_msgsize
-element {struct mq_attr} long mq_curmsgs
+// Bug 21279: mq_attr elements have wrong type.
+xfail[x86_64-x32-linux]-element {struct mq_attr} long mq_flags
+xfail[x86_64-x32-linux]-element {struct mq_attr} long mq_maxmsg
+xfail[x86_64-x32-linux]-element {struct mq_attr} long mq_msgsize
+xfail[x86_64-x32-linux]-element {struct mq_attr} long mq_curmsgs
 
 function int mq_close (mqd_t)
 function int mq_getattr (mqd_t, struct mq_attr*)
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/Makefile b/sysdeps/unix/sysv/linux/x86_64/x32/Makefile
index 72de386..16b768d 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/Makefile
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/Makefile
@@ -6,6 +6,6 @@  sysdep_routines += arch_prctl
 endif
 
 ifeq ($(subdir),conform)
-# For bug 16437.
+# For bugs 16437 and 21279.
 conformtest-xfail-conds += x86_64-x32-linux
 endif