|
From: <sv...@va...> - 2014-10-21 07:20:28
|
Author: florian
Date: Tue Oct 21 08:20:20 2014
New Revision: 14646
Log:
Add support for ioctl(fd, TIOCSIG, signal_number) which used
to issue a false complaint. Fixes BZ #339706
Source patch by David Herrmann (dh....@gm...).
Testcase by myself.
Added:
trunk/memcheck/tests/linux/ioctl-tiocsig.c
trunk/memcheck/tests/linux/ioctl-tiocsig.stderr.exp
trunk/memcheck/tests/linux/ioctl-tiocsig.vgtest
Modified:
trunk/NEWS
trunk/coregrind/m_syswrap/syswrap-linux.c
trunk/include/vki/vki-linux.h
trunk/memcheck/tests/linux/ (props changed)
trunk/memcheck/tests/linux/Makefile.am
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Tue Oct 21 08:20:20 2014
@@ -42,6 +42,7 @@
339688 Mac-specific ASM does not support .version directive (cpuid,
tronical and pushfpopf tests)
+339706 Fix false positive for ioctl(TIOCSIG) on linux
339721 assertion 'check_sibling == sibling' failed in readdwarf3.c ...
339789 Fix none/tests/execve test on Mac OS X 10.9
339808 Fix none/tests/rlimit64_nofile test on Mac OS X 10.9
Modified: trunk/coregrind/m_syswrap/syswrap-linux.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-linux.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-linux.c Tue Oct 21 08:20:20 2014
@@ -5481,6 +5481,7 @@
case VKI_TCXONC:
case VKI_TCSBRKP:
case VKI_TCFLSH:
+ case VKI_TIOCSIG:
/* These just take an int by value */
break;
case VKI_TIOCGWINSZ:
@@ -8270,6 +8271,7 @@
case VKI_TCXONC:
case VKI_TCSBRKP:
case VKI_TCFLSH:
+ case VKI_TIOCSIG:
break;
case VKI_TIOCGWINSZ:
POST_MEM_WRITE( ARG3, sizeof(struct vki_winsize) );
Modified: trunk/include/vki/vki-linux.h
==============================================================================
--- trunk/include/vki/vki-linux.h (original)
+++ trunk/include/vki/vki-linux.h Tue Oct 21 08:20:20 2014
@@ -2955,6 +2955,10 @@
#define VKI_FIOQSIZE 0x5460 /* Value differs on some platforms */
#endif
+#ifndef VKI_TIOCSIG
+#define VKI_TIOCSIG _VKI_IOW('T', 0x36, int) /* Value differs on some platforms */
+#endif
+
//----------------------------------------------------------------------
// From kernel/common/include/linux/ashmem.h
//----------------------------------------------------------------------
Modified: trunk/memcheck/tests/linux/Makefile.am
==============================================================================
--- trunk/memcheck/tests/linux/Makefile.am (original)
+++ trunk/memcheck/tests/linux/Makefile.am Tue Oct 21 08:20:20 2014
@@ -6,6 +6,7 @@
EXTRA_DIST = \
brk.stderr.exp brk.vgtest \
capget.vgtest capget.stderr.exp capget.stderr.exp2 \
+ ioctl-tiocsig.vgtest ioctl-tiocsig.stderr.exp \
lsframe1.vgtest lsframe1.stdout.exp lsframe1.stderr.exp \
lsframe2.vgtest lsframe2.stdout.exp lsframe2.stderr.exp \
rfcomm.vgtest rfcomm.stderr.exp \
@@ -24,6 +25,7 @@
check_PROGRAMS = \
brk \
capget \
+ ioctl-tiocsig \
getregset \
lsframe1 \
lsframe2 \
Added: trunk/memcheck/tests/linux/ioctl-tiocsig.c
==============================================================================
--- trunk/memcheck/tests/linux/ioctl-tiocsig.c (added)
+++ trunk/memcheck/tests/linux/ioctl-tiocsig.c Tue Oct 21 08:20:20 2014
@@ -0,0 +1,7 @@
+#include <sys/ioctl.h>
+
+int main()
+{
+ ioctl(9, TIOCSIG, 9);
+ return 0;
+}
Added: trunk/memcheck/tests/linux/ioctl-tiocsig.stderr.exp
==============================================================================
(empty)
Added: trunk/memcheck/tests/linux/ioctl-tiocsig.vgtest
==============================================================================
--- trunk/memcheck/tests/linux/ioctl-tiocsig.vgtest (added)
+++ trunk/memcheck/tests/linux/ioctl-tiocsig.vgtest Tue Oct 21 08:20:20 2014
@@ -0,0 +1,2 @@
+prog: ioctl-tiocsig
+vgopts: -q
|