On 24/03/14 07:09, Subhashish Pradhan wrote:

> The eject.c example provided here at http://leapster.org/linux/cdrom/
> will compile successfuly
> with a #include <stdlib.h>. Then when run it under as "valgrind
> ./eject', it still reports:
>
> ==6212== Command: ./eject
> ==6212==
> ==6212== Warning: noted but unhandled ioctl 0x5309 with no size/direction 
> hints
> ==6212==    This could cause spurious value errors to appear.
> ==6212==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on
> writing a proper wrapper.
>
> Why would that be? (since ioctls are wrapped in
> coregrind/m_syswrap/syswrap-linux.c)

The ioctl system call in general is wrapped, but it doesn't know about 
every single ioctl, so you may need to teach it. If you read the file it 
mentions in the message you will find some hints, especially in the 
final section about ioctls.

> What is this "ioctl 0x5309 with no size/redirection hints" and how
> could that be solved
> by PRE or POST functions?

Because the ioctl number can encode the size and direction of memory 
access valgrind can sometimes guess at how much memory will be read or 
written by a system call.

Not all ioctls actually make use of that facility though, and even when 
they do it may not be right, so valgrind has specific wrappers for many 
ioctls to make sure we do the right thing.

> Or specifically, I couldn't understand the 0x5309 operation code
> context as explained in this post on this mailing list below:
> <http://valgrind.10908.n7.nabble.com/noted-but-unhandled-ioctl-0xae03-with-no-size-direction-hints-tp38957p38959.html>

Add it to the switch statement in the ioctl wrappers, with appropriate 
calls to indicate how much memory is read/written.

In this case, and assuming that ioctl triggers the eject, it may well be 
that no memory is read/written, but you'd have to look at the kernel and 
see what that ioctl does to be sure.

Tom

-- 
Tom Hughes (t...@compton.nu)
http://compton.nu/

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to