Bug 139076 - valgrind VT_GETSTATE error
Summary: valgrind VT_GETSTATE error
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.2.1
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: blocking3.5.0
Assignee: Nicholas Nethercote
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-21 01:09 UTC by Garrett D'Amore
Modified: 2009-07-13 08:43 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Garrett D'Amore 2006-12-21 01:09:26 UTC
The handler for VT_GETSTATE assumes that the state structure is read by the
Linux kernel.  It is not; and it is perfectly reasonable to pass it an
unitialized structure.  On exit, only two fields are initialized on return, but
valgrind gets that part right.

Here's the diff: 

Index: coregrind/m_syswrap/syswrap-generic.c
===================================================================
--- coregrind/m_syswrap/syswrap-generic.c       (revision 6412)
+++ coregrind/m_syswrap/syswrap-generic.c       (working copy)
@@ -3992,7 +3992,6 @@
       PRE_MEM_READ( "ioctl(VT_SETMODE)", ARG3, sizeof(struct vki_vt_mode) );
       break;
    case VKI_VT_GETSTATE:
-      PRE_MEM_READ( "ioctl(VT_GETSTATE)", ARG3, sizeof(struct vki_vt_stat) );
       PRE_MEM_WRITE( "ioctl(VT_GETSTATE).v_active",
                      (Addr) &(((struct vki_vt_stat*) ARG3)->v_active),
                      sizeof(((struct vki_vt_stat*) ARG3)->v_active));
Comment 1 Nicholas Nethercote 2009-07-13 08:43:56 UTC
Committed as r10437.  Thanks for the report;  sorry it took so long to be fixed.