Linux user input device ioctls missing wrappers

Bug #958095 reported by Chase Douglas
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Valgrind
Fix Released
Wishlist
valgrind (Ubuntu)
Fix Released
Wishlist
Chase Douglas

Bug Description

The user input device ioctls defined in linux/uinput.h need wrappers because they either don't provide a third argument or they provide an int value instead of a pointer to a memory location.

This causes valgrind errors like:

==1178== Syscall param ioctl(generic) points to unaddressable byte(s)
==1178== at 0x6AC8FB7: ioctl (syscall-template.S:82)
==1178== by 0x4E33FA0: evemu_create (evemu.c:468)
==1178== by 0x412698: utouch::evemu::Device::Device(char const*) (device.cpp:54)
==1178== by 0x425DD0: AtomicTap_Recording_Test::TestBody() (atomic-timeout.cpp:170)
==1178== by 0x46C2BC: void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (in /home/cndougla/Canonical/x/upstream/utouch-gra
il/tap-fixes/test/check-grail)
==1178== by 0x463FE0: testing::Test::Run() (in /home/cndougla/Canonical/x/upstream/utouch-grail/tap-fixes/test/check-grail)
==1178== by 0x4640C5: testing::TestInfo::Run() (in /home/cndougla/Canonical/x/upstream/utouch-grail/tap-fixes/test/check-grail)
==1178== by 0x464206: testing::TestCase::Run() (in /home/cndougla/Canonical/x/upstream/utouch-grail/tap-fixes/test/check-grail)
==1178== by 0x46455D: testing::internal::UnitTestImpl::RunAllTests() (in /home/cndougla/Canonical/x/upstream/utouch-grail/tap-fixes/test/check-grail)
==1178== by 0x46BE3C: bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char cons
t*) (in /home/cndougla/Canonical/x/upstream/utouch-grail/tap-fixes/test/check-grail)
==1178== by 0x46363D: testing::UnitTest::Run() (in /home/cndougla/Canonical/x/upstream/utouch-grail/tap-fixes/test/check-grail)
==1178== by 0x56740B4: main (main.cpp:123)
==1178== Address 0x0 is not stack'd, malloc'd or (recently) free'd

The default valgrind ioctl signatures do not match how the uinput ioctls work. These errors are false positives.

Related branches

Revision history for this message
In , Chase Douglas (chasedouglas) wrote :

Created attachment 69693
Add ioctl wrappers for linux user input devices

The user input device ioctls defined in linux/uinput.h need wrappers because they either don't provide a third argument or they provide an int value instead of a pointer to a memory location.

Revision history for this message
In , Chase Douglas (chasedouglas) wrote :

Although I'm reporting the bug against Ubuntu's valgrind package because it's what I've tested with, the attached patch is against a trunk svn checkout.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package valgrind - 1:3.7.0-0ubuntu3

---------------
valgrind (1:3.7.0-0ubuntu3) precise; urgency=low

  * Add uinput ioctl wrappers to fix false positive errors. (LP: #958095)
    - Add 0011-uinput-ioctls.patch.
 -- Chase Douglas <email address hidden> Sat, 17 Mar 2012 12:29:21 -0700

Changed in valgrind (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
In , Jseward (jseward) wrote :

(In reply to comment #0)
> Created attachment 69693 [details]
> Add ioctl wrappers for linux user input devices

This looks like a patch for XOrg, not for Valgrind. Did you get the
right one?

Revision history for this message
In , Chase Douglas (chasedouglas) wrote :

Comment on attachment 69693
Add ioctl wrappers for linux user input devices

Yes, the patch is bogus. I'll attach the patch I applied to the Ubuntu package.

Revision history for this message
In , Chase Douglas (chasedouglas) wrote :

Created attachment 72333
Add uinput ioctl wrappers

Changed in valgrind:
importance: Unknown → Wishlist
status: Unknown → New
Revision history for this message
In , Jseward (jseward) wrote :

Committed, r12737. Thanks for the patch.
I had to apply one of the hunks by hand -- I think it conflicted with
some other recent ioctl commits. So it would be good if you could
check over the commit to see it's OK. Thanks.

Revision history for this message
In , Chase Douglas (chasedouglas) wrote :

I haven't built and tested it, but the committed change looks correct.

Thanks!

Changed in valgrind:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.